Export and clip to an ECW file

Hello,
I tried to export to an compress file (ECW) and to clip this export file from a polygon. The goal is to avoid the Collar (convolution value around the compressed file). After ECW compression, you have around the images some value (0,1 or 2).
I would like to compress thge file and clip it with a polygon. I tried it but the software clip the raster on global coverage of the vector file (Upper-left, Lower right), not on the polygon (ech vertex of the polygon).

GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL

IMPORT FILENAME="F:\MS_Mosaic-East.tif"
EXPORT_RASTER FILENAME="F:\PNG\test-fp1.ecw" TYPE=ECW SPATIAL_RES_METERS="0.5,0.5" \
TARGET_COMPRESSION="3" POLYGON_CROP_FILE="F:\PNG\AOI_East.shp"

Something is missing in my script

Thanks for your help

Francois

Answers

  • bmg_bob
    bmg_bob Global Mapper Programmer
    Because rasters must be rectangular, it is necessary to enable a transparent background if you want the raster to be clipped exactly to the boundary of your polygon.  This can be done with the BG_TRANSPARENT=YES parameter in your export.

  • I tested it. With the option BG_TRANSPARENT=YES, I have still some bad values (254, 253, 252) close to the border of the area of interest.
  • bmg_bob
    bmg_bob Global Mapper Programmer
    What version of Global Mapper are you using?  If you are using v16 or v17, please update your installation to the latest released version.