我在将 GeoJSON 对象转换为 GML 几何对象时遇到了以下问题。
首先,在请求的后端中,我检索 GeoJSON 对象。 然后我使用 jackson 库将其转换为 Java 对象。这个 Java 对象是来自 geojson-jackson 库的 FeatureCollection。 因此,我有一个代表 GeoJSON 的 Java 对象在后端,现在我需要将其转换为 GML 对象并从中提取几何形状。
从这里开始:
{
"featureCollection : {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [ [[100.0,0.0],[101.0,0.0],[101.0,1.0],[100.0,1.0],[100.0,0.0]] ]
},
}]
}
}
我需要获取这个:
<gml:Rectangle srsName="urn:x-ogc:def:crs:EPSG:6.6:25833">
<gml:exterior>
<gml:LinearRing>
<gml:coordinates>100.0,0.0 101.0,0.0 101.0,1.0 100.0,1.0 100.0,0.0</gml:coordinates>
</gml:LinearRing>
</gml:exterior>
</gml:Rectangle>
这个问题是:是否有现成的库可以将GeoJSON转换为GML对象?