use of org.locationtech.jts.geom.Coordinate in project jena by apache.
the class GMLReaderTest method testGetGeometryPointZ.
/**
* Test of getGeometry method, of class GMLReader.
*/
@Test
public void testGetGeometryPointZ() {
GMLReader instance = new GMLReader(GEOMETRY_FACTORY.createPoint(new Coordinate(11.0, 12.0, 13.0)), 2);
Geometry expResult = GEOMETRY_FACTORY.createPoint(new CustomCoordinateSequence(CoordinateSequenceDimensions.XYZ, "11.0 12.0 8.0"));
Geometry result = instance.getGeometry();
//
//
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.Coordinate in project jena by apache.
the class GeometryWrapperFactoryTest method testCreatLineString_xy.
/**
* Test of createLineString method, of class GeometryWrapper.
*/
@Test
public void testCreatLineString_xy() {
List<Coordinate> coordinates = Arrays.asList(new Coordinate(1, 2), new Coordinate(10, 20));
String srsURI = SRS_URI.DEFAULT_WKT_CRS84;
String geometryDatatypeURI = WKTDatatype.URI;
GeometryWrapper instance = GeometryWrapperFactory.createLineString(coordinates, srsURI, geometryDatatypeURI);
String expResult = "LINESTRING(1 2, 10 20)";
String result = instance.asLiteral().getLexicalForm();
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.Coordinate in project jena by apache.
the class GeometryWrapperFactoryTest method testCreatPoint_xy.
/**
* Test of createPoint method, of class GeometryWrapper.
*/
@Test
public void testCreatPoint_xy() {
Coordinate coordinate = new Coordinate(1, 2);
String srsURI = SRS_URI.DEFAULT_WKT_CRS84;
String geometryDatatypeURI = WKTDatatype.URI;
GeometryWrapper instance = GeometryWrapperFactory.createPoint(coordinate, srsURI, geometryDatatypeURI);
String expResult = "POINT(1 2)";
String result = instance.asLiteral().getLexicalForm();
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.Coordinate in project jena by apache.
the class GeometryWrapperFactoryTest method testCreatPolygon.
/**
* Test of createPolygon method, of class GeometryWrapper.
*/
@Test
public void testCreatPolygon() {
List<Coordinate> coordinates = Arrays.asList(new Coordinate(1, 2), new Coordinate(10, 2), new Coordinate(10, 20), new Coordinate(1, 20), new Coordinate(1, 2));
String srsURI = SRS_URI.WGS84_CRS;
String geometryDatatypeURI = WKTDatatype.URI;
GeometryWrapper instance = GeometryWrapperFactory.createPolygon(coordinates, srsURI, geometryDatatypeURI);
String expResult = "<http://www.opengis.net/def/crs/EPSG/0/4326> POLYGON((2 1, 2 10, 20 10, 20 1, 2 1))";
String result = instance.asLiteral().getLexicalForm();
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.Coordinate in project jena by apache.
the class GeometryWrapperTest method testGetXYGeometry_polygon.
/**
* Test of getXYGeometry method, of class GeometryWrapper.
*
* @throws org.opengis.util.FactoryException
* @throws org.opengis.referencing.operation.TransformException
*/
@Test
public void testGetXYGeometry_polygon() throws FactoryException, MismatchedDimensionException, TransformException {
GeometryWrapper instance = GeometryWrapper.extract("<http://www.opengis.net/def/crs/EPSG/0/4326> POLYGON((10.0 -180.0, 20.0 -180.0, 20.0 -170.0, 10.0 -170.0, 10.0 -180.0))", WKTDatatype.URI);
Coordinate[] coordinates = { new Coordinate(-180.0, 10.0), new Coordinate(-180.0, 20.0), new Coordinate(-170.0, 20.0), new Coordinate(-170.0, 10.0), new Coordinate(-180.0, 10.0) };
Geometry expResult = GEOMETRY_FACTORY.createPolygon(coordinates);
Geometry result = instance.getXYGeometry();
assertEquals(expResult, result);
}
Aggregations