How to export vector files with polygons filled with certain color - using scripts?
OddBob
Global Mapper UserTrusted User
Hi,
First: Thank you for providing Global Mapper! A really brilliant application! I'm using GM 13.2.
I have a lot of MapInfo MIF/MID-files containing polygons. I need to save these off in the same format – but where the polygons should be filled with a certain color and the polygon line should not be displayed.
I guess the script should go like this – but I cannot figure out how to use the EDIT_VECTOR command for this:
Is there any support for this in the scripts?
First: Thank you for providing Global Mapper! A really brilliant application! I'm using GM 13.2.
I have a lot of MapInfo MIF/MID-files containing polygons. I need to save these off in the same format – but where the polygons should be filled with a certain color and the polygon line should not be displayed.
I guess the script should go like this – but I cannot figure out how to use the EDIT_VECTOR command for this:
IMPORT FILENAME="D:\Folder\input.mif" TYPE=MAPINFO
EDIT_VECTOR
EXPORT_VECTOR FILENAME="
\Folder\output.mif" TYPE=MAPINFO
I can perform this in the GM GUI as follows:EDIT_VECTOR
EXPORT_VECTOR FILENAME="

- Load file
- Overlay Control Center – Options – Area Styles – Use same style for all features
- Fill Pattern: Solid, RGB(255,130,0)
- Border style: NULL
- Apply
- Export Vector Format – MapInfo MIF/MID - OK
Is there any support for this in the scripts?
Comments
-
Yes you can do that via script. To see how load your file, setup the style as you want, then save a workspace. Look at that workspace in a text editor to see how to set the area style. Here is an example:
/************ DEFINE LAYER STYLE *************/
DEFINE_LAYER_STYLE NAME="AREA_STYLE" TYPE="AREA"
LayerStyle=1
Type=0
AreaStyleForAll=4286709825,0,81,2097152,0.0
FontForAll=~0~534799372~0.000~0~0
END_DEFINE_LAYER_STYLE
IMPORT FILENAME="D:\Folder\input.mif" TYPE=MAPINFO AREA_STYLE_NAME="AREA_STYLE"
You don't need the EDIT_VECTOR for this operation, the style is set with the IMPORT command.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Hi, this did not seem to help.
I've got the script as below. Could it be that I need to set that the layer features should be included during the export? Like you do in the GUI by setting MapInfo Option - Add Feature Type (LAYER) Attribute to Exported Files(s)?
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
/************ DEFINE LAYER STYLE *************/
DEFINE_LAYER_STYLE NAME="AREA_STYLE" TYPE="AREA"
LayerStyle=2
Type=0
InterpolateNumeric=0
AttrVal=*
AttrAreaStyle=4286709889,0,209,0,0.0
AttrFont=~0~534799372~0.000~0~0
END_DEFINE_LAYER_STYLE
IMPORT FILENAME="input.mif" TYPE=MAPINFO
EXPORT_VECTOR FILENAME="output.mif" TYPE=MAPINFO
UNLOAD_ALL
FORCE_EXIT -
You missed part of it, add AREA_STYLE_NAME="AREA_STYLE" to your IMPORT command in your script so the defined area style is added to the file on import.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Aha!
Yes, now it works!
Thank you so much for the help!
The tip regarding exploring the workspace file waas nice. Maybe you need to add more info in the script guide reagarding this.
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