Global Mapper v25.0

Drawing raster layers in 1.34 beta SDK

rick_edwards
rick_edwards Global Mapper User
edited April 2010 in SDK
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

Comments

  • global_mapper
    global_mapper Administrator
    edited April 2010
    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
  • rick_edwards
    rick_edwards Global Mapper User
    edited April 2010
    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
  • global_mapper
    global_mapper Administrator
    edited April 2010
    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
  • rick_edwards
    rick_edwards Global Mapper User
    edited April 2010
    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
  • rick_edwards
    rick_edwards Global Mapper User
    edited April 2010
    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
  • global_mapper
    global_mapper Administrator
    edited April 2010
    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
  • rick_edwards
    rick_edwards Global Mapper User
    edited April 2010
    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