Contour Lines Crossed

QldblueQldblue Global Mapper UserPosts: 17
edited March 2012 in SDK
Hi Mike,

I have started working on contour lines generation and I note that in areas of relatively steep terrain that contour lines often cross.

I suspect that this is part of the process of stripping out intermediate vertex points when the contour lines are generated to make their size manageable.

At this point I have already set all parameters to provide the detailed contours (and 1 m spacing)
i.e. xmspacing, myspacing and msimpThreshold all equal to zero. I have also set mdisablesmoothing to false.

I've tried numerous settings so I think it is something that will always crop-up!

Is this so, are crossings inherent with the contouring process?

To work with the GM code I guess the best approach would be to use a wider spaced contour lines. My observation is that the maximum number of crossings of adjacent 1m contour lines is of the order of 2, hence, if I contour on 5 m intervals I'll rarely see a crossing and in areas that are flat(ish) adopt a lesser line spacing.

Do you have any recommendations?

However, I'm also interested in the lateral accuracy provided by GM contouring process. In vertex stripping routines I've written in the past I have included a maximum lateral offset distance and the routine would step along the countour line until the maximum lateral accuracy exceeded the allowable accuracy (user set variable), step back one vertex and delete all intervening points.

Can you advise the likely maximum lateral accuracy of the GM contouring process?



  • QldblueQldblue Global Mapper User Posts: 17
    edited March 2012

    Tested with mdisablesmoothing set to true and no crossings of contour lines.

    Still interested in lateral accuracy though of the generated contours and the reasons for the crossings?

    I suspect an understanding of the variable mSimpThreshold is needed?

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2012

    The crossings can only be caused by modification of the contours after generation, either by simplification and/or smoothing. These have the effect of either removed intermediate vertices to save space without significantly affecting the shape (simplification) or moving and adding vertices to pretty up the contours (smoothing). Both modify the actual placement of the contour line, so in areas of very dense contours can cause crossing contours.

    As you noted, if you set mSimpThreshold to 0 and mDisableSmoothing to TRUE then both simplification and smoothing are disabled so you get exactly what was generated from the contouring operation, which should never cross.

    The mSimpThreshold specifies how far from a straight line between two vertices that an intermediate vertex must be before it is considered one that must be kept. The default in the GM application is one half of the sample spacing for the contour generation, so you would only get crossing contours if there were multiple contours crossing within a single sample.


    Global Mapper Guru
Sign In or Register to comment.