2

I have my world lat, lon coordinates insert in an ms sql geometry column like this:

geometry::Point(56.120417, 10.159337, 0);

I have an ms sql store in geoserver and a layer that exposes these coordinates.

My problem is integration with an existing system.. I am told my coordinates are exposed as WGS84, but they need them exposed in UTM

This seems trivial, but after two days searching and experimenting I am still unable to find a solution to expose my ms sql geometry coordinates from geoserver as UTM.

4
  • 1
    GeoServer will automatically reproject your data if the client requests them in another projection as a WMS layer. For a WFS dataset your client will receive them as WGS84 and should capable of reprojecting to any required projection. So I'm not sure what your problem is
    – Ian Turton
    Oct 5, 2022 at 9:37
  • Thanks.. To be honest.. Neither am I.. It's the client who is asking for this?
    – noontz
    Oct 5, 2022 at 9:53
  • which client are you using? this should all be baked in
    – Ian Turton
    Oct 5, 2022 at 10:07
  • I have no idea.. With "client" I meant a corporate client. I am just exposing an endpoint from geoserver..
    – noontz
    Oct 5, 2022 at 10:10

1 Answer 1

4

If you query the data via WFS you need to specify the srsname parameter with the EPSG Code. Geoserver will automatically reproject.

For example to get your Layer in EPSG:25832 - UTM Zone 32N

https://DOMAIN/geoserver/WORKSPACE/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=WORKSPACE%3ALAYERNAME&maxFeatures=50&outputFormat=application%2Fjson&srsname=EPSG:25832
4
  • Thanks so much for the feedback. I have tried your suggestion : focuspect-wfs.azurewebsites.net/HedeDanmark/…, but the coordinates still show up as they where inserted in the db. Feel free to give it a go! Am I missing a setting in geoserver? The "client" expects coordinates like this: 572250.4302418156,6227374.090475168
    – noontz
    Oct 5, 2022 at 10:47
  • 1
    So it looks like either you defined the source CRS wrong because when I query focuspect-wfs.azurewebsites.net/HedeDanmark/… - it gives me coords that look like EPSG:4326 - (Lat/Lng) - but the WFS says they are in EPSG:25832. Or the geo column in your Database is already in EPSG:25832 but you inserted Lat/Lng. Oct 5, 2022 at 11:03
  • Hi.. Thanks SO MUCH for the input.. I'm on it and will return.. I'll be back ;)
    – noontz
    Oct 5, 2022 at 11:07
  • 1
    Hi Bernd.. Once again thx.. I will mark this as answer.. For some reason geoserver was locked to native EPSG:25832 and the declared was also EPSG:25832.. Changing the declared to EPSG:4326 as per your comment fixed everything.. Now I'm trying to figure out why native was locked to EPSG:25832, but that's another question ;).. Thx agaain!
    – noontz
    Oct 5, 2022 at 11:38

Your Answer

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

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