GENERATE_EQUAL_VAL_AREAS / export vector not working

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
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/
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
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...
Thanks mike yer the best..