Search in sources :

Example 71 with CustomCoordinateSequence

use of org.apache.jena.geosparql.implementation.jts.CustomCoordinateSequence in project jena by apache.

the class GMLReader method buildLineString.

private static LineString buildLineString(Element gmlElement, CoordinateSequenceDimensions dims) {
    int srsDimension = CoordinateSequenceDimensions.convertToInt(dims);
    String posList = extractPosList(gmlElement, srsDimension);
    CustomCoordinateSequence coordinateSequence = new CustomCoordinateSequence(dims, posList);
    return GEOMETRY_FACTORY.createLineString(coordinateSequence);
}
Also used : CustomCoordinateSequence(org.apache.jena.geosparql.implementation.jts.CustomCoordinateSequence)

Example 72 with CustomCoordinateSequence

use of org.apache.jena.geosparql.implementation.jts.CustomCoordinateSequence in project jena by apache.

the class GeometryWrapper method fromPoint.

/**
 * Builds a WKT Point of Geometry Wrapper.<br>
 * This method does not use the GeometryLiteralIndex and so is best used for
 * one of Geometry Wrappers.
 *
 * @return Geometry Wrapper of WKT Point.
 */
public static final GeometryWrapper fromPoint(double x, double y, String srsURI) {
    CustomCoordinateSequence coordSequence = CustomCoordinateSequence.createPoint(x, y);
    GeometryWrapper geometryWrapper = new GeometryWrapper(coordSequence, WKTDatatype.URI, srsURI);
    return geometryWrapper;
}
Also used : CustomCoordinateSequence(org.apache.jena.geosparql.implementation.jts.CustomCoordinateSequence)

Aggregations

CustomCoordinateSequence (org.apache.jena.geosparql.implementation.jts.CustomCoordinateSequence)72 Geometry (org.locationtech.jts.geom.Geometry)49 Test (org.junit.Test)48 LineString (org.locationtech.jts.geom.LineString)44 DimensionInfo (org.apache.jena.geosparql.implementation.DimensionInfo)39 GeometryWrapper (org.apache.jena.geosparql.implementation.GeometryWrapper)39 LinearRing (org.locationtech.jts.geom.LinearRing)10 Polygon (org.locationtech.jts.geom.Polygon)8 Element (org.jdom2.Element)4 MultiLineString (org.locationtech.jts.geom.MultiLineString)3 MultiPoint (org.locationtech.jts.geom.MultiPoint)3 Point (org.locationtech.jts.geom.Point)3 DatatypeFormatException (org.apache.jena.datatypes.DatatypeFormatException)2 ArrayList (java.util.ArrayList)1 Coordinate (org.locationtech.jts.geom.Coordinate)1 CoordinateXY (org.locationtech.jts.geom.CoordinateXY)1