Skip to content

Instantly share code, notes, and snippets.

public void testSPT() throws Exception {
//read shape
InputStream is = Files.newInputStream(Paths.get("/Users/ivera/Desktop", "tx.wkt"));
BufferedReader reader = new BufferedReader(new InputStreamReader(is));
String line = reader.readLine();
// create shape using JTS spatial context
JtsSpatialContext spatialContext = JtsSpatialContext.GEO;
Shape s = spatialContext.getFormats().getWktReader().read(line);
//Geometry geometry = ((JtsGeometry)s).getGeom().getGeometryN(134);
//s = new JtsGeometry(geometry, spatialContext, true, true);
@iverase
iverase / gist:9c1db5892424c5f444088ef4d9a7bca6
Last active November 22, 2018 09:44
geo_shape orientation
PUT geoshape
{
"settings":{
"number_of_shards": 1,
"number_of_replicas": 0
}
}
GET geoshape/_mapping