Search in sources :

Example 21 with LineStringDouble

use of com.revolsys.geometry.model.impl.LineStringDouble in project com.revolsys.open by revolsys.

the class GeoJsonGeometryReader method readPointCoordinatesList.

private LineString readPointCoordinatesList() {
    final JsonParser parser = this.in;
    final double[] values = parser.getDoubleArray();
    if (values == null) {
        return null;
    } else {
        return new LineStringDouble(values.length, values);
    }
}
Also used : JsonParser(com.revolsys.record.io.format.json.JsonParser) LineStringDouble(com.revolsys.geometry.model.impl.LineStringDouble)

Example 22 with LineStringDouble

use of com.revolsys.geometry.model.impl.LineStringDouble in project com.revolsys.open by revolsys.

the class GmlGeometryReader method toCoordinateList.

public static LineString toCoordinateList(final int axisCount, final List<double[]> listOfCoordinateArrays) {
    final int vertexCount = listOfCoordinateArrays.size();
    final double[] coordinates = new double[vertexCount * axisCount];
    for (int i = 0; i < vertexCount; i++) {
        final double[] coordinates2 = listOfCoordinateArrays.get(i);
        for (int j = 0; j < axisCount; j++) {
            final double value;
            if (j < coordinates2.length) {
                value = coordinates2[j];
            } else {
                value = Double.NaN;
            }
            coordinates[i * axisCount + j] = value;
        }
    }
    return new LineStringDouble(axisCount, coordinates);
}
Also used : Point(com.revolsys.geometry.model.Point) LineStringDouble(com.revolsys.geometry.model.impl.LineStringDouble)

Aggregations

LineStringDouble (com.revolsys.geometry.model.impl.LineStringDouble)22 Point (com.revolsys.geometry.model.Point)17 LineString (com.revolsys.geometry.model.LineString)10 ArrayList (java.util.ArrayList)7 CoordinatesDistanceComparator (com.revolsys.geometry.model.coordinates.comparator.CoordinatesDistanceComparator)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 List (java.util.List)2 TreeSet (java.util.TreeSet)2 BPlusTreeMap (com.revolsys.collection.bplus.BPlusTreeMap)1 IntHashMap (com.revolsys.collection.map.IntHashMap)1 MonotoneChainEdge (com.revolsys.geometry.geomgraph.index.MonotoneChainEdge)1 Edge (com.revolsys.geometry.graph.Edge)1 Node (com.revolsys.geometry.graph.Node)1 LineStringGraph (com.revolsys.geometry.graph.linestring.LineStringGraph)1 DelegatingLineString (com.revolsys.geometry.model.DelegatingLineString)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 Lineal (com.revolsys.geometry.model.Lineal)1 LinearRing (com.revolsys.geometry.model.LinearRing)1 Polygon (com.revolsys.geometry.model.Polygon)1