Change View Layer Order for Vectors
AndreaR
Global Mapper UserTrusted User
Hi Mike,
I have this vector layer structure generated by a script that use LAYER_GROUP command:
LINES -> Splitted on other layers
POINTS -> Splitted on other Layers
and
AREAS -> Splitted on this sub-layers:
BUILDING -> Splitted on other sub-layer
SERVICES -> Splitted on other sub-layer
NATURAL -> Splitted on other sub-layer
In sub-layer BUILDING i've all buildings splitted in sub-layer, with style solid fill for all, but in various color.
In sub-layer NATURAL i've all type of park areas splitted in sub-layer with style solid fill for all, but in various color.
The problem is that some of the NATURAL sub-layer areas overlay all building that are in BUILDING sub-layer and i can't see them.
Also if i invert the order of layers on:
NATURAL
SERVICES
BUILDING
Never change in the map view, the buildings still on background of map view, and the areas on top of the view, at overlay the buildings.
Objects appear to take the order of creation even if they were grouped into sub-levels, and i try to change the view sub-layer order.
What I forgot to do?
GB 15.2.3 (b060414)
Thanks
Andrea
I have this vector layer structure generated by a script that use LAYER_GROUP command:
LINES -> Splitted on other layers
POINTS -> Splitted on other Layers
and
AREAS -> Splitted on this sub-layers:
BUILDING -> Splitted on other sub-layer
SERVICES -> Splitted on other sub-layer
NATURAL -> Splitted on other sub-layer
In sub-layer BUILDING i've all buildings splitted in sub-layer, with style solid fill for all, but in various color.
In sub-layer NATURAL i've all type of park areas splitted in sub-layer with style solid fill for all, but in various color.
The problem is that some of the NATURAL sub-layer areas overlay all building that are in BUILDING sub-layer and i can't see them.
Also if i invert the order of layers on:
NATURAL
SERVICES
BUILDING
Never change in the map view, the buildings still on background of map view, and the areas on top of the view, at overlay the buildings.
Objects appear to take the order of creation even if they were grouped into sub-levels, and i try to change the view sub-layer order.
What I forgot to do?
GB 15.2.3 (b060414)
Thanks
Andrea
Comments
-
Andrea,
By default vector features are sorted by type and style before layer order. For the built-in types this works well, but for custom or un-typed data there isn't as much to go on for sorting.
If you go to the Vector Display tab of the Configuration dialog you can change the vector order during draw setting to depend on the layer order rather than the type, then they will draw in exactly the order that you specify in the Control Center.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Thanks Mike, it works
There is a way to check the option "Order Vector Features by Layer Order First........." by Scripting Language?
Andrea -
Andrea,
I have updated the SET_OPT command so you can update the draw order to 'BY_TYPE' or 'BY_LAYER'. So to order by layer, you would add the command:
SET_OPT DRAW_ORDER="BY_LAYER"
I have placed new builds with the latest changes at the links below:
32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip
Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:
32-bit: C:\Program Files (x86)\GlobalMapper15
64-bit: C:\Program Files\GlobalMapper15_64bit
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Ok Mike,
SET_OPT DRAW_ORDER="BY_LAYER" work fine...
Now, there is any way, using Script Language to set the order for sort the sub-layer (not A-Z or Z-A), but based on the order that the script manage a single layer.
For example if my script manage first a sub-Layer named HIGHWAY and then the sub layer named CYCLEWAY, now Global Mapper order layers by A to Z, and in Overlay control Center the sub-layer CYCLEWAY is first and the HIGHWAY is second.
But if i want to have HIGHWAY and then CYCLEWAY i must change the order by hand.
This is a problem when i have 200 Layer and sub-layer generated from OSM, because when i run my script i need that the order be the same that i manage with script.
Thanks
Andrea -
Andrea,
I've added support for new sort parameters for the SORT_LAYERS script command. You can now specify a LAYER_GROUP parameter to restrict the sorting to just those files in a particular group. There are new MOVE_FRONT, MOVE_FRONT_GROUP, MOVE_END, and MOVE_END_GROUP values for the MAP_ORDER parameter as described below:
LAYER_GROUP - specifies the layer group to match on. Only loaded layers in the specified group will be matched on. You can use wildcards (like '*' or '?') to match multiple groups. If you don't provide this paramter any group is ok. If you want only those layers not in a group add LAYER_GROUP="".
MAP_ORDER - specifies how to sort the maps. The following values are recognized:
MOVE_FRONT - move the matching layers to the front of the draw order
MOVE_FRONT_GROUP - move the matching layers to the front of the group specified with LAYER_GROUP
MOVE_END - move the matching layers to the end of the draw order
MOVE_END_GROUP - move the matching layers to the end of the group specified with LAYER_GROUP
So if you had the layers HIGHWAY, CYCLEWAY, and RAILROAD, and wanted them in that order, you could do the following:
SORT_LAYERS FILENAME="HIGHWAY" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="CYCLEWAY" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="RAILROAD" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
I have placed new builds with the latest changes at the links below:
32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip
Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:
32-bit: C:\Program Files (x86)\GlobalMapper15
64-bit: C:\Program Files\GlobalMapper15_64bit
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi Mike,
I did some test (build 060514) with the new MAP_ORDER parameter but seem that not change anything. I have 3 Layers in my script that are name of variables:
LIVELLO_LINEE
LIVELLO_AREE
LIVELLO_PUNTI
Each of three layer is splitted in sub-layer and other sub-layer (total three levels of Layer)
For now i try first to order the three principal layer, but if i use in my script this command:
SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
or if i use this:
SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
or this:
SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
the order in Global Mapper is always the same:
1 - LIVELLO_AREE
2 - LIVELLO_LINEE
3 - LIVELLO_PUNTI
Thanks
Andrea -
Andrea,
Why do you have the % signs around the FILENAME values? Do you have variables defined with the names LIVELLO_PUNTI, LIVELLO_LINEE, and LIVELLO_AREE?
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Yes Mike,
I've defined the variables for this three layers and for their sub-layer, because a need to change the name when i open certain map with script.
Thanks
Andrea -
Andrea,
I've added some more logging when the SORT_LAYERS command is done to see exactly what is being sorted. Can you get a new build and run with File->Run Script to see what you are seeing?
I have placed new builds with the latest changes at the links below:
32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip
Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:
32-bit: C:\Program Files (x86)\GlobalMapper15
64-bit: C:\Program Files\GlobalMapper15_64bit
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi Mike
Sorry, but is the same as previous build:
I write this in my script:
SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
but the result is in order:
1 - LIVELLO_AREE
2 - LIVELLO_LINEE
3 - LIVELLO_PUNTI
that are exactly order how are processed by my script!
I hope that you can make the fix because for me it is very important function, and this end of week i've many layer to add.
Thanks for your work
Andrea -
Andrea,
What does the log say when you run with File->Run Script? I didn't change the workings, just added more logging so I could see exactly what the SORT_LAYERS command is grabbing as a result of your variables.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Sorry Mike,
But i did not read that right ...
This is what tells me the log trying the script in three ways:SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="" MAP_ORDER="MOVE_END" SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="" MAP_ORDER="MOVE_END" SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="" MAP_ORDER="MOVE_END"
Log....
Sorting map layers matching filename filter 'OSM - PUNTI' with group filter of '' in order MOVE_END
WARNING: No files matching filename filter 'OSM - PUNTI' with group filter of '' for SORT_LAYERS command.
Sorting map layers matching filename filter 'OSM - LINEE' with group filter of '' in order MOVE_END
WARNING: No files matching filename filter 'OSM - LINEE' with group filter of '' for SORT_LAYERS command.
Sorting map layers matching filename filter 'OSM - AREE' with group filter of '' in order MOVE_END
WARNING: No files matching filename filter 'OSM - AREE' with group filter of '' for SORT_LAYERS command.SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="*" MAP_ORDER="MOVE_END" SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END" SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
Log...
Sorting map layers matching filename filter 'OSM - PUNTI' with group filter of '*' in order MOVE_END
WARNING: No files matching filename filter 'OSM - PUNTI' with group filter of '*' for SORT_LAYERS command.
Sorting map layers matching filename filter 'OSM - LINEE' with group filter of '*' in order MOVE_END
WARNING: No files matching filename filter 'OSM - LINEE' with group filter of '*' for SORT_LAYERS command.
Sorting map layers matching filename filter 'OSM - AREE' with group filter of '*' in order MOVE_END
WARNING: No files matching filename filter 'OSM - AREE' with group filter of '*' for SORT_LAYERS command.SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" MAP_ORDER="MOVE_END" SORT_LAYERS FILENAME="%LIVELLO_LINEE%" MAP_ORDER="MOVE_END" SORT_LAYERS FILENAME="%LIVELLO_AREE%" MAP_ORDER="MOVE_END"
Log...
Sorting map layers matching filename filter 'OSM - PUNTI' with group filter of '*' in order MOVE_END
WARNING: No files matching filename filter 'OSM - PUNTI' with group filter of '*' for SORT_LAYERS command.
Sorting map layers matching filename filter 'OSM - LINEE' with group filter of '*' in order MOVE_END
WARNING: No files matching filename filter 'OSM - LINEE' with group filter of '*' for SORT_LAYERS command.
Sorting map layers matching filename filter 'OSM - AREE' with group filter of '*' in order MOVE_END
WARNING: No files matching filename filter 'OSM - AREE' with group filter of '*' for SORT_LAYERS command.
Thanks
Andrea -
Andrea,
Based on that there don't seem to be any available layers with the names 'OSM-PUNTI', 'OSM-LNEE', or 'OSM - AREE', so nothing is matching to get sorted. What does the loaded layer list look like in the Control Center?
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Yes Mike,
All layer exist. This is my print screen Windows of control center with other sub-layer to ordered with other SORT_LAYER command:
LAYERS.PNG
The three command:
SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="" MAP_ORDER="MOVE_END"
are the last commands processed at the end of my script.
Thanks
Andrea -
Sorry Mike,
but i can't editing the last post
The right commands that i have at the end of my script are:
SORT_LAYERS FILENAME="%LIVELLO_PUNTI%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_AREE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
SORT_LAYERS FILENAME="%LIVELLO_LINEE%" LAYER_GROUP="*" MAP_ORDER="MOVE_END"
and the sort order as you seeing are:
OSM - AREE
OSM - LINEE
OSM - PUNTI
Thanks
Andrea -
Hi Mike,
I did some test...
I think that there is a problem with a Layer name and group using certain commands and parameter.
I'm not sure if it matters, but I noticed that for some levels (randomly), including for example OSM - PUNTI, OSM - LINEE, OSM - AREE the button Metadata... is not active!
But for example if i go under sub-layer and select OSM - AREE -> CONFINI - (Aree) the Metadata button is active and if I read the Metadata i see that for Attribute DESCRIPTION the value is OSM - CONFINE - Amministrativo.
Why this value, if in Overlay Control Center the same layer is named CONFINI - (Aree)?
Is for this problem that the SORT_LAYER command not find the name, also if apparently the name in Overlay Control Center is right?
The commands that I run in script for generate group are:
This for check and move object in new layer named "CONFINI - (Aree)" that is the name assigned for this variable "%A_BOUNDARY%"EDIT_VECTOR FILENAME="%LIVELLO_AREE%" SHAPE_TYPE="AREAS" COMPARE_STR="<Feature Desc>=boundary - administrative" AREA_TYPE="OSM - CONFINE - Amministrativo" COMPARE_STR="NAME=*" COMPARE_STR="NAME:RU!=*" COMPARE_STR="<Feature Name>!=*Border *" MOVE_TO_NEW_LAYER=YES NEW_LAYER_NAME="%A_BOUNDARY%"
This for group level "CONFINI - (Aree)" variable "%A_BOUNDARY%" that have many object, in to group "OSM - AREE" variable "%LIVELLO_AREE%"SET_LAYER_OPTIONS FILENAME="%A_BOUNDARY%" LAYER_GROUP="%LIVELLO_AREE%"
And finaly this for split "CONFINI - (Aree)" variable "%A_BOUNDARY%" in other sub-levels with the name for any feature Type ObjectSPLIT_LAYER FILENAME="%A_BOUNDARY%" SPLIT_BY_ATTR="<Feature Type>" LAYER_DESC_ATTR_ONLY CLOSE_ORIG_LAYER
Total three levels for any OSM - PUNTI, OSM - LINEE, OSM - AREE layers.
I hope it help you to find the problem, or for tell me, that is incorrect some commands in my script file.
Thanks
Andrea -
Andrea,
Ah that helps tremendously. You are passing in a group name for the layer name. The layers are the 'leaf' items in the Control Center and that is where the data actually lives. In your Control Center the 'OSM - AREE', 'OSM - LINEE', and 'OSM - PUNTI' are all groups of layers, not individual layers. You can only show Metadata for a single layer at a time, so when you select a group with multiple actual layers underneath it, you can't show Metadata.
I think you want something like the following if you want to sort a whole group at once:
SORT_LAYERS LAYER_GROUP="%LIVELLO_PUNTI%" FILENAME="*" MAP_ORDER="MOVE_END"
SORT_LAYERS LAYER_GROUP="%LIVELLO_AREE%" FILENAME="*" MAP_ORDER="MOVE_END"
SORT_LAYERS LAYER_GROUP="%LIVELLO_LINEE%" FILENAME="*" MAP_ORDER="MOVE_END"
That should put the point group layers first, then area group layers, then line group layers.
When you use SPLIT_LAYER to split a layer, the actual data is in the sub-layers and the original layer name, like OSM - PUNTI, is then the group name for those layers split from the original layer.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi Mike,
sorry but is the same..
I run my script without any MAP_ORDER parameters, and then, when all data is loaded i've always this order:
OSM - AREE
OSM - LINEE
OSM - PUNTI
Then i write another small script (for test) only with this lines as you suggest:GLOBAL_MAPPER_SCRIPT VERSION="1.00" DEFINE_VAR NAME="LIVELLO_AREE" VALUE="OSM - AREE" DEFINE_VAR NAME="LIVELLO_PUNTI" VALUE="OSM - PUNTI" DEFINE_VAR NAME="LIVELLO_LINEE" VALUE="OSM - LINEE" SORT_LAYERS LAYER_GROUP="%LIVELLO_PUNTI%" FILENAME="*" MAP_ORDER="MOVE_END" SORT_LAYERS LAYER_GROUP="%LIVELLO_AREE%" FILENAME="*" MAP_ORDER="MOVE_END" SORT_LAYERS LAYER_GROUP="%LIVELLO_LINEE%" FILENAME="*" MAP_ORDER="MOVE_END"
This is the log...
Sorting map layers matching filename filter '*' with group filter of '%LIVELLO_PUNTI%' in order MOVE_END
WARNING: No files matching filename filter '*' with group filter of '%LIVELLO_PUNTI%' for SORT_LAYERS command.
Sorting map layers matching filename filter '*' with group filter of '%LIVELLO_AREE%' in order MOVE_END
WARNING: No files matching filename filter '*' with group filter of '%LIVELLO_AREE%' for SORT_LAYERS command.
Sorting map layers matching filename filter '*' with group filter of '%LIVELLO_LINEE%' in order MOVE_END
WARNING: No files matching filename filter '*' with group filter of '%LIVELLO_LINEE%' for SORT_LAYERS command.
If i not use the variables is the same..GLOBAL_MAPPER_SCRIPT VERSION="1.00" SORT_LAYERS LAYER_GROUP="OSM - PUNTI" FILENAME="*" MAP_ORDER="MOVE_END" SORT_LAYERS LAYER_GROUP="OSM - AREE" FILENAME="*" MAP_ORDER="MOVE_END" SORT_LAYERS LAYER_GROUP="OSM - LINEE" FILENAME="*" MAP_ORDER="MOVE_END"
This is the log:
Sorting map layers matching filename filter '*' with group filter of 'OSM - PUNTI' in order MOVE_END
WARNING: No files matching filename filter '*' with group filter of 'OSM - PUNTI' for SORT_LAYERS command.
Sorting map layers matching filename filter '*' with group filter of 'OSM - AREE' in order MOVE_END
WARNING: No files matching filename filter '*' with group filter of 'OSM - AREE' for SORT_LAYERS command.
Sorting map layers matching filename filter '*' with group filter of 'OSM - LINEE' in order MOVE_END
WARNING: No files matching filename filter '*' with group filter of 'OSM - LINEE' for SORT_LAYERS command.
Thanks for patient
Andrea -
Andrea,
The first one is especially odd, it doesn't appear to have applied to variable replacement! I just tried that script locally on my machine and the variables were defined properly. The log should also have showing a line indicating what the variables were defined to.
In any case, since directly specifying the name isn't working either I don't think that's it. When you run with File->Run Script do you have the option checked to 'Run Script in the Context of the Main Map View'? You would need that checked for the loaded layers to be available.
If that isn't it, can you save your data to a workspace and provide it to me (either zip up and post here or email to geohelp@bluemarblegeo.com)? Then I can try your script and see what might be going wrong.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi Mike,
I just send you a mail with the entire work
Thanks
Andrea -
Andrea,
Aha, I found the issue! I didn't notice that you have multiple levels of grouping, so the group names are actually like 'OSM - AREE<sub>Aeroport - (Aree)', etc. So to match them you need to use LAYER_GROUP="OSM - PUNTI*'. Just add the * wildcard after the group name variable and it will match any sub-groups. I will also update the group matching to do this automatically (multiple levels of groups are brand new in v15.2), so in the future you won't have to know to add the *.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Yeeess Mike,
It works...
Thanks
Andrea
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