use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.
the class DimensionInfoTest method testFind_Coordinate_Geometry.
/**
* Test of find method, of class DimensionInfo.
*/
@Test
public void testFind_Coordinate_Geometry() {
Coordinate coordinate = new CoordinateXY(1.0, 2.0);
GeometryFactory factory = new GeometryFactory();
Geometry geometry = factory.createPoint(coordinate);
DimensionInfo expResult = DimensionInfo.XY_POINT;
DimensionInfo result = DimensionInfo.find(coordinate, geometry);
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.
the class DimensionInfoTest method testFind_List_Geometry.
/**
* Test of find method, of class DimensionInfo.
*/
@Test
public void testFind_List_Geometry() {
List<Coordinate> coordinates = Arrays.asList(new CoordinateXY(1.0, 2.0), new CoordinateXY(10.0, 20.0));
GeometryFactory factory = new GeometryFactory();
Geometry geometry = factory.createLineString(coordinates.toArray(new Coordinate[coordinates.size()]));
DimensionInfo expResult = DimensionInfo.XY_LINESTRING;
DimensionInfo result = DimensionInfo.find(coordinates, geometry);
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.
the class GMLReaderTest method testExtractArc.
/**
* Test of extract method, of class GMLReader.
*
* @throws org.jdom2.JDOMException
* @throws java.io.IOException
*/
@Test
public void testExtractArc() throws JDOMException, IOException {
GeometricShapeFactory shapeFactory = new GeometricShapeFactory(GEOMETRY_FACTORY);
shapeFactory.setCentre(new CoordinateXY(0, 0));
shapeFactory.setWidth(10);
// Semi-cicle centred around 0,0 and radius 5.
Geometry arc = shapeFactory.createArc(0, Math.PI);
GMLReader expResult = new GMLReader(arc, 2, SRS_URI.OSGB36_CRS);
String gmlText = "<gml:Curve xmlns:gml=\"http://www.opengis.net/ont/gml\" srsName=\"http://www.opengis.net/def/crs/EPSG/0/27700\"><gml:segments><gml:Arc><gml:posList>5 0 0 5 -5 0</gml:posList></gml:Arc></gml:segments></gml:Curve>";
GMLReader result = GMLReader.extract(gmlText);
//
//
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.
the class GMLReaderTest method testGetGeometryPoint.
/**
* Test of getGeometry method, of class GMLReader.
*/
@Test
public void testGetGeometryPoint() {
GMLReader instance = new GMLReader(GEOMETRY_FACTORY.createPoint(new CoordinateXY(11.0, 12.0)), 2);
Geometry expResult = GEOMETRY_FACTORY.createPoint(new CustomCoordinateSequence(CoordinateSequenceDimensions.XY, "11.0 12.0"));
Geometry result = instance.getGeometry();
//
//
assertEquals(expResult, result);
}
use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.
the class GMLReaderTest method testExtractCircle.
/**
* Test of extract method, of class GMLReader.
*
* @throws org.jdom2.JDOMException
* @throws java.io.IOException
*/
@Test
public void testExtractCircle() throws JDOMException, IOException {
GeometricShapeFactory shapeFactory = new GeometricShapeFactory(GEOMETRY_FACTORY);
shapeFactory.setCentre(new CoordinateXY(0, 0));
shapeFactory.setWidth(10);
Geometry circle = shapeFactory.createCircle().getExteriorRing();
GMLReader expResult = new GMLReader(circle, 2, SRS_URI.OSGB36_CRS);
String gmlText = "<gml:Curve xmlns:gml=\"http://www.opengis.net/ont/gml\" srsName=\"http://www.opengis.net/def/crs/EPSG/0/27700\"><gml:segments><gml:Circle><gml:posList>5 0 0 5 -5 0</gml:posList></gml:Circle></gml:segments></gml:Curve>";
GMLReader result = GMLReader.extract(gmlText);
//
//
assertEquals(expResult, result);
}
Aggregations