「泰森多边形java」泰森多边形的定义

博主:adminadmin 2022-12-22 20:09:11 67

今天给各位分享泰森多边形java的知识,其中也会对泰森多边形的定义进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

eclipse颜色设置

刚刚安装Eclipse,结果背景色是白色的.个人比较喜欢背景色暗一点的,最好的全黑的,就上网百度了一下如何调颜色的问题.

第一种:我们可以直接换背景色以及其他颜色(譬如:注释,关键字等)

window-Preferences 搜索 color-java-Editor-Syntax Coloring-java 然后就可以下面进行颜色的变换了.(有一点不好的是,换完之后好多颜色都不协调,还要换好多.而且再往回去换,要很麻烦,所以新手还是不建议自己换)

第二种: 使用着色器

1 找到eclipse左上角的Help

2 help-Eclipse Marketplace-find中搜索"Theme"

3 搜索完成后 找到 "Eclipse Color Theme" 点击Install

4 在弹出的对话框中,点击“Next”,接下来选择“I accept the terms of the license agreement”,然后点击“Finish”等待安装

5 .安装过程Eclipse会弹出安全警告“Security Warning”,直接点击“OK”继续

6.在安装完后Eclipse会弹出重启软件提示“Software Updates”,直接点击“Yes”重启Eclipse

7.当Eclipse重启完成后,就可以使用着色插件(Eclipse Color Theme)了

如何使用

window-Preferences 搜索 color theme 选择自己喜欢的-Apply-ok,就行了

(

Eclipse Marketplace是个插件应用商店,很实用的一个功能。

打开 eclipse,help--Eclipse Marketplace Client就能找到

有的eclipse中没有这个功能就需手动添加Eclipse Marketplace Client。

help--install new software

地址栏输入: (这里使用Eclipse indigo版本,根据你的Eclipse版本替换URL中的indigo字符串,Eclipse中各个版本的名称见下面)

输入回车后,选择General Purpose Tools - Marketplace Client, 然后一路Next或Agree

下载完成后,重启eclipse,选择help--Eclipse Marketplace Client,就可以搜索插件下载安装了。

如何用Java写出泰森多边形算法代码???我找了好多资源表示无解呀?

package com.wangyin.seapay.loginkgo;

import java.util.HashMap;

import java.util.Map;

import java.util.logging.Level;

import java.util.logging.Logger;

import org.geotools.data.simple.SimpleFeatureCollection;

import org.geotools.process.Process;

import org.geotools.process.ProcessException;

import org.geotools.process.ProcessFactory;

import org.geotools.process.spatialstatistics.core.Params;

import org.geotools.process.spatialstatistics.enumeration.ThiessenAttributeMode;

import org.geotools.process.spatialstatistics.operations.ThiessenPolygonOperation;

import org.geotools.text.Text;

import org.geotools.util.NullProgressListener;

import org.geotools.util.logging.Logging;

import org.opengis.util.ProgressListener;

import com.vividsolutions.jts.geom.Geometry;

/**

 * Created by hanxiaofei on 2018/4/11.

 */

public class ThiessenPolygonProcess extends AbstractStatisticsProcess {

    protected static final Logger LOGGER = Logging.getLogger(ThiessenPolygonProcess.class);

    private boolean started = false;

    public ThiessenPolygonProcess(ProcessFactory factory) {

        super(factory);

    }

    public ProcessFactory getFactory() {

        return factory;

    }

    public static SimpleFeatureCollection process(SimpleFeatureCollection inputFeatures,

                                                  ThiessenAttributeMode attributes, Geometry clipArea, ProgressListener monitor) {

        MapString, Object map = new HashMapString, Object();

        map.put(ThiessenPolygonProcessFactory.inputFeatures.key, inputFeatures);

        map.put(ThiessenPolygonProcessFactory.attributes.key, attributes);

        map.put(ThiessenPolygonProcessFactory.clipArea.key, clipArea);

        Process process = new ThiessenPolygonProcess(null);

        MapString, Object resultMap;

        try {

            resultMap = process.execute(map, monitor);

            return (SimpleFeatureCollection) resultMap

                    .get(ThiessenPolygonProcessFactory.RESULT.key);

        } catch (ProcessException e) {

            LOGGER.log(Level.FINER, e.getMessage(), e);

        }

        return null;

    }

    @Override

    public MapString, Object execute(MapString, Object input, ProgressListener monitor)

            throws ProcessException {

        if (started)

            throw new IllegalStateException("Process can only be run once");

        started = true;

        if (monitor == null)

            monitor = new NullProgressListener();

        try {

            monitor.started();

            monitor.setTask(Text.text("Grabbing arguments"));

            monitor.progress(10.0f);

            SimpleFeatureCollection inputFeatures = (SimpleFeatureCollection) Params.getValue(

                    input, ThiessenPolygonProcessFactory.inputFeatures, null);

            if (inputFeatures == null) {

                throw new NullPointerException("inputFeatures parameter required");

            }

            ThiessenAttributeMode attributes = (ThiessenAttributeMode) Params.getValue(input,

                    ThiessenPolygonProcessFactory.attributes,

                    ThiessenPolygonProcessFactory.attributes.sample);

            Geometry clipArea = (Geometry) Params.getValue(input,

                    ThiessenPolygonProcessFactory.clipArea, null);

            monitor.setTask(Text.text("Processing ..."));

            monitor.progress(25.0f);

            if (monitor.isCanceled()) {

                return null; // user has canceled this operation

            }

            // start process

            ThiessenPolygonOperation operation = new ThiessenPolygonOperation();

            operation.setAttributeMode(attributes);

            if (clipArea != null) {

                operation.setClipArea(clipArea);

            }

            SimpleFeatureCollection resultFc = operation.execute(inputFeatures);

            // end process

            monitor.setTask(Text.text("Encoding result"));

            monitor.progress(90.0f);

            MapString, Object resultMap = new HashMapString, Object();

            resultMap.put(ThiessenPolygonProcessFactory.RESULT.key, resultFc);

            monitor.complete(); // same as 100.0f

            return resultMap;

        } catch (Exception eek) {

            monitor.exceptionOccurred(eek);

            return null;

        } finally {

            monitor.dispose();

        }

    }

}

泰森多边形java的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于泰森多边形的定义、泰森多边形java的信息别忘了在本站进行查找喔。

The End

发布于:2022-12-22,除非注明,否则均为首码项目网原创文章,转载请注明出处。