Way to automate "apply elevations from terrain"?
kryos
Global Mapper User
Hi everybody!
I am (still) using Globalmapper v12 and I am wondering if there is a way to batch-process some GPX-files of mine.
More in detail:
I have got a bunch of GPX-files and I have got a DEM with high resolution elevation data. What I am looking for is a way to automate the digitizer-function "Appy elevations from terrain layer to selected features". I know that i could mark all tracks at once and assign all values with only one click, but doing so I lose the ability to export every GPX into a separate file…they all get thrown into one "cumulative" GPX.
So I am wondering if you could create a Script that opens a GPX from a specific folder, assigns the new elevation data to the track and afterwards exports everything as a new GPX?
Thanks for your ideas and help!
I am (still) using Globalmapper v12 and I am wondering if there is a way to batch-process some GPX-files of mine.
More in detail:
I have got a bunch of GPX-files and I have got a DEM with high resolution elevation data. What I am looking for is a way to automate the digitizer-function "Appy elevations from terrain layer to selected features". I know that i could mark all tracks at once and assign all values with only one click, but doing so I lose the ability to export every GPX into a separate file…they all get thrown into one "cumulative" GPX.
So I am wondering if you could create a Script that opens a GPX from a specific folder, assigns the new elevation data to the track and afterwards exports everything as a new GPX?
Thanks for your ideas and help!
Comments
-
If you script export to a 3D format, like perhaps a Shapefile with the GEN_3D_FEATURES=YES parameter added to the EXPORT_VECTOR command you can get per-vertex elevations added from the terrain. You can then load the Shapefile back in and export out to GPX.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi Mike,
thanks for the reply. I already tried your suggestion but I get stuck at a crucial part:
According to the scripting reference (Global Mapper Scripting Reference - Aerial View Of Address - Aerial House View) the option GEN_3D_FEATURES acts in the following manner:The elevation stored for each vertex/point will be the first of the following that is available:- The elevation associated with the vertex/point in question.
- The elevation associated with the entire area/line/point being exported. For example, the elevation of a contour line or spot elevation.
- The first elevation obtained by searching the loaded elevation layers at the position of the vertex/point.
For my particular situation this means that the elevation is directly taken from the original GPX-File and NOT updated from terrain what I manually achieve by hitting "Appy elevations from terrain layer to selected features". I didn't find a way to delete the contained elevation info in the original GPX neither.
Any more ideas how to accomplish this?
Thanks! -
Ah I see. If you export once with GEN_3D_FEATURES=NO that will strip the elevations from the file. You could then re-import that file, unload the GPX, then export again with GEN_3D_FEATURES=YES to get the elevations from the terrain.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi Mike,
I'm looking to delete elevation as well however despite deleting the elevation field and disabling 3d features on export my new shapefile still contains the elevation field. I'm on GM v13.2. What am I doing wrong?
GLOBAL_MAPPER_SCRIPT VERSION=1.00
UNLOAD_ALL
IMPORT FILENAME="E:\_TRANSFER\2014\Forestry_Tasks\3D_From_TIN\Shape\Plots.shp"
IMPORT FILENAME="E:\_TRANSFER\2014\Forestry_Tasks\3D_From_TIN\Tin\TIN1.asc"
EXPORT_VECTOR FILENAME="E:\_TRANSFER\2014\Forestry_Tasks\3D_From_TIN\Shape\TIN1.shp" TYPE="SHAPEFILE" SHAPE_TYPE="POINTS" GEN_PRJ_FILE="YES" GEN_3D_FEATURES="YES"
UNLOAD_ALL
IMPORT FILENAME="E:\_TRANSFER\2014\Forestry_Tasks\3D_From_TIN\Shape\TIN1.shp"
EDIT_VECTOR FILENAME="E:\_TRANSFER\2014\Forestry_Tasks\3D_From_TIN\Shape\TIN1.shp" ATTR_TO_RENAME="ELEVATION=TIN1"
EDIT_VECTOR FILENAME="E:\_TRANSFER\2014\Forestry_Tasks\3D_From_TIN\Shape\TIN1.shp" ATTR_TO_DELETE="ELEVATION"
EXPORT_VECTOR FILENAME="E:\_TRANSFER\2014\Forestry_Tasks\3D_From_TIN\Shape\TIN1_no_elev.shp" TYPE="SHAPEFILE" SHAPE_TYPE="POINTS" GEN_PRJ_FILE="YES" GEN_3D_FEATURES="NO"
UNLOAD_ALLglobal_mapper wrote: »Ah I see. If you export once with GEN_3D_FEATURES=NO that will strip the elevations from the file. You could then re-import that file, unload the GPX, then export again with GEN_3D_FEATURES=YES to get the elevations from the terrain.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Can you try the latest v15 trial from Global Mapper Downloads and see if that works? I recall a quirk with 3D points from Shapefiles in older versions that you couldn't delete the ELEVATION attribute.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Works on the most recent build. I'll have to see about getting the upgrade.
Thanks Mike,global_mapper wrote: »Can you try the latest v15 trial from Global Mapper Downloads and see if that works? I recall a quirk with 3D points from Shapefiles in older versions that you couldn't delete the ELEVATION attribute.
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
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