use of com.vividsolutions.jts.geom.GeometryFactory in project teiid by teiid.
the class TestGeometry method testEwkbZCooridinate.
@Test(expected = ExpressionEvaluationException.class)
public void testEwkbZCooridinate() throws Exception {
WKBWriter writer = new WKBWriter(3, true);
GeometryFactory gf = new GeometryFactory();
Point point = gf.createPoint(new Coordinate(0, 0, 0));
ByteArrayOutputStream baos = new ByteArrayOutputStream();
writer.write(point, new OutputStreamOutStream(baos));
Expression ex1 = TestFunctionResolving.getExpression("ST_GeomFromBinary(X'" + new BinaryType(baos.toByteArray()) + "', 8307)");
Evaluator.evaluate(ex1);
}
use of com.vividsolutions.jts.geom.GeometryFactory in project tutorials by eugenp.
the class ShapeFile method main.
public static void main(String[] args) throws Exception {
DefaultFeatureCollection collection = new DefaultFeatureCollection();
GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory(null);
SimpleFeatureType TYPE = DataUtilities.createType("Location", "location:Point:srid=4326," + "name:String");
SimpleFeatureType CITY = createFeatureType();
addLocations(CITY, collection);
File shapeFile = getNewShapeFile();
ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory();
Map<String, Serializable> params = new HashMap<String, Serializable>();
ShapefileDataStore dataStore = setDataStoreParams(dataStoreFactory, params, shapeFile, CITY);
writeToFile(dataStore, collection);
}
Aggregations