0

I'm trying to find out how to do the following:

We are using C# .NET with NetTopologySuite to manage spatial data on the backend. We do some distance calculations and this requires to use a cartesian system representation. So we use EPSG 3857 since that's what we also use on the frontend to display things on maps.

The issue is that SQL Server doesn't have installed that SRID and we are forced to reproject the spatial data to EPSG 4326 in order to save it. Of course we would like to avoid this since it forces us to reproject every time we need to do something with that data. But we can't find anywhere how we should proceed or if it is possible to save in any compatible EPSG that allows the same kind of values as a cartesian system.

So, the question is: is there any way to save cartesian coordinates in MSSQL using any of the projections supported for spatial data? They all seem to be lat/long and don't support X/Y meters value.

And to clarify further, I don't want an external structure to save this information, I want to save it as a Geometry type in the db with a specified SRID.

Thanks!

evrc
  • 1
  • 1
  • 1
    What is your actual question here? "Help?" Isn't an answerable question. What specifically do you need help with? – Thom A Sep 08 '21 at 18:04
  • Thanks for the suggestion, thought the question was implied. Just edited the post and clarified that! – evrc Sep 08 '21 at 19:06
  • 1
    Could you post your code? Also, details of "distance calculations" and why are you doing them in EPSG:3857 which is designed for visualization and is bad-suited for any geospatial measurements. – Michael Entin Sep 08 '21 at 22:34
  • Welcome to Stack Overflow! Please do **not** ever use EPSG:3857 (Web Mercator) to carry out any sort of distance related analysis. The longitude (X) axis is distorted to infinity as you move north or south of the Equator. – Ian Turton Sep 09 '21 at 12:04
  • @IanTurton thank you! We were told it was a suitable option since it works with cartesian coordinates, we were using EPSG:4326 at first but supposedly it was more prone to errors. Could you tell me what EPSG or system we should be using for those calculations? (@MichaelEntin thanks also, i can post some code in a few minutes) – evrc Sep 09 '21 at 15:06
  • a local projection that is good for your data area – Ian Turton Sep 09 '21 at 15:07

0 Answers0