1

I know this is a very wide subject - still - I would like to convert a GIS DMS coordinates, for example:

33° 0' 10'' , 33° 40' 30''

into an EPSG:3857 format, ie:

3689865.02422557637, 3212878.5986975324

(this is not the calcualated convert, just an exmaple of the formats).

I know there are calculations\conversions in Map suppliers (ESRI, etc.). I'm looking for either of these ways, if somehow possible:

  1. nodejs module (proj4js ? I looked in it but couldn't find a way doing so).

  2. asp.net core FW feature\nuget ?

AKX
  • 152,115
  • 15
  • 115
  • 172
Guy E
  • 1,775
  • 2
  • 27
  • 55

1 Answers1

1

Yeah, proj4js can do this. First convert your DMS coordinates into decimal degrees, then tell proj4js to convert from WGS-84 to EPSG:3857.

Happily, proj4js ships with this conversion, so you don't have to look for the datum strings online.

const proj4= require("proj4");
// TODO: that's not the correct conversion of the original DMS to decimal degrees :)
console.log(proj4("WGS84", "EPSG:3857", [33.01, 33.4]));

outputs

[ 3674656.3910859604, 3948518.4270993923 ]
AKX
  • 152,115
  • 15
  • 115
  • 172