Drawing raster layers in 1.34 beta SDK
rick_edwards
Global Mapper User
Hi,
I've implemented the new 1.34 beta SDK into our application and now no raster layers are being drawn (background images, data grids and such like). The layers appear to be created ok in global mapper (if I save out a project and then load the layers into GM application they appear ok). All opacity and visible properties look fine and we don't do any auto contrasting. The extent appears to be set correctly.
Is there any new flag that I should be setting? I've not seen anything obvious so far in the new SDK. Any ideas?
Rick
I've implemented the new 1.34 beta SDK into our application and now no raster layers are being drawn (background images, data grids and such like). The layers appear to be created ok in global mapper (if I save out a project and then load the layers into GM application they appear ok). All opacity and visible properties look fine and we don't do any auto contrasting. The extent appears to be set correctly.
Is there any new flag that I should be setting? I've not seen anything obvious so far in the new SDK. Any ideas?
Rick
Comments
-
Rick,
Do the layers load ok (i.e. does GM_LoadLayerList succeed) with the v1.34 SDK? What projection is your data and are you setting your view projection to something (using GM_SetProjection) with the SDK?
I just tried the latest SDK sample application build with some raster layers and it loaded and displayed fine. If you want to provide one of your layers I can take a look.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
We load in a package through GM_LoadPackage and then retrieve the layer list through GM_GetPackageLayerList. It looks like we get all the layers ok and the map projection and each layer projection looks the same when we go to draw.
I've loaded in a single layer and exported from our application as a .gmp and loaded this into GM 11 ok. When we check the extents in our application it the coordinates are correct so it's getting the data ok.
Can I send you the .gmp or is that no use (unsupported file type for the forum attachments)?
One thing I noticed with the new SDK is that there is a GM_AddFeatureFlags_t8.GM_AddFeature_UseDefaultStyle flag but no flag to say don't use the default style (would have been false in the previous version). We've used GM_AddFeatureFlags_t8.GM_AddFeature_MoreAddsToFollow instead, but only for vector layers. Would this effect the drawing of raster layers as it's not re-running the calculations each time?
Rick -
Rick,
You should be able to post the package file here or email it to support@globalmapper.com.
The add feature flags should affect the behavior of raster layers. Note that the absence of the GM_AddFeature_UseDefaultStyle implies that the default style should not be used, so passing zero should have the same behavior as it did in old versions.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Hi Mike,
I've sent you a single layer example package as exported by our application to the support address. I'll re-trace the steps we need to take to integrate the new SDK with our application and check we've not missed anything here. The layer data all looks ok so I'm a little stumped at this time.
Thanks for your help.
Rick -
Hi Mike,
we've fixed the issue here, turns out we had not removed the interpolate pixels property from the raster display option (replaced by sampling method). Has now fixed our display options (probably some silent failure when trying to marshal the display options struct).
What is the default setting for the sampling method and can we turn off sampling (it seems to smooth dtm layers by default)?
Cheers
Rick -
Rick,
The default (i.e. not-resampled) method is GM_SAMPLING_NEAREST_NEIGHBOR. This is a value of 0 and is backwards compatible with old SDKs. The GM_SAMPLING_BILINEAR_INTERPOLATION value corresponds to the old option of enabling interpolation (i.e. it maps to 1). Only the new values 2 and higher result in any different behavior than the same values in the old builds.
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Support
support@globalmapper.com -
Yep just worked out GM_SAMPLING_NEAREST_NEIGHBOR setting looks like our legacy dtms!
Thanks Mike for all your help, sorry to have been a pain.
Rick
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