场景:需要将data.tif文件重新投影输出为data_srs.tif
脚本示范:
CHANGE_PRJ.gms
GLOBAL_MAPPER_SCRIPT VERSION=1.00 UNLOAD_ALL DEFINE_VAR NAME="OUTPUT_FILE" VALUE="data_srs.tif" IMPORT FILENAME="data.tif" LOAD_PROJECTION FILENAME="4326.prj" EXPORT_RASTER FILENAME="%OUTPUT_FILE%" TYPE=GEOTIFF UNLOAD_ALL
CHANGE_PRJ.bat
@echo off chcp 936 "C:\Program Files\GlobalMapper20_64bit\global_mapper.exe" CHANGE_PRJ.gms /showprogress "C:\Program Files\GlobalMapper20_64bit\global_mapper.exe" CHANGE_PRJ.gms /showprogress pause
案例2:使用Global Mapper和Bat脚本对shp格式的矢量数据进行投影转换
场景:需要将data.shp文件重新投影输出为data_srs.shp
脚本示范:
CHANGE_PRJ.gms
GLOBAL_MAPPER_SCRIPT VERSION=1.00 UNLOAD_ALL IMPORT FILENAME="data.shp" LOAD_FLAGS="0" LOAD_PROJECTION PROJ="EPSG:3857" EXPORT_VECTOR GEN_PRJ_FILE=YES FILENAME="data_srs.shp" TYPE=SHAPEFILE SHAPE_TYPE=AREAS UNLOAD_ALL
CHANGE_PRJ.bat
@echo off chcp 936 "C:\Program Files\GlobalMapper20_64bit\global_mapper.exe" CHANGE_PRJ.gms /showprogress "C:\Program Files\GlobalMapper20_64bit\global_mapper.exe" CHANGE_PRJ.gms /showprogress pause