Export lat/long from Mercator map
tonyk
Global Mapper User
Pretty noob to GM. I want to export vector (line) features on a Mercator map to simple ASCII file of lat/long coordinates. The help files said that the exported coordinate system is the same as the current map projection. Fine, so I change the projection to Geographic (Lat/Long), then export to Lat/Long works. Woohoo. But I need to do this a bunch of times and want to keep the map in Mercator and not constantly have to switch projections. So I tried a script instead to define the projection and then export the line vectors:
GLOBAL_MAPPER_SCRIPT VERSION=1.00
DEFINE_PROJ PROJ_NAME="GEO_WGS84"
Projection GEOGRAPHIC
Datum WGS84
Zunits NO
Units DD
Xshift 0.000000
Yshift 0.000000
Parameters
END_DEFINE_PROJ
EXPORT_VECTOR FILENAME="C:\Documents and Settings\User\Desktop\GlobalMapper\lat_long.txt" TYPE=SIMPLE_ASCII
But that put out x,y coordinates again, not lat/longs. I'm stumped now. Am I overlooking something about the concept of "Current Projection" here?
GLOBAL_MAPPER_SCRIPT VERSION=1.00
DEFINE_PROJ PROJ_NAME="GEO_WGS84"
Projection GEOGRAPHIC
Datum WGS84
Zunits NO
Units DD
Xshift 0.000000
Yshift 0.000000
Parameters
END_DEFINE_PROJ
EXPORT_VECTOR FILENAME="C:\Documents and Settings\User\Desktop\GlobalMapper\lat_long.txt" TYPE=SIMPLE_ASCII
But that put out x,y coordinates again, not lat/longs. I'm stumped now. Am I overlooking something about the concept of "Current Projection" here?
Comments
-
You are close. You just need to add the following line before the EXPORT_VECTOR command to actually set the projection to Geographic.
LOAD_PROJECTION PROJ_NAME="GEO_WGS84"
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Mike,
Thanks for the quick reply, that worked. And an additional note, perhaps now obvious, the context of the DEFINE and LOAD commands is the current workspace, so the script needs to set the projection back to Mercator (or whatever it was before) at the end.
Tony K
Categories
- 13K All Categories
- 5.8K Features Discussion
- 351 Downloading Imagery
- 1.3K Elevation Data
- 385 Georeferencing Imagery Discussion
- 652 GM Script Language
- 56 User Scripts
- 115 GPS Features
- 423 Projection Questions
- 837 Raster Data
- 1.4K Vector Data
- 6.7K Support
- 183 Announcement and News
- 944 Bug Report
- 565 SDK
- 1.2K Suggestion Box
- 3.8K Technical Support
- 583 Other Discussion
- 132 GIS Data Sources
- 27 Global Mapper Showcase
- 246 How I use Global Mapper
- 111 Global Mapper Forum Website
