org.geotools.geometry.jts.JTS.transform()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(18.4k)|赞(0)|评价(0)|浏览(581)

本文整理了Java中org.geotools.geometry.jts.JTS.transform()方法的一些代码示例,展示了JTS.transform()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTS.transform()方法的具体详情如下:
包路径:org.geotools.geometry.jts.JTS
类名称:JTS
方法名:transform

JTS.transform介绍

[英]Transforms the coordinate using the provided math transform.
[中]使用提供的数学变换变换变换坐标。

代码示例

代码示例来源:origin: opentripplanner/OpenTripPlanner

  1. double remainingMeters = remainingSeconds * request.walkSpeed;
  2. Geometry point = geomf.createPoint(vertexSeconds.getKey().getCoordinate());
  3. point = JTS.transform(point, toMeters);
  4. Geometry buffer = point.buffer(remainingMeters);
  5. bufferLists.put(thresholdSeconds, buffer);
  6. if ( ! resultsProjected) geom = JTS.transform(geom, fromMeters);
  7. contours.put(threshold, geom);

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Transforms the envelope using the specified math transform. Note that this method can not
  3. * handle the case where the envelope contains the North or South pole, or when it cross the
  4. * ±180� longitude, because {@linkplain MathTransform math transforms} do not carry
  5. * suffisient informations. For a more robust envelope transformation, use {@link
  6. * ReferencedEnvelope#transform(CoordinateReferenceSystem, boolean)} instead.
  7. *
  8. * @param envelope The envelope to transform.
  9. * @param transform The transform to use.
  10. * @return The transformed Envelope
  11. * @throws TransformException if at least one coordinate can't be transformed.
  12. */
  13. public static Envelope transform(final Envelope envelope, final MathTransform transform)
  14. throws TransformException {
  15. return transform(envelope, null, transform, 5);
  16. }

代码示例来源:origin: geotools/geotools

  1. public static Envelope reprojectEnvelopeByEpsg(int srcEpsg, int destEpsg, Envelope srcEnvelope)
  2. throws FactoryException, TransformException {
  3. CoordinateReferenceSystem sourceCRS = CRS.decode("EPSG:" + srcEpsg); // $NON-NLS-1$
  4. CoordinateReferenceSystem targetCRS = CRS.decode("EPSG:" + destEpsg); // $NON-NLS-1$
  5. MathTransform tr = CRS.findMathTransform(sourceCRS, targetCRS);
  6. // From that point, I'm not sure which kind of object is returned by
  7. // getLatLonBoundingBox(). But there is some convenience methods if CRS
  8. // like:
  9. return JTS.transform(srcEnvelope, tr);
  10. }

代码示例来源:origin: geotools/geotools

  1. static Geometry reprojectAndDensify(
  2. Geometry first,
  3. CoordinateReferenceSystem sourceCRS,
  4. CoordinateReferenceSystem targetCRS)
  5. throws FactoryException, TransformException {
  6. if (targetCRS == null) {
  7. targetCRS = CRS.parseWKT(ECKERT_IV_WKT);
  8. }
  9. MathTransform firstTransform = CRS.findMathTransform(sourceCRS, targetCRS);
  10. Geometry geometry = JTS.transform(densify(first, sourceCRS, 0.01d), firstTransform);
  11. return geometry;
  12. }

代码示例来源:origin: geotools/geotools

  1. /** Helper method to reproject a geometry. */
  2. protected Geometry reproject(Object value, CoordinateReferenceSystem propertyCrs) {
  3. if (value == null) {
  4. return null;
  5. }
  6. if (!(value instanceof Geometry))
  7. throw new IllegalArgumentException(
  8. "Binary geometry filter, but second expression "
  9. + "is not a geometry literal? (it's a "
  10. + value.getClass()
  11. + ")");
  12. Geometry geom = (Geometry) value;
  13. // does it make sense to proceed?
  14. if (geom.getUserData() == null
  15. || !(geom.getUserData() instanceof CoordinateReferenceSystem)) return geom;
  16. try {
  17. // reproject
  18. CoordinateReferenceSystem geomCRS = (CoordinateReferenceSystem) geom.getUserData();
  19. Geometry transformed =
  20. JTS.transform(geom, CRS.findMathTransform(geomCRS, propertyCrs, true));
  21. transformed.setUserData(propertyCrs);
  22. return transformed;
  23. } catch (Exception e) {
  24. throw new RuntimeException("Could not reproject geometry " + value, e);
  25. }
  26. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Compute the footprint.
  3. *
  4. * @param geometriesList the List of all the geometries found across the dataset
  5. * @param transform
  6. * @throws MismatchedDimensionException
  7. * @throws TransformException
  8. * @throws FactoryException
  9. */
  10. private void computeFootprint(List<Polygon> geometriesList, MathTransform transform)
  11. throws MismatchedDimensionException, TransformException, FactoryException {
  12. // Creating the final multipolygon
  13. Polygon[] polArray = new Polygon[geometriesList.size()];
  14. Polygon[] polygons = geometriesList.toArray(polArray);
  15. final Geometry innerGeometry = new MultiPolygon(polygons, GF);
  16. if (footprintCoordinates == FootprintCoordinates.MODEL_SPACE) {
  17. this.footprint = JTS.transform(innerGeometry, transform);
  18. } else {
  19. this.footprint = innerGeometry;
  20. innerGeometry.setSRID(NO_SRID);
  21. }
  22. // Compute the ROIShape
  23. if (!innerGeometry.isEmpty()) {
  24. LiteShape2 shape = new LiteShape2(innerGeometry, TRANSLATED_TX, null, false);
  25. roiShape = (ROIShape) new ROIShape(shape);
  26. }
  27. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Applies transform to all geometry attribute.
  3. *
  4. * @param feature Feature to be transformed
  5. * @param schema Schema for target transformation - transform( schema, crs )
  6. * @param transform MathTransform used to transform coordinates - reproject( crs, crs )
  7. * @return transformed Feature of type schema
  8. * @throws TransformException
  9. * @throws MismatchedDimensionException
  10. * @throws IllegalAttributeException
  11. */
  12. public static SimpleFeature transform(
  13. SimpleFeature feature, SimpleFeatureType schema, MathTransform transform)
  14. throws MismatchedDimensionException, TransformException, IllegalAttributeException {
  15. feature = SimpleFeatureBuilder.copy(feature);
  16. GeometryDescriptor geomType = schema.getGeometryDescriptor();
  17. Geometry geom = (Geometry) feature.getAttribute(geomType.getLocalName());
  18. geom = JTS.transform(geom, transform);
  19. feature.setAttribute(geomType.getLocalName(), geom);
  20. return feature;
  21. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Added this test after a bug was reported in JTS.transform for converting between WGS84 (2D)
  3. * and DefaultGeocentric.CARTESIAN (3D).
  4. */
  5. @Test
  6. public void transformCoordinate2DCRSTo3D() throws Exception {
  7. CoordinateReferenceSystem srcCRS = DefaultGeographicCRS.WGS84;
  8. CoordinateReferenceSystem targetCRS = DefaultGeocentricCRS.CARTESIAN;
  9. MathTransform transform = CRS.findMathTransform(srcCRS, targetCRS);
  10. Coordinate srcCoord = new Coordinate(0, 0);
  11. Coordinate dest0 = JTS.transform(srcCoord, null, transform);
  12. srcCoord.x = 180;
  13. Coordinate dest180 = JTS.transform(srcCoord, null, transform);
  14. // Only a perfunctory check on the return values - mostly we
  15. // just wanted to make sure there was no exception
  16. assertEquals(dest0.x, -dest180.x, TOL);
  17. assertEquals(dest0.y, dest180.y, TOL);
  18. assertEquals(dest0.z, dest180.z, TOL);
  19. }

代码示例来源:origin: geotools/geotools

  1. /** Will reproject a geometry to another CRS. */
  2. @DescribeProcess(
  3. title = "Reproject Geometry",
  4. description = "Reprojects a given geometry into a supplied coordinate reference system."
  5. )
  6. @DescribeResult(name = "result", description = "Reprojected geometry")
  7. public static Geometry reproject(
  8. @DescribeParameter(name = "geometry", description = "Input geometry") Geometry geometry,
  9. @DescribeParameter(
  10. name = "sourceCRS",
  11. min = 0,
  12. description = "Coordinate reference system of input geometry"
  13. )
  14. CoordinateReferenceSystem sourceCRS,
  15. @DescribeParameter(
  16. name = "targetCRS",
  17. min = 0,
  18. description = "Target coordinate reference system to use for reprojection"
  19. )
  20. CoordinateReferenceSystem targetCRS) {
  21. try {
  22. return JTS.transform(geometry, CRS.findMathTransform(sourceCRS, targetCRS, true));
  23. } catch (Exception e) {
  24. throw new ProcessException("Reprojection faiiled", e);
  25. }
  26. }
  27. }

代码示例来源:origin: geotools/geotools

  1. /**
  2. * Reprojects a {@link JGrassRegion region}.
  3. *
  4. * @param sourceCRS the original {@link CoordinateReferenceSystem crs} of the region.
  5. * @param targetCRS the target {@link CoordinateReferenceSystem crs} of the region.
  6. * @param lenient defines whether to apply a lenient transformation or not.
  7. * @return a new {@link JGrassRegion region}.
  8. * @throws Exception exception that may be thrown when applying the transformation.
  9. */
  10. public JGrassRegion reproject(
  11. CoordinateReferenceSystem sourceCRS,
  12. CoordinateReferenceSystem targetCRS,
  13. boolean lenient)
  14. throws Exception {
  15. MathTransform transform = CRS.findMathTransform(sourceCRS, targetCRS, lenient);
  16. Envelope envelope = getEnvelope();
  17. Envelope targetEnvelope = JTS.transform(envelope, transform);
  18. return new JGrassRegion(
  19. targetEnvelope.getMinX(),
  20. targetEnvelope.getMaxX(),
  21. targetEnvelope.getMinY(),
  22. targetEnvelope.getMaxY(),
  23. getRows(),
  24. getCols());
  25. }

代码示例来源:origin: geotools/geotools

  1. /** Tests the transformation of a single coordinate. */
  2. @Test
  3. public void testTransformCoordinate() throws FactoryException, TransformException {
  4. Coordinate coord = new Coordinate(10, 10);
  5. AffineTransform at = AffineTransform.getScaleInstance(0.5, 1);
  6. MathTransform2D t =
  7. (MathTransform2D)
  8. ReferencingFactoryFinder.getMathTransformFactory(null)
  9. .createAffineTransform(new GeneralMatrix(at));
  10. coord = JTS.transform(coord, coord, t);
  11. assertEquals(new Coordinate(5, 10), coord);
  12. coord = JTS.transform(coord, coord, t.inverse());
  13. assertEquals(new Coordinate(10, 10), coord);
  14. CoordinateReferenceSystem crs =
  15. ReferencingFactoryFinder.getCRSFactory(null).createFromWKT(UTM_ZONE_10N);
  16. t =
  17. (MathTransform2D)
  18. ReferencingFactoryFinder.getCoordinateOperationFactory(null)
  19. .createOperation(DefaultGeographicCRS.WGS84, crs)
  20. .getMathTransform();
  21. coord = new Coordinate(-123, 55);
  22. coord = JTS.transform(coord, coord, t);
  23. coord = JTS.transform(coord, coord, t.inverse());
  24. assertEquals(-123, coord.x, EPS);
  25. assertEquals(55, coord.y, EPS);
  26. }

代码示例来源:origin: geotools/geotools

  1. @Test
  2. public void testUTMDatelineWrapping() throws Exception {
  3. CoordinateReferenceSystem crs = CRS.decode("EPSG:32601", true);
  4. ReferencedEnvelope re = new ReferencedEnvelope(300000, 409800, 5890200, 6000000, crs);
  5. MathTransform mt = CRS.findMathTransform(crs, WGS84);
  6. Geometry geom = JTS.toGeometry(re);
  7. ReferencedEnvelope targetReferenceEnvelope =
  8. new ReferencedEnvelope(-180, 180, -90, 90, WGS84);
  9. ProjectionHandler ph =
  10. ProjectionHandlerFinder.getHandler(targetReferenceEnvelope, crs, true);
  11. Geometry preProcessed = ph.preProcess(geom);
  12. Geometry transformed = JTS.transform(preProcessed, mt);
  13. Geometry postProcessed = ph.postProcess(mt.inverse(), transformed);
  14. // sits across the dateline and it's "small" (used to cover the entire planet)
  15. Envelope ppEnvelope = postProcessed.getGeometryN(0).getEnvelopeInternal();
  16. assertTrue(ppEnvelope.contains(180, 54));
  17. // the original width is 109km, at this latitude one degree of longitude is only 65km
  18. assertEquals(1.7, ppEnvelope.getWidth(), 0.1);
  19. }

代码示例来源:origin: geotools/geotools

  1. @Test
  2. public void testWrapGeometrySmall() throws Exception {
  3. // projected dateline CRS
  4. CoordinateReferenceSystem FIJI = CRS.decode("EPSG:3460", true);
  5. // a small geometry that will cross the dateline
  6. Geometry g =
  7. new WKTReader()
  8. .read(
  9. "POLYGON ((2139122 5880020, 2139122 5880030, 2139922 5880030, 2139122 5880020))");
  10. Geometry original = g.copy();
  11. // rendering bounds only slightly bigger than geometry
  12. ReferencedEnvelope world = new ReferencedEnvelope(178, 181, -1, 1, WGS84);
  13. // make sure the geometry is not wrapped, but it is preserved
  14. ProjectionHandler handler = ProjectionHandlerFinder.getHandler(world, FIJI, true);
  15. assertTrue(handler.requiresProcessing(g));
  16. Geometry preProcessed = handler.preProcess(g);
  17. // no cutting expected
  18. assertEquals(original, preProcessed);
  19. // post process
  20. MathTransform mt = CRS.findMathTransform(FIJI, WGS84);
  21. Geometry transformed = JTS.transform(g, mt);
  22. Geometry postProcessed = handler.postProcess(mt.inverse(), transformed);
  23. // check the geometry is in the same area as the rendering envelope
  24. assertTrue(world.contains(postProcessed.getEnvelopeInternal()));
  25. }

代码示例来源:origin: geotools/geotools

  1. @Test
  2. public void testWrapGeometryLatLonMultipleTimes() throws Exception {
  3. ReferencedEnvelope renderingEnvelope =
  4. new ReferencedEnvelope(-90, 90, -580, 540, ED50_LATLON);
  5. // a geometry close to the dateline
  6. Geometry g = new WKTReader().read("POLYGON((-74 -33, -29 -33, -29 5, -74 5, -74 -33))");
  7. // make sure the geometry is not wrapped, but it is preserved
  8. ProjectionHandler handler =
  9. ProjectionHandlerFinder.getHandler(renderingEnvelope, WGS84, true);
  10. assertTrue(handler.requiresProcessing(g));
  11. Geometry preProcessed = handler.preProcess(g);
  12. MathTransform mt = handler.getRenderingTransform(CRS.findMathTransform(WGS84, ED50_LATLON));
  13. Geometry transformed = JTS.transform(preProcessed, mt);
  14. // post process (provide identity transform to force wrap heuristic)
  15. Geometry postProcessed = handler.postProcess(mt, transformed);
  16. assertTrue(postProcessed.isValid());
  17. // should have been replicated three times
  18. assertEquals(3, postProcessed.getNumGeometries());
  19. }

代码示例来源:origin: geotools/geotools

  1. @Test
  2. public void testWrapGeometryReprojectToED50() throws Exception {
  3. ReferencedEnvelope world = new ReferencedEnvelope(-80, 80, -180, 180, ED50);
  4. ProjectionHandler handler = ProjectionHandlerFinder.getHandler(world, WGS84, true);
  5. // a geometry that will cross the dateline and sitting in the same area as the
  6. // rendering envelope (with wgs84 lon/latcoordinates)
  7. String wkt = "POLYGON((178 -80, 178 80, 182 80, 182 80, 178 -80))";
  8. Geometry g = new WKTReader().read(wkt);
  9. Geometry original = new WKTReader().read(wkt);
  10. MathTransform mt = CRS.findMathTransform(WGS84, ED50);
  11. mt = handler.getRenderingTransform(mt);
  12. Geometry reprojected = JTS.transform(original, mt);
  13. // make sure the geometry is not wrapped, but it is preserved
  14. assertTrue(handler.requiresProcessing(g));
  15. Geometry preProcessed = handler.preProcess(g);
  16. // no cutting expected
  17. assertEquals(original, preProcessed);
  18. // post process, this should wrap the geometry and clone it
  19. Geometry postProcessed = handler.postProcess(mt, reprojected);
  20. assertTrue(postProcessed instanceof MultiPolygon);
  21. }

代码示例来源:origin: geotools/geotools

  1. /** Checks that the measures of XYZM geometries are not transformed. */
  2. @Test
  3. public void testXyzmGeometriesMeasuresArePreserved() throws Exception {
  4. // build a XYM geometry and reproject it
  5. Geometry geometry = new WKTReader().read("LINESTRINGZM(170 -40 10 2, 190 40 15 7)");
  6. MathTransform transform = CRS.findMathTransform(WGS84, MERCATOR, true);
  7. Geometry transformed = JTS.transform(geometry, transform);
  8. // check that coordinates where transformed but measures preserved
  9. assertThat(transformed, instanceOf(LineString.class));
  10. LineString line = (LineString) transformed;
  11. assertThat(line.getCoordinateSequence().getDimension(), is(4));
  12. assertThat(line.getCoordinateSequence().getMeasures(), is(1));
  13. // check the first coordinate
  14. assertThat(line.getCoordinateSequence().getX(0), closeTo(1.8924313434856504E7, EPS));
  15. assertThat(line.getCoordinateSequence().getY(0), closeTo(-4838471.398061137, EPS));
  16. assertThat(line.getCoordinateSequence().getZ(0), is(10.0));
  17. assertThat(line.getCoordinateSequence().getM(0), is(2.0));
  18. // check the second coordinate
  19. assertThat(line.getCoordinateSequence().getX(1), closeTo(2.115070325072198E7, EPS));
  20. assertThat(line.getCoordinateSequence().getY(1), closeTo(4838471.398061137, EPS));
  21. assertThat(line.getCoordinateSequence().getZ(1), is(15.0));
  22. assertThat(line.getCoordinateSequence().getM(1), is(7.0));
  23. }

代码示例来源:origin: geotools/geotools

  1. /** Checks that the measures of XYM geometries are not transformed. */
  2. @Test
  3. public void testXymGeometriesMeasuresArePreserved() throws Exception {
  4. // build a XYM geometry and reproject it
  5. Geometry geometry = new WKTReader().read("LINESTRINGM(170 -40 2, 190 40 7)");
  6. MathTransform transform = CRS.findMathTransform(WGS84, MERCATOR, true);
  7. Geometry transformed = JTS.transform(geometry, transform);
  8. // check that coordinates where transformed but measures preserved
  9. assertThat(transformed, instanceOf(LineString.class));
  10. LineString line = (LineString) transformed;
  11. assertThat(line.getCoordinateSequence().getDimension(), is(3));
  12. assertThat(line.getCoordinateSequence().getMeasures(), is(1));
  13. // check the first coordinate
  14. assertThat(line.getCoordinateSequence().getX(0), closeTo(1.8924313434856504E7, EPS));
  15. assertThat(line.getCoordinateSequence().getY(0), closeTo(-4838471.398061137, EPS));
  16. assertThat(line.getCoordinateSequence().getZ(0), is(Double.NaN));
  17. assertThat(line.getCoordinateSequence().getM(0), is(2.0));
  18. // check the second coordinate
  19. assertThat(line.getCoordinateSequence().getX(1), closeTo(2.115070325072198E7, EPS));
  20. assertThat(line.getCoordinateSequence().getY(1), closeTo(4838471.398061137, EPS));
  21. assertThat(line.getCoordinateSequence().getZ(1), is(Double.NaN));
  22. assertThat(line.getCoordinateSequence().getM(1), is(7.0));
  23. }

代码示例来源:origin: geotools/geotools

  1. @Test
  2. public void testWrapGeometryReprojectToLatLonED50() throws Exception {
  3. ReferencedEnvelope world = new ReferencedEnvelope(-80, 80, -180, 180, ED50_LATLON);
  4. // make sure the geometry is not wrapped, but it is preserved
  5. ProjectionHandler handler = ProjectionHandlerFinder.getHandler(world, WGS84, true);
  6. // a geometry that will cross the dateline and sitting in the same area as the
  7. // rendering envelope (with wgs84 lon/latcoordinates)
  8. String wkt = "POLYGON((178 -80, 178 80, 182 80, 182 80, 178 -80))";
  9. Geometry g = new WKTReader().read(wkt);
  10. Geometry original = new WKTReader().read(wkt);
  11. MathTransform mt = CRS.findMathTransform(WGS84, ED50_LATLON);
  12. MathTransform prepared =
  13. handler.getRenderingTransform(CRS.findMathTransform(WGS84, ED50_LATLON));
  14. Geometry reprojected = JTS.transform(original, prepared);
  15. assertTrue(handler.requiresProcessing(g));
  16. Geometry preProcessed = handler.preProcess(g);
  17. // no cutting expected
  18. assertEquals(original, preProcessed);
  19. // post process, this should wrap the geometry and clone it
  20. Geometry postProcessed = handler.postProcess(prepared, reprojected);
  21. assertTrue(postProcessed instanceof MultiPolygon);
  22. }

代码示例来源:origin: geotools/geotools

  1. @Test
  2. public void testWrapGeometryMercator() throws Exception {
  3. ReferencedEnvelope world = new ReferencedEnvelope(160, 180, -40, 40, WGS84);
  4. ReferencedEnvelope mercatorEnvelope = world.transform(MERCATOR, true);
  5. // move it so that it crosses the dateline (measures are still accurate for something
  6. // crossing the dateline
  7. mercatorEnvelope.translate(mercatorEnvelope.getWidth() / 2, 0);
  8. // a geometry that will cross the dateline and sitting in the same area as the
  9. // rendering envelope
  10. Geometry g = new WKTReader().read("LINESTRING(170 -40, 190 40)");
  11. // make sure the geometry is not wrapped
  12. ProjectionHandler handler =
  13. ProjectionHandlerFinder.getHandler(mercatorEnvelope, WGS84, true);
  14. assertTrue(handler.requiresProcessing(g));
  15. Geometry preProcessed = handler.preProcess(g);
  16. // no cutting expected
  17. assertEquals(g, preProcessed);
  18. // transform and post process
  19. MathTransform mt = CRS.findMathTransform(WGS84, MERCATOR, true);
  20. Geometry transformed = JTS.transform(g, mt);
  21. Geometry postProcessed = handler.postProcess(mt.inverse(), transformed);
  22. Envelope env = postProcessed.getEnvelopeInternal();
  23. // check the geometry is in the same area as the rendering envelope
  24. assertEquals(mercatorEnvelope.getMinX(), env.getMinX(), EPS);
  25. assertEquals(mercatorEnvelope.getMaxX(), env.getMaxX(), EPS);
  26. }

代码示例来源:origin: geotools/geotools

  1. @Test
  2. public void testDuplicateGeometryMercator() throws Exception {
  3. ReferencedEnvelope world = new ReferencedEnvelope(-180, 180, -50, 50, WGS84);
  4. ReferencedEnvelope mercatorEnvelope = world.transform(MERCATOR, true);
  5. // a geometry that will cross the dateline and sitting in the same area as the
  6. // rendering envelope
  7. Geometry g = new WKTReader().read("LINESTRING(170 -50, 190 50)");
  8. // make sure the geometry is not wrapped
  9. ProjectionHandler handler =
  10. ProjectionHandlerFinder.getHandler(mercatorEnvelope, WGS84, true);
  11. assertTrue(handler.requiresProcessing(g));
  12. Geometry preProcessed = handler.preProcess(g);
  13. // no cutting expected
  14. assertEquals(g, preProcessed);
  15. // transform and post process
  16. MathTransform mt = CRS.findMathTransform(WGS84, MERCATOR, true);
  17. Geometry transformed = JTS.transform(g, mt);
  18. Geometry postProcessed = handler.postProcess(mt, transformed);
  19. // should have been duplicated in two parts
  20. assertTrue(postProcessed instanceof MultiLineString);
  21. MultiLineString mls = (MultiLineString) postProcessed;
  22. assertEquals(2, mls.getNumGeometries());
  23. // the two geometries width should be the same as 20°
  24. double twentyDegWidth = mercatorEnvelope.getWidth() / 18;
  25. assertEquals(twentyDegWidth, mls.getGeometryN(0).getEnvelopeInternal().getWidth(), EPS);
  26. assertEquals(twentyDegWidth, mls.getGeometryN(1).getEnvelopeInternal().getWidth(), EPS);
  27. }

相关文章