Ascii output from script
Chrisw
Global Mapper User
I would like to create a batch file that emulates the File/Batch Convert/Reproject... main menu command. I have figured out how to use the IMPORT_ASCII script command to read my file with the appropriate projection, but I don't see how to output the file as an ASCII text file (I want to do this using a different projection, essentially doing a batch convert of a lat/long comma separated text file to a new projection).
Comments
-
To ouput a new file use the EXPORT_VECTOR command with the TYPE=SIMPLE_ASCII value.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
When I do what you say and use EXPORT_VECTOR TYPE=SIMPLE_ASCII, I get an output file that looks like:
DESCRIPTION=Unknown Point Feature
NAME=Date,Latitude,Longitude
POINT_SYMBOL=Dot
FONT_SIZE=12
FONT_COLOR=RGB(0,0,0)
FONT_CHARSET=0
File=Date,Latitude,Longitude
535809.88,904975.21
DESCRIPTION=Unknown Point Feature
POINT_SYMBOL=Dot
535819.02,904477.35
Where the last three lines repeat for each of the data points in my input file. What I want is an output file that looks like my input file, with the new lat/long and other fields from my input file separated by commas one per line, just like the File/Batch Covert command. Am I doing something wrong?
Here is the script file that I am using:
// Convert a State Plane Coordinate RDI ADCP file to WGS84
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
DEFINE_PROJ PROJ_NAME=RDISPCS
Projection STATE_PLANE
Datum NAD83
Zunits NO
Units FEET
Zone 2401
Xshift 0.000000
Yshift 0.000000
END_DEFINE_PROJ
DEFINE_PROJ PROJ_NAME=WGS84OUT
GEOGCS["Geographic Coordinate System",DATUM["WGS84",SPHEROID["WGS84",6378137,298.257223560493]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]
END_DEFINE_PROJ
IMPORT_ASCII FILENAME="C:\Documents and Settings\Chris\Desktop\Free Flow Power\Hydrology\Source\ScanRDIADCP\STL all ADCP State Plane.csv" \
TYPE=POINT_ONLY COORD_DELIM=COMMA COORD_ORDER=X_FIRST SKIP_COLUMNS=2 COORD_OFFSET=0,0,0 PROJ_NAME=RDISPCS
EXPORT_VECTOR TYPE=SIMPLE_ASCII FILENAME="C:\Documents and Settings\Chris\Desktop\Free Flow Power\Hydrology\Source\ScanRDIADCP\STL all ADCP State Plane - WGS84.csv" \
PROJ_NAME=WGS84OUT COORD_DELIM=COMMA EXPORT_ELEV=NO -
In that case I think you want to use TYPE=CSV instead to get a CSV file with all attributes on a single line for point export.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website