Tag Info

New answers tagged


Short answer: Your feature type doesn't match the Shapefile standard so the illegal bits get dropped by GeoTools. I have a utility class to fix this - try { String url = "geojson.json"; File geojson = new File(url); File shpFile = new File("test.shp"); ShapefileDataStoreFactory dataStoreFactory = new ...


For a much more lightweight alternative to GeoTools, check out jts2geojson: GeoJSONReader reader = new GeoJSONReader(); Geometry geometry = reader.read(json);


JTS's DistanceOP#nearestPoints might be an easy way. I have not tested it. http://tsusiatsoftware.net/jts/javadoc/com/vividsolutions/jts/operation/distance/DistanceOp.html#nearestPoints%28com.vividsolutions.jts.geom.Geometry,%20com.vividsolutions.jts.geom.Geometry%29 Compute the the nearest points of two geometries. The points are presented in the same ...

Top 50 recent answers are included