Search in sources :

Example 1 with WKTReader

use of com.revolsys.geometry.wkb.WKTReader in project com.revolsys.open by revolsys.

the class WKTReaderTest method testReadLargeNumbers.

public void testReadLargeNumbers() throws Exception {
    final GeometryFactory geometryFactory = GeometryFactory.fixed2d(0, 1E9, 1E9);
    final WKTReader reader = new WKTReader(geometryFactory);
    final Geometry point1 = reader.read("POINT(123456789.01234567890 10)");
    final Point point2 = geometryFactory.point(new PointDoubleXY(123456789.01234567890, 10));
    assertEquals(point1.getPoint().getX(), point2.getPoint().getX(), 1E-7);
    assertEquals(point1.getPoint().getY(), point2.getPoint().getY(), 1E-7);
}
Also used : Geometry(com.revolsys.geometry.model.Geometry) GeometryFactory(com.revolsys.geometry.model.GeometryFactory) Point(com.revolsys.geometry.model.Point) PointDoubleXY(com.revolsys.geometry.model.impl.PointDoubleXY) WKTReader(com.revolsys.geometry.wkb.WKTReader)

Aggregations

Geometry (com.revolsys.geometry.model.Geometry)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 Point (com.revolsys.geometry.model.Point)1 PointDoubleXY (com.revolsys.geometry.model.impl.PointDoubleXY)1 WKTReader (com.revolsys.geometry.wkb.WKTReader)1