Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
1  
Are you looking for an ArcGIS solution or anything in Python? –  underdark Aug 5 '11 at 14:47
add comment

4 Answers 4

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

share|improve this answer
    
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. –  Nick Ochoski Aug 8 '11 at 19:02
add comment

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.

share|improve this answer
    
+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
add comment

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 How to install 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.

share|improve this answer
add comment

try using pyproj.

share|improve this answer
    
ok thanks for the reply –  user876307 Aug 5 '11 at 12:57
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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