October 12, 2022

New additions to Global Mapper Software Development Kits (SDK) in v24.0

Written by: Amanda Lind

 

Global Mapper is well known as an all-in-one, installed GIS program; however, the program can be taken further by developers with the Global Mapper Software Development Kits (SDK). The Global Mapper and Global Mapper Pro SDKs open the engine behind Global Mapper to developers, allowing them to include functionality from the program in their own tools and to create custom toolbars and extensions for installed versions of Global Mapper.

When the Global Mapper desktop application is updated, the development kit is updated as well. The version 24 and 24 Pro software development kits provide multiple new tools and updates for program developers, including the ability to run a spatial script file via the SDK and improved Pixels to Points photogrammetric processing. 

Global Mapper SDK standard version

Providing the ability to load, style, visualize and analyze data, the Global Mapper SDK supports nearly all the file formats supported by the desktop version of the software, including new support for SAR TIFF files using complex phase/amplitude values and 12D ASCII model files. Other significant updates in version 24 Global Mapper SDK focus on scripting and improved display. 

Spatial Scripting

Global Mapper Script, a proprietary and text-based method to automate workflows, is not new to Global Mapper.  However, a new scripting language called Spatial Scripting has been added to Global Mapper in version 24, which allows a more flexible use of spatial operation tools.. With the addition of Spatial Scripting, both the desktop app and the SDK can perform a number of advanced queries, overlay operations, and additional analysis and processing on vector layers. Users can create their own custom scripts inside of the Global Mapper application, and execute them using the SDK via GM_RunSpatialScript. This function lets users save and execute workflows for use with different layers and even with tools outside of the Spatial Operations tool itself. For example, with Spatial scripting, it is possible to load a layer, select features based on an attribute, perform a function from the Spatial Operations tool, and create a new layer of vector data. And with the new Python scripting interface, you can automate complex workflows which might include a new Spatial Script, as they are supported in Python as well. 

Image of vector data loaded on top of an elevation layer

New functions for holes/islands in areas 

When an area feature/polygon contains a hole inside of it, this hole is represented as a sort of donut. When there is another polygon inside of the donut hole that is part of the same area feature, it is represented as an island feature. Vector editing, such as creating holes/islands in area features, has been a staple function in the desktop version of Global Mapper, and it has now been added to the new SDK version. In the past, users have had very little control of these specific types of features, relying on importing existing data which includes some holes/islands. With the 24.0 update SDK, users will be able to use GM_AddHoleInArea to define a hole/island in the area feature, as shown in the image below. 

An area feature with a hole in the middle to represent an island in a lake
An area feature encompassing Mono Lake, CA, including a hole to exclude the lake itself.

Users may also edit existing holes. GM_DeleteHoleInArea changes the delete status of the hole/island in an area feature at the given index in the layer. This takes advantage of the functionality that  “deleting” a feature won’t remove it from the list of features for a layer; it just marks it as deleted and makes it inactive for the purposes of drawing. To check if a hole/island has been deleted, users can query the delete status of the hole/island in a given area feature with the M_IsHoleInAreaDeleted. Once these updates are made, the SDK user can persist the data by exporting the layer they are working with to a file or database.

Additional Utility methods

In addition to the spatial scripting, new formats, and multi-polygon data updates, version 24.0 of the Global Mapper SDK has a few new utility methods and rendering updates. 

The GM_GetPixelDataInRect() method allows you to quickly extract sub-areas from a raster image, much quicker than loading and processing an entire image. 

The new GM_GetOnlineLayerLocationMetadata() method allows you to retrieve metadata information about an online source that you are connected to. 

The label render functionality inside of the 3D viewer has also been completely reworked when using custom label layers. Now you can load much larger datasets and still enjoy a very high frame rate display. And, the labels are no longer draped on the local raster layer. They are independently drawn, making things much easier to read.

And the function you didn’t know you needed, GM_RestoreDefaultSettings. This helpful little cleanup method will make sure to take care of any annoying little settings that might stick around between different map sessions. This will be especially useful when you are working with multiple Global Mapper Workspace files in the same application.

Global Mapper Pro SDK 

The Global Mapper SDK Pro module expands the kit to include commands for point cloud classification and analysis. Including advanced commands and tools not directly related to lidar data processing.

Improved core Pixels to Points processing

The Pixels to Points tool, and by extension the SDK’s implementation of it, is arguably one of the most powerful tools in Global Mapper. With the ability to generate point clouds, orthoimagery, and 3D mesh from images via photogrammetry, pixels to points has made data collection more affordable and approachable compared to lidar. In this new version, Global Mapper has improved its ability to take advantage of machines running NvidiaGPUs (CUDA support). When the GPU is available, enabling this option greatly improves processing speed and, in some cases, accuracy. These features are also available to SDK programmers.

Photogrammetric point cloud of a farm house
A photogrammetric point cloud is generated by the Pixels to Points tool.

Swath Separation Image Tool

Adding to the set of lidar analysis tools available in Global Mapper Pro SDK v24 is Swath Separation Image creation. Functionality requested by users of Global Mapper Pro, the Swath Separation Image tool is found on the Lidar Toolbar and generates an image of a point cloud showing the vertical separation between overlapping collection swaths or layers. The generated image depicts the intensity value of the point cloud, and shades overlap areas with specific colors to display separation at designated vertical offset thresholds.  The latest version of the SDK provides this tool to programmers as the function GM_CreateSwathSeparationImage.  

Swath Separation image
The generated swath separation image uses designated colors to show the vertical offset between lidar swaths.

A simple to execute tool, Swath Separation Image creation in Global Mapper Pro SDK v24 aligns with the USGS base lidar specification and automatically exports the generated image to GeoTIFF (*.tif), JPG (*.jpg), JPG2000 (*.jp2), ECW (*.ecw), or PNG (*.png) format at a user-specified location. The saved file can then be automatically loaded into a Global Mapper workspace file allowing the swath separation to be explored for data quality assurance purposes.

To download a trial of the Global Mapper SDK, visit the Blue Marble Geographics website bluemarblegeo.com/global-mapper-sdk. For any questions or to request a trial of the Global Mapper Pro SDK, please contact sales@bluemarblegeo.com.

Companies using Blue Marble’s geospatial technology