Polygon crop file

pencilpencil Global Mapper UserPosts: 1
edited October 2009 in Raster Data
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

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited October 2009
    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
  • irenegobranirenegobran Global Mapper User Posts: 14Trusted User
    I also have the same problem
    ,would you please tell me what's wrong ,in my code:
    GLOBAL_MAPPER_SCRIPT VERSION=1.00
    UNLOAD_ALL
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\619000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\618000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6864000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6863000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-Winter2017_Ortho\10_Delivery\HEX\l93\rehausser\617000_6862000.tif" TYPE=GEOTIFF PROJ_EPSG_CODE=2154
    IMPORT FILENAME="S:\16-0247_SIAAP-inter2017_Ortho\10_Delivery\HEX\UTM31N\hxip_m_n48e001t047_q1_31_10.shp" TYPE=shapefile PROJ_EPSG_CODE=25831
    LOAD_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 "
  • irenegobranirenegobran Global Mapper User Posts: 14Trusted User
    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.shp
    ERROR: No data could be loaded from POLYGON_CROP_FILE for export.


    although the file name is correct

Sign In or Register to comment.