Search in sources :

Example 6 with CoordinateXY

use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.

the class GMLReaderTest method testExtractPoint2.

/**
 * Test of extract method, of class GMLReader.
 *
 * @throws org.jdom2.JDOMException
 * @throws java.io.IOException
 */
@Test
public void testExtractPoint2() throws JDOMException, IOException {
    String gmlText = "<gml:Point xmlns:gml=\"http://www.opengis.net/ont/gml\" srsName=\"http://www.opengis.net/def/crs/EPSG/0/27700\"><gml:pos>11.0 12.0</gml:pos></gml:Point>";
    GMLReader expResult = new GMLReader(GEOMETRY_FACTORY.createPoint(new CoordinateXY(11.0, 12.0)), 2, SRS_URI.OSGB36_CRS);
    GMLReader result = GMLReader.extract(gmlText);
    // 
    // 
    assertEquals(expResult, result);
}
Also used : CoordinateXY(org.locationtech.jts.geom.CoordinateXY) LineString(org.locationtech.jts.geom.LineString) Test(org.junit.Test)

Example 7 with CoordinateXY

use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.

the class GMLReaderTest method testGetDimensionInfo2.

/**
 * Test of getDimensionInfo method, of class GMLReader.
 */
@Test
public void testGetDimensionInfo2() {
    GMLReader instance = new GMLReader(GEOMETRY_FACTORY.createPoint(new CoordinateXY(11.0, 12.0)), 2);
    DimensionInfo expResult = new DimensionInfo(2, 2, 0);
    DimensionInfo result = instance.getDimensionInfo();
    // 
    // 
    assertEquals(expResult, result);
}
Also used : CoordinateXY(org.locationtech.jts.geom.CoordinateXY) DimensionInfo(org.apache.jena.geosparql.implementation.DimensionInfo) Test(org.junit.Test)

Example 8 with CoordinateXY

use of org.locationtech.jts.geom.CoordinateXY in project jena by apache.

the class CoordinateSequenceDimensionsTest method testFind_xy2.

/**
 * Test of find method, of class CoordinateSequenceDimensions.
 */
@Test
public void testFind_xy2() {
    Coordinate coordinate = new CoordinateXY(1.0, 2.0);
    CoordinateSequenceDimensions expResult = CoordinateSequenceDimensions.XY;
    CoordinateSequenceDimensions result = CoordinateSequenceDimensions.find(coordinate);
    assertEquals(expResult, result);
}
Also used : Coordinate(org.locationtech.jts.geom.Coordinate) CoordinateXY(org.locationtech.jts.geom.CoordinateXY) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)8 CoordinateXY (org.locationtech.jts.geom.CoordinateXY)8 Geometry (org.locationtech.jts.geom.Geometry)5 Coordinate (org.locationtech.jts.geom.Coordinate)3 LineString (org.locationtech.jts.geom.LineString)3 GeometryFactory (org.locationtech.jts.geom.GeometryFactory)2 GeometricShapeFactory (org.locationtech.jts.util.GeometricShapeFactory)2 DimensionInfo (org.apache.jena.geosparql.implementation.DimensionInfo)1 CustomCoordinateSequence (org.apache.jena.geosparql.implementation.jts.CustomCoordinateSequence)1