0

I have one shapefile with XY coordinates in meters. Now, I want to develop one script in Python which converts meters to decimal degrees. Please help me to develop this.

Thanks

  • 1
    Are you looking for an ArcGIS solution or anything in Python? – underdark Aug 5 '11 at 14:47
3

Sounds like you are looking to project your shapefile. Look at Project (Data Management) they have examples of how to do it using Python.

  • This is probably the easiest route since you've indicated (tag) that you're using Arc10. The link @Sasa provided will cover all of the details and give you the basis for a simple script. – Radar Aug 8 '11 at 19:02
2

It would really help if you would write what do you want to do exactly. You can use GDAL to do this or call a web service if you would find one. For example you can try using this http://www.opencts.org/guidedwcts.php in your python code.

If you want to write it completely on your own, convert this java code to python. There is also some theory on what really happens there.

  • +1 to GDAL/OGR/OSR solution. You can even run ogr2ogr -t_srs EPSG:4326 unprojected.shp projected.shp from the command-line – Mike T Aug 9 '11 at 0:28
2

The easiest way to do it is using GDAL command line calls from Python.

So, using the line from above (ogr2ogr ...) along with a GDAL install (see Installing GDAL with Python on windows?) you can sort out a method which will do it for you.

The more comprehensive way is to find a shapefile importing tool and then using pyproj to do it natively in Python. I would try the former for a script, and the latter if you want something embedded in a portable application.

1

try using pyproj.

  • now what i will do. b'z i don't have any idea abt this package. – user876307 Aug 5 '11 at 13:19
  • It doesn't look like pyproj has any sort of Shapefile access, so it would need to be used with some other package in order to be useful. @user876307, you can look at the built-in documentation from Python: help(pyproj) – Mike T Aug 9 '11 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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