I am using locationtech JTS library in spring boot with jackson as json serializer and a Jts-data-type module with supports serializing JTS geometry.The issue which i am facing is the axis order of coordinates when json is returned is long lat instead of lat long there is a solution on stackoverflow https://stackoverflow.com/a/29634389/1574921 i want to know if there is any other way to achieve this functionality instead of always applying InvertCoordinateFilter whenever i create a functionality. Below is the code which i am using
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new JtsModule());
double lat = 32.3456789;
double lng = 72.423434;
GeometryFactory gf = new GeometryFactory();
Point point = gf.createPoint(new Coordinate(lng,lat ));
String json = mapper.writeValueAsString(point);
System.out.println(json);
and the output is
{"type":"Point","coordinates":[72.423434,32.3456789]}
and i want output to be
{"type":"Point","coordinates":[32.3456789,72.423434]}