Skip to content
Advertisement

Python Geo-Spatial Coordinate Format Conversion

I have a dataframe containing 6 columns of coordinate pairs:

JavaScript

(for both latitude and longitude). This is known as the NAD83 format.

I want to convert these into a new dataframe of only 2 columns in decimal format, known as NAD27.

The library I typically use, geopy supports virtually every format, so there actually isn’t a dedicated conversion function. I went through the documentation here to be sure: https://geopy.readthedocs.io/en/1.10.0/

Does python have any other means to convert to NAD27?

Advertisement

Answer

Let’s suppose your DataFrame df contains columns lonD, lonM, lonS, latD, latM and latS. Then the following should work, using geopandas, shapely and pyproj internally.

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement