CROP by 1% of original data
selebets
Global Mapper UserTrusted User
Sir,
How to do batch cropping for multi tiles of elevation grid in geotif files. I want to crop my data by 1% of the original data. Or can we specify by 5 or 10 pixel... i have more than 1000 tiles to work for. Thanks in advance
Happy new year!!!
How to do batch cropping for multi tiles of elevation grid in geotif files. I want to crop my data by 1% of the original data. Or can we specify by 5 or 10 pixel... i have more than 1000 tiles to work for. Thanks in advance
Happy new year!!!
Comments
-
I've used this script to crop whole folders of large High Resolution Orthoimagery files that overlapped substantially. You might be able to adjust it to accomplish your task by script. It just creates a bounding polygon, scales that, then crops to it, and exports. One drawback is that if the files are a mosaic, the perimeter is reduced by the scale amount too. I added a "c" to the export filename to distinguish the cropped files from the originals. I'm sure anyone with less primitive programming skills than I have could fix this up nicely for various tasks.
GLOBAL_MAPPER_SCRIPT VERSION="1.00" FILENAME="[IMAGE CROP].gms"
SET_BG_COLOR COLOR="RGB(0,0,0)"
DEFINE_VAR NAME="DIRECTORY" VALUE="" \
PROMPT="DIR" PROMPT_TEXT="CHOOSE DIRECTORY OF IMAGES TO CROP"
DEFINE_VAR NAME="MASK" VALUE="" \
PROMPT="YES" PROMPT_TEXT="FILENAME MASK (blank for all files)"
DEFINE_VAR NAME="SCALEX" VALUE="" \
PROMPT="YES" PROMPT_TEXT="ENTER X SCALE FACTOR"
DEFINE_VAR NAME="SCALEY" VALUE="" \
PROMPT="YES" PROMPT_TEXT="ENTER Y SCALE FACTOR"
DIR_LOOP_START DIRECTORY="%DIRECTORY%\" FILENAME_MASKS="%MASK%"
IMPORT FILENAME="%FNAME_W_DIR%"
GENERATE_LAYER_BOUNDS BOUNDS_TYPE=POLYGON
EDIT_VECTOR FILENAME="Layer Bounds" COORD_SCALE=%SCALEX%,%SCALEY%
EXPORT_RASTER FILENAME="%DIRECTORY%\%FNAME_WO_EXT%c.tif" TYPE="GEOTIFF" LABEL_FIELD_FORCE_OVERWRITE="NO" HIDDEN="NO" SAMPLING_METHOD="NEAREST_NEIGHBOR" \
AUTO_CONTRAST="NO" CONTRAST_SHARED="NO" CONTRAST_MODE="NONE" CLIP_COLLAR="NONE" INC_VECTOR_DATA="NO" POLYGON_CROP_FILE="LAYER BOUNDS"
UNLOAD_ALL
DIR_LOOP_END
Mark -
Thanks Mark.. I will try it. Need understand the flow first...
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