I am working on parsing a GeoJSON file into Java POJO classes. I have found the GeoJSON Jackson library which seems to be exactly the same as I need. https://github.com/opendatalab-de/geojson-jackson I have a JSON like the following: { "type": "FeatureCollection", "features": [ ...
Writing Json is even easier. You just have to create the GeoJson objects and pass them to the Jackson ObjectMapper. FeatureCollectionfeatureCollection=newFeatureCollection();featureCollection.add(newFeature());Stringjson=newObjectMapper().writeValueAsString(featureCollection); ...
implementation 'org.n52.jackson:jackson-datatype-jts:1.2.4' Sample usage: @TestvoidtestJson()throwsIOException {varobjectMapper=newObjectMapper(); objectMapper.registerModule(newJtsModule());GeometryFactorygf=newGeometryFactory();Pointpoint=gf.createPoint(newCoordinate(1.2345678,2.3456789));Stringgeojson=o...
PostGIS + Postgresql + JTS + GeoJSON +Jackson 序列化反序列化 java中使用postgis操作地理位置数据简单说明了基本的postgis建模,还有其如何与java程序进行数据交互。 但postgis-jdbc中提供的java模型生态与通用行不好,在java生态中,还有一个专门进行几何运算的库JTS。 JTS Topology Suite(JTS)拓扑套件是开源Java软...