Fix lat/lon order in SVG export
authorMathieu Baudier <mbaudier@argeo.org>
Fri, 27 Oct 2023 04:43:59 +0000 (06:43 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Fri, 27 Oct 2023 04:43:59 +0000 (06:43 +0200)
org.argeo.app.geo/src/org/argeo/app/geo/GeoUtils.java

index 47096ccc0d1f5b7b2fddb2ce27cedf9d705235b6..f13467821de3984e37a61e48b0458f6c97858d54 100644 (file)
@@ -135,13 +135,14 @@ public class GeoUtils {
 
                                        Polygon projed = (Polygon) JTS.transform(p, transform);
 
+                                       // EPSG4326 are in lat/lon order, so we invert coordinates
                                        for (Coordinate coord : projed.getCoordinates()) {
-                                               double x = coord.x;
+                                               double x = coord.y;
                                                if (x < minX)
                                                        minX = x;
                                                if (x > maxX)
                                                        maxX = x;
-                                               double y = -coord.y;
+                                               double y = -coord.x;
                                                if (y < minY)
                                                        minY = y;
                                                if (y > maxY)