Add Support for Export OSM XML Format from Scripts

RSVector
Global Mapper UserTrusted User
I would like to see the functionality of the Export OSM XML vector data command added to the script language. I Would also like to see, in both cases, the ability to control which tags are created from feature attributes.
Comments
-
I've updated the EXPORT_VECTOR command to support using OSM as an export format. What kind of control of attributes would you want?
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 -
It amazes me how fast you are able to add features and fix bugs!
The software seems to make some decisions about what tags to generate. For example, a <tag k="maxspeed" v="20"/> seems to be associated with one of my other attributes (MP_TYPE = 0x03)? I set the first 7 attributes in my GM workspace and the software creates an additional <tag k="maxspeed" v="20"/>, effectively overwriting my setting of <tag k="maxspeed" v="15 mph"/>.
<tag k="name" v="Club"/>
<tag k="routeparam" v="1,0,0,0,0,0,0,0,0,0,0,0"/>
<tag k="mp_type" v="0x03"/>
<tag k="mp_bit_level" v="18"/>
<tag k="kml_html_desc_text" v="Snowmobile Club Trail"/>
<tag k="highway" v="tertiary"/>
<tag k="maxspeed" v="15 mph"/>
<tag k="maxspeed" v="20"/>
The GM software also seems to create a <tag k="waterway" v="river"/> associated with what a assume is MP_TYPE = 0x1F which in my case is effecting the rendering of <tag k="highway" v="secondary"/> that I desire.
To answer your question, is there a way to provide a list of feature attributes that should NOT get tags created? In the first example above, I would chose to disable the creation of tags for the following attributes:
routeparam
mp_type
mp_bit_level
kml_html_desc_text
<tag k="maxspeed" v="20"/> However I would want my setting of "maxspeed" to result in a tag.
So there would need to be a way to suppress some of the auto-generated keys such as waterway and maxspeed. -
Not sure if this is also an added capability but I would want to use the POLYGON_CROP_FILE with the export - will be cropping both point and line features. I'll give it a try with the update.
-
Sorry for several posts... In my case, if I were able to provide a list of attributes FOR tag creation that would be a short list and achieve what I need.
-
The EXPORT OSM from a script using POLYGON_CROP_FILE worked like a champ.
Thanks for great support. -
Hi - will the customized control of attributes be something you can release soon or should I start to look for a work-around?
-
I've updated the EXPORT_VECTOR command to you can provide multiple ATTR_TO_DELETE parameters, one for each attribute to ignore. So you can add ATTR_TO_DELETE="MP_TYPE" ATTR_TO_DELETE="RouteParam" ATTR_TO_DELETE="MP_BIT_LEVEL" etc.
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 -
Thank you Mike,
That's very helpful for eliminating clutter. However the issue that is causing me to perform some kind of manual post-editing is the auto-generated attributes, in particular maxspeed is over-riding my setting of maxspeed. If I specify ATTR_TO_DELETE="MAXSPEED", it deletes mine and still creates the auto-generated one. The auto-generation of <tag k="waterway" v="river"/> seems to have gone away.
In the example below, the blue <tag k="maxspeed" v="15 mph"/> is my setting and the red <tag k="maxspeed" v="20"/> is auto-generated.
<nd ref='-6076154'/>
<nd ref='-6076155'/>
<nd ref='-6076156'/>
<nd ref='-6076157'/>
<nd ref='-5955919'/>
<tag k="name" v="Club"/>
<tag k="routeparam" v="1,0,0,0,0,0,0,0,0,0,0,0"/>
<tag k="mp_type" v="0x03"/>
<tag k="mp_bit_level" v="18"/>
<tag k="kml_html_desc_text" v="Snowmobile Club Trail"/>
<tag k="highway" v="tertiary"/>
<tag k="maxspeed" v="15 mph"/>
<tag k="maxspeed" v="20"/>
</way> -
I stand corrected. After additional testing, if I do not specify ATTR_TO_DELETE="MAXSPEED", the auto-generated tag is suppressed and my setting is retained.
-
The auto-generated "maxspeed" is generated from the RouteParam attribute. So to get rid of that you would add ATTR_TO_DELETE="ROUTEPARAM" to remove that attribute from the feature and get none of the auto-generated stuff. However I did also change the auto-generated stuff so that it should no longer replace a pre-existing attribute value, it will only add a new one or replace an existing empty value. Or at least that's how it should be working now.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
I applied the ATTR_TO_DELETE command to EXPORT_VECTOR TYPE=GPX, perhaps I am not using it correctly here. I am trying to suppress all but the <name> tag.
<wpt lat="44.470810" lon="-71.182693">
<ele>346.708</ele>
<name>Gold House Pizza</name>
<desc>Trail Accessible Food</desc>
<sym>Food</sym>
</wpt>
<trkpt lat="43.502235" lon="-70.962074">
<ele>147.36</ele>
<time>2013-07-14T17:15:32Z</time>
</trkpt>
My script has ATTR_TO_DELETE="ELEVATION" ATTR_TO_DELETE="<Feature Desc>" ATTR_TO_DELETE="SYM" ATTR_TO_DELETE="TIME" ATTR_TO_DELETE="START_TIME" ATTR_TO_DELETE="END_TIME" -
The ATTR_TO_DELETE tag only applies to the OSM XML export, it doesn't work for all of them. Maybe it would make more sense to have an EDIT_VECTOR call before the export and just delete the attributes you don't want directly from the features.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Yes that makes sense. Any way to suppress some of the auto generated ones like <ele> <desc> <sym> <time>?
<ele>346.708</ele>
<desc>Trail Accessible Food</desc>
<sym>Food</sym>
</wpt>
<trkpt lat="43.502235" lon="-70.962074">
<ele>147.36</ele>
<time>2013-07-14T17:15:32Z</time>
</trkpt> -
I've added support for additional attributes for the GPX export from a script. They are now:
GPX Fields
EXPORT_AREAS - specifies that area features should be exported to GPX files as track lines. Use EXPORT_AREAS=YES to enable.
EXPORT_ATTRS - specifies whether or not all feature attributes for waypoints will be included as tags. Use EXPORT_ATTRS=YES to enable export.
EXPORT_DESC - specifies that <desc> tags will be exported for waypoints. Use EXPORT_DESC=NO to disable.
EXPORT_ELEV - specifies whether or not a <ele> (elevation) value should be generated for each waypoints/trackpoing. Use EXPORT_ELEV=NO to disable.
EXPORT_SYM - specifies that <sym> (symbol) tags will be exported for waypoints. Use EXPORT_SYM=NO to disable.
EXPORT_TIME - specifies that <time> tags will be exported for waypoints and track points when available. Use EXPORT_TIME=NO to disable.
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 -
That works great. Thanks again.
Categories
- 12.5K All Categories
- 5.5K Features Discussion
- 314 Downloading Imagery
- 1.3K Elevation Data
- 377 Georeferencing Imagery Discussion
- 611 GM Script Language
- 50 User Scripts
- 112 GPS Features
- 397 Projection Questions
- 803 Raster Data
- 1.3K Vector Data
- 6.5K Support
- 161 Announcement and News
- 893 Bug Report
- 557 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 542 Other Discussion
- 128 GIS Data Sources
- 26 Global Mapper Showcase
- 229 How I use Global Mapper
- 104 Global Mapper Forum Website