GENERATE_EQUAL_VAL_AREAS / export vector not working
robin
Global Mapper UserTrusted User
Hi,
I wish to run through many TIF tiles and generate valid regions. Testing in the GUI I find 254 (all colours) will split a tif into white and black based on valid/ invalid pixels (Assuming white background=NULL).
But, when I script it I cannot figure why it is not exporting.
I tested the image load with image export function, so that works.
I try changing GENERATE_EQUAL_VAL_AREAS to GENERATE_LAYER_BOUNDS as it is much simpler, but the export does not work.. any hints?
Kind Regards,
Robin
...
DIR_LOOP_START DIRECTORY="".\" FILENAME_MASKS="*.tif" RECURSE_DIR=NO
IMPORT FILENAME="%FNAME_W_DIR%" TYPE="AUTO" AUTO_CONTRAST="NO"
// have no idea if this line works, but does not export! GENERATE_EQUAL_VAL_AREAS FILENAME="%FNAME_W_DIR%" ATTR_NAME="COLOR" COLOR_DIST=254
GENERATE_LAYER_BOUNDS LAYER_DESC="hello"
EXPORT_VECTOR FILENAME="%DIR%%FNAME_WO_EXT%xxx.shp" TYPE="SHAPEFILE"
// this line tested and works, so we conclude the image loads!!! EXPORT_RASTER FILENAME="%DIR%%FNAME_WO_EXT%xxx.tif" TYPE="GEOTIFF"
UNLOAD_ALL
DIR_LOOP_END
I wish to run through many TIF tiles and generate valid regions. Testing in the GUI I find 254 (all colours) will split a tif into white and black based on valid/ invalid pixels (Assuming white background=NULL).
But, when I script it I cannot figure why it is not exporting.
I tested the image load with image export function, so that works.
I try changing GENERATE_EQUAL_VAL_AREAS to GENERATE_LAYER_BOUNDS as it is much simpler, but the export does not work.. any hints?
Kind Regards,
Robin
...
DIR_LOOP_START DIRECTORY="".\" FILENAME_MASKS="*.tif" RECURSE_DIR=NO
IMPORT FILENAME="%FNAME_W_DIR%" TYPE="AUTO" AUTO_CONTRAST="NO"
// have no idea if this line works, but does not export! GENERATE_EQUAL_VAL_AREAS FILENAME="%FNAME_W_DIR%" ATTR_NAME="COLOR" COLOR_DIST=254
GENERATE_LAYER_BOUNDS LAYER_DESC="hello"
EXPORT_VECTOR FILENAME="%DIR%%FNAME_WO_EXT%xxx.shp" TYPE="SHAPEFILE"
// this line tested and works, so we conclude the image loads!!! EXPORT_RASTER FILENAME="%DIR%%FNAME_WO_EXT%xxx.tif" TYPE="GEOTIFF"
UNLOAD_ALL
DIR_LOOP_END
Comments
-
Robin,
You need to add SHAPE_TYPE=AREAS to the EXPORT_VECTOR command for a Shapefile export as there are 3 separate Shapefile export types.
In the future, try running your script with File->Run Script and you should see a log of any errors encountered when running the script.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/ -
Thanks so much Mike,
I also found just changing the GMS to GMW permits to view the script at intermediate stages..
Anyway, the equal-area function is not behaving like I would expect. In the GUI, I set distance to 254 but when I set COLOR_DIST in the script is says only 0-128 are permissible?
Any hints?
Robin
This is from the script window... WARNING: The COLOR_DIST value must be between 0 and 128, it will be ignored.
Setup Equal-Value Area Creation.jpg
-
Robin,
That was a bug in the script, it should have allowed 0-256. I've fixed that now. I have placed a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper14.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v14.xx installation folder to give it a try. If you are using the 64-bit v14 version there is a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper14_64bit.zip .
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.bluemarblegeo.com/ -
clap
clap
clap...
Thanks mike yer the best..
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website