0

I am given an ArcGIS polyline (or polypoint) from a WFS service (e.g. 1693669.5143, 5672605.5392), and am looking for a function (python, java, whatever) to convert it to a lat/lon so I can use it in Google Maps. I obviously have the projection as well.

I've googled this extensively but most of the results return ArcGIS's solution http://pro.arcgis.com/en/pro-app/tool-reference/data-management/add-xy-coordinates.htm - i.e. tool-specific

Is there an online tool or converter to do this, or (ideally) a function or library that I can use directly from code?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
raven
  • 101
  • 1

1 Answers1

2

You can use the srsName= string to get the polyline from the WFS in lat/lon coordinates from the start.

Alternatively, provided that you've read the coordinate strings into Python as arrays x and y, you can do

import pyproj
prj = pyproj.Proj(PROJ4_STRING)
lon, lat = prj(x, y, inverse=True)

where PROJ4_STRING is the libproj SRS string for the original projection.

Nat Wilson
  • 241
  • 1
  • 5