Search in sources :

Example 51 with CoordinateSystem

use of com.revolsys.geometry.cs.CoordinateSystem in project com.revolsys.open by revolsys.

the class EsriCoordinateSystemsTest method verticalCoordinateSystems.

@Test
public void verticalCoordinateSystems() {
    try (RecordReader reader = RecordReader.newRecordReader("../com.revolsys.open.coordinatesystems/src/main/data/esri/esriVerticalCs.tsv")) {
        for (final Record record : reader) {
            final int id = record.getInteger("ID");
            final String wkt = record.getString("WKT");
            if (wkt.contains("VDATUM")) {
                final CoordinateSystem coordinateSystem = CoordinateSystem.getCoordinateSystem(wkt);
                final int coordinateSystemId = coordinateSystem.getCoordinateSystemId();
                Assert.assertEquals(id, coordinateSystemId);
                final String actualWkt = coordinateSystem.toEsriWktCs();
                if (Property.isEmpty(actualWkt)) {
                    CoordinateSystem.getCoordinateSystem(wkt);
                    coordinateSystem.toEsriWktCs();
                }
                Assert.assertEquals(wkt, actualWkt);
            }
        }
    }
}
Also used : CoordinateSystem(com.revolsys.geometry.cs.CoordinateSystem) RecordReader(com.revolsys.record.io.RecordReader) Record(com.revolsys.record.Record) Test(org.junit.Test)

Aggregations

CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)51 ProjectedCoordinateSystem (com.revolsys.geometry.cs.ProjectedCoordinateSystem)28 GeographicCoordinateSystem (com.revolsys.geometry.cs.GeographicCoordinateSystem)25 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)14 BoundingBox (com.revolsys.geometry.model.BoundingBox)11 Point (com.revolsys.geometry.model.Point)8 CompoundCoordinateSystem (com.revolsys.geometry.cs.CompoundCoordinateSystem)7 EngineeringCoordinateSystem (com.revolsys.geometry.cs.EngineeringCoordinateSystem)7 GeocentricCoordinateSystem (com.revolsys.geometry.cs.GeocentricCoordinateSystem)7 VerticalCoordinateSystem (com.revolsys.geometry.cs.VerticalCoordinateSystem)7 ArrayList (java.util.ArrayList)6 CoordinateOperationMethod (com.revolsys.geometry.cs.CoordinateOperationMethod)5 Map (java.util.Map)5 DataType (com.revolsys.datatype.DataType)4 LinearUnit (com.revolsys.geometry.cs.unit.LinearUnit)4 Record (com.revolsys.record.Record)4 FieldDefinition (com.revolsys.record.schema.FieldDefinition)4 PrintWriter (java.io.PrintWriter)4 IntHashMap (com.revolsys.collection.map.IntHashMap)3 ParameterValueString (com.revolsys.geometry.cs.ParameterValueString)3