Global Mapper v25.0

Contours problem in x64

dana5dana
dana5dana Global Mapper UserTrusted User
edited January 2014 in SDK
For the same map and for the same contour interval I get 2 different results depending on the platform whether it is x86 or x64.

JM_WIN32_Cont-0.5.pngJM_x64_Cont - 0.5.png

What can be causing this problem?

thank you,
Dana

Comments

  • global_mapper
    global_mapper Administrator
    edited January 2014
    Dana,

    Which version of the GM SDK are you using? Also is it possible the elevation units were assigned incorrectly to one of the files (i.e. meters for one and feet for the other)? That would cause one file to have about 3 times as many contours as the other for the same contour interval.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • dana5dana
    dana5dana Global Mapper User Trusted User
    edited January 2014
    Dana,

    Which version of the GM SDK are you using? Also is it possible the elevation units were assigned incorrectly to one of the files (i.e. meters for one and feet for the other)? That would cause one file to have about 3 times as many contours as the other for the same contour interval.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation

    Hello again,
    Thank you for the answer.
    I looked and both maps have the mIntervalInFeet true in x86 and also in x64. I debugged to get the values .
    I use the 1.34 version.

    Thank you,
    Dana
  • global_mapper
    global_mapper Administrator
    edited January 2014
    Dana,

    What about the elevation layer, what elevation units is it in? If you call GM_GetLayerInfo on the elevation layer the mElevUnits will tell you the native elevation units interpretation for the layer. You can call GM_SetLayerElevationUnits to set the elevation units for a layer in case it is set wrong.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • dana5dana
    dana5dana Global Mapper User Trusted User
    edited January 2014
    Hello,

    I looked at the layer info in x64 and in x86 by comparison and they have the same elevation unit.

    I really don't know what could be causing this .

    Thank you,
    Dana
  • global_mapper
    global_mapper Administrator
    edited January 2014
    Dana,

    That is bizarre. Looking at the contours more closely I suppose it doesn't look like a meters/feet issue since the contours aren't reduced or increased by about a factor of 3. Can you show me your code where you set up the GM_ContourParams_t structure? In particular you should make sure to set the mSize variable, like the following:

    GM_ContourParams_t theParams;
    ::memset( &theParams, 0,sizeof theParams );
    theParams.mSize = sizeof theParams;

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • dana5dana
    dana5dana Global Mapper User Trusted User
    edited January 2014
    Dana,

    That is bizarre. Looking at the contours more closely I suppose it doesn't look like a meters/feet issue since the contours aren't reduced or increased by about a factor of 3. Can you show me your code where you set up the GM_ContourParams_t structure? In particular you should make sure to set the mSize variable, like the following:

    GM_ContourParams_t theParams;
    ::memset( &theParams, 0,sizeof theParams );
    theParams.mSize = sizeof theParams;

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation


    Hello ,
    The way I generate the contours is:

    GM_ContourParams_t theContourParams;
    ::memset( &theContourParams, 0, sizeof theContourParams );
    theContourParams.mSize = sizeof theContourParams;
    theContourParams.mDesc = "Generated Contours";
    theContourParams.mIntervalInFeet = TRUE;
    theContourParams.mGenerateAreas = TRUE;
    theContourParams.mContourInterval = 0.5;


    GM_LayerHandle_t32 theContourLayer = NULL;
    _theError = GM_GenerateContours ( _theLayer, &theContourParams, &theContourLayer);

    Thank you,
    Dana
  • global_mapper
    global_mapper Administrator
    edited January 2014
    Dana,

    I wonder if somehow the resampling used during the operation is being calculated differently. It's hard to say what little oddities might exist in such an older version. Can you try forcing the resampling method for the terrain layers to "nearest neighbor" before doing the operation to make sure it isn't somehow switching to a box resampler of some kind?

    You can do that by looping over the layers are setting resampling to GM_SAMPLING_NEAREST_NEIGHBOR using the following code:

    GM_RasterDisplayOptions_t theDispOpts;
    memset( &theDispOpts, 0, sizeof theDispOpts );
    theDispOpts.mSize = sizeof theDispOpts;
    GM_GetRasterDisplayOptions( theLayerHandle, &theDispOpts );
    theDispOpts.mResamplingMethod = GM_SAMPLING_NEAREST_NEIGHBOR;
    GM_SetRasterDisplayOptions( theLayerHandle, &theDispOpts );

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation