Search in sources :

Example 6 with ClockDirection

use of com.revolsys.geometry.model.ClockDirection in project com.revolsys.open by revolsys.

the class OracleSdoGeometryJdbcFieldDefinition method toSodAddPolygonRing.

private int toSodAddPolygonRing(int offset, final int[] elemInfo, final int elemIndex, final int elemType, final int axisCount, final double[] coordinates, final ClockDirection expectedRingOrientation, final LinearRing ring) {
    elemInfo[elemIndex] = offset + 1;
    // Exterior counter clockwise
    elemInfo[elemIndex + 1] = elemType;
    elemInfo[elemIndex + 2] = 1;
    final ClockDirection ringOrientation = ring.getClockDirection();
    if (ringOrientation == expectedRingOrientation) {
        offset = ring.copyCoordinates(axisCount, NAN_VALUE, coordinates, offset);
    } else {
        offset = ring.copyCoordinatesReverse(axisCount, NAN_VALUE, coordinates, offset);
    }
    return offset;
}
Also used : ClockDirection(com.revolsys.geometry.model.ClockDirection)

Aggregations

ClockDirection (com.revolsys.geometry.model.ClockDirection)6 Geometry (com.revolsys.geometry.model.Geometry)3 LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)1 MapEx (com.revolsys.collection.map.MapEx)1 GeometryReader (com.revolsys.geometry.io.GeometryReader)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 LineString (com.revolsys.geometry.model.LineString)1 LinearRing (com.revolsys.geometry.model.LinearRing)1 Point (com.revolsys.geometry.model.Point)1 Polygon (com.revolsys.geometry.model.Polygon)1 ArrayRecord (com.revolsys.record.ArrayRecord)1 Record (com.revolsys.record.Record)1 GeometryRecordReader (com.revolsys.record.io.GeometryRecordReader)1 RecordReader (com.revolsys.record.io.RecordReader)1 RecordReaderFactory (com.revolsys.record.io.RecordReaderFactory)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1