Polygon crop file
pencil
Global Mapper User
Hi,
I have to crop a raster file (tif) with a polygon (shape format).
I have too much raster files, so I want to do a script for that, but I don´t know how "Polygon crop file" works.
How I have to do with that expression in the script?
I have this:
IMPORT FILENAME="D:\example\photos\tif\Union.TIF" \
TYPE=AUTO ANTI_ALIAS=NO AUTO_CONTRAST=NO CLIP_COLLAR=AUTO TEXTURE_MAP=NO
LOAD_PROJECTION FILENAME="D:\example\photos\UTM30.prj"
EXPORT_RASTER FILENAME="D:\example\photos\tif\union_crop.TIF"
TYPE=GEOTIFF PALETTE=OPTIMIZED
POLYGON_CROP_FILE="D:\TRABAJOS\Ortofotos\POL\berja_pol.shp"
Thanks in advance
I have to crop a raster file (tif) with a polygon (shape format).
I have too much raster files, so I want to do a script for that, but I don´t know how "Polygon crop file" works.
How I have to do with that expression in the script?
I have this:
IMPORT FILENAME="D:\example\photos\tif\Union.TIF" \
TYPE=AUTO ANTI_ALIAS=NO AUTO_CONTRAST=NO CLIP_COLLAR=AUTO TEXTURE_MAP=NO
LOAD_PROJECTION FILENAME="D:\example\photos\UTM30.prj"
EXPORT_RASTER FILENAME="D:\example\photos\tif\union_crop.TIF"
TYPE=GEOTIFF PALETTE=OPTIMIZED
POLYGON_CROP_FILE="D:\TRABAJOS\Ortofotos\POL\berja_pol.shp"
Thanks in advance
Comments
-
Your script looks correct (assuming your POLYGON_CROP_FILE filename is correct), except that you need a command continuation character (a '\') to properly continue your EXPORT_RASTER command to multiple lines. It should be like this:
IMPORT FILENAME="D:\example\photos\tif\Union.TIF" \
TYPE=AUTO ANTI_ALIAS=NO AUTO_CONTRAST=NO CLIP_COLLAR=AUTO TEXTURE_MAP=NO
LOAD_PROJECTION FILENAME="D:\example\photos\UTM30.prj"
EXPORT_RASTER FILENAME="D:\example\photos\tif\union_crop.TIF" \
TYPE=GEOTIFF PALETTE=OPTIMIZED \
POLYGON_CROP_FILE="D:\TRABAJOS\Ortofotos\POL\berja _pol.shp"
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
I also have the same problem
,would you please tell me what's wrong ,in my code:GLOBAL_MAPPER_SCRIPT VERSION=1.00UNLOAD_ALLIMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154IMPORT FILENAME="S:\16-0247_SIAAP-inter2017_Ortho\10_Delivery\HEX\UTM31N\hxip_m_n48e001t047_q1_31_10.shp" TYPE=shapefile PROJ_EPSG_CODE=25831LOAD_PROJECTION FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\11_Project\delivery\prj\utm31netrs.prj"EXPORT_RASTER FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\UTM31Nhxip_m_n48e001t047_q1_31_10.tif" TYPE=GEOTIFF\NUM_BANDS=MULTIBAND FORCE_SQUARE_PIXELS=YES SPATIAL_RES_METERS=0.1,0.1\POLYGON_CROP_FILE= "S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\UTM31N\hxip_m_n48e001t047_q1_31_10.shp"\GEN_PRJ_FILE=YES GEN_WORLD_FILE=YES " -
I have "Importing file S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\UTM31N\hxip_m_n48e002t006_q4_31_10.shp ...Loading new global projection...Exporting raster data to file S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\UTM31Nhxip_m_n48e002t006_q4_31_10.tif...WARNING: File not found: hxip_m_n48e002t006_q4_31_10.shpERROR: No data could be loaded from POLYGON_CROP_FILE for export.although the file name is correct
Howdy, Stranger!
Categories
- 12.4K All Categories
- 5.4K Features Discussion
- 314 Downloading Imagery
- 1.3K Elevation Data
- 377 Georeferencing Imagery Discussion
- 595 GM Script Language
- 46 User Scripts
- 112 GPS Features
- 392 Projection Questions
- 798 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 161 Announcement and News
- 887 Bug Report
- 556 SDK
- 1.1K Suggestion Box
- 3.7K Technical Support
- 534 Other Discussion
- 127 GIS Data Sources
- 26 Global Mapper Showcase
- 223 How I use Global Mapper
- 103 Global Mapper Forum Website