小编jon*_*yes的帖子

如何使用GeoTools创建具有纬度,经度和半径的圆?

现在我有:

Polygon circle = geometryBuilder.circle(
myLong,
myLat, 
radiusInMeters, 10);
Run Code Online (Sandbox Code Playgroud)

它创建(使用lat = 28.456306,long = -16.292034和radius = 500)一个具有巨大纬度和经度的无意义多边形,例如:

POLYGON ((483.678055 28.482505000000003, 388.1865521874737 -265.4101211462366, 138.1865521874737 -447.04575314757676, -170.8304421874737 -447.0457531475768, -420.8304421874737 -265.41012114623663, -516.321945 28.482504999999943, -420.83044218747375 322.3751311462365, -170.8304421874738 504.01076314757677, 138.18655218747358 504.0107631475768, 388.18655218747364 322.3751311462367, 483.678055 28.482505000000003))
Run Code Online (Sandbox Code Playgroud)

我希望在我提供的中心点附近有十对坐标,lat和long.

任何帮助都会有所帮助.提前致谢!

编辑

除了@iant的回答,我还得创建Point一个Feature

//build the type
SimpleFeatureType TYPE = null;
try {
    TYPE = DataUtilities.createType("", "Location", "locations:Point:srid=4326," + "id:Integer" // a
            // number
            // attribute
            );
} catch (Exception e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace(); …
Run Code Online (Sandbox Code Playgroud)

java geotools

6
推荐指数
2
解决办法
5835
查看次数

标签 统计

geotools ×1

java ×1