例如,如果您有这样一个geojson文件和一个多边形(测试的简单文件)
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-4.658203125,
41.343824581185686
],
[
-5.6689453125,
39.13006024213511
],
[
-1.9335937499999998,
39.16414104768742
],
[
-1.3623046875,
41.21172151054787
],
[
-4.658203125,
41.343824581185686
]
]
]
}
}
]
}
要点:
Geometry point2 = new WKTReader().read("POINT (-3.2958984375 40.44694705960048)");
你想把GEJSON文件加载到你的程序中,测试这个多边形中包含的点