0

I want to draw a polygon on the world map in different map projections, for example, in mercator proj or stereographic one. They must correspond to ICAO ares G (https://aviationweather.gov/satellite?gis=off). But I got a trouble with geo coordinates. I see that my geo coordinates are differ than they should be. For example, in EPSG:3395 or EPSG:5588 my geocoords coincides in one point on the map, but in EPSG:4326 they are out of bounds of the world map. How can I draw geometry accordingly to geo coordinates? I am using GEOTOOLS. Look at the point (-155.27,67.3623) - it is on the north west of North America, but after reprojection this point appears somewhere in the Pacific Ocean

1 Answer 1

1

The issue is that when you call addLayer and addPoint you pass in the projected coordinate system not the geographic coordinate system, but your points are stored in lon/lat which is geographic so they are in the wrong place. Changing those calls to use geoCRS gives you the following (which is quite close to area G:

enter image description here

though I think it's probably more accurate to use a densified box (polygon = (Polygon) Densifier.densify(polygon, 0.001);) which looks like this, obviously you'll need some more points (or to define the box in your oblique stereo coordinate system) to get an accurate box:

enter image description here

Also to help debug I added the labels to the points style:

Style style = SLD.createSimpleStyle(TYPE, Color.GREEN);
TextSymbolizer textSymb = styleBuilder.createTextSymbolizer(Color.black, styleBuilder.createFont("Arial", 10),
    "fred");
textSymb.setLabel(ff.function("Concatenate", ff.function("getX", ff.property("location")), ff.literal(" "),
    ff.function("getY", ff.property("location"))));
//textSymb.setHalo(styleBuilder.createHalo(Color.white, 1));
style.featureTypeStyles().get(0).rules().get(0).symbolizers().add(textSymb);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.