Global Mapper Pro

Slope settings

Noklu
Noklu Global Mapper UserTrusted User
edited February 2014 in Elevation Data
Is there a way to set slopes so they are always measured in percent rather than degrees? I have been working on a slope analysis script, the slopes keep showing up in degrees. We pretty much never use degrees, so in my mind it would be easier to change a default setting.

Comments

  • global_mapper
    global_mapper Administrator
    edited January 2014
    Where are you seeing the slopes displayed that you want them different? There are a few places slopes are used, so I'm not sure which one to check for setups for.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Global Mapper
  • Noklu
    Noklu Global Mapper User Trusted User
    edited January 2014
    After I run the script, then load the new shader, the slope categories don't look right. When I run the cursor around, I noticed in the status bar the measurement for slope is actually in degrees and percent, but the script is using the degrees as the cutoffs. Maybe my question should have been: how do you specify a range of slopes and get the results in percent? For instance: 0-15%, 15-25%, 25%+.
  • global_mapper
    global_mapper Administrator
    edited January 2014
    What script commands are you using? Are you creating a custom slope shader via a script or perhaps trying to create equal-value areas from slopes? Can you post your script?

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Global Mapper
  • Noklu
    Noklu Global Mapper User Trusted User
    edited January 2014
    Mike,
    Here is a copy of the script I put together. Let me preface this by saying, I know nothing about programming / script writing. I put this together from what I gleaned from the script reference page. In this one I am trying to set up four categories 0-8, 8-15, 15-25, 25+.

    GLOBAL_MAPPER_SCRIPT VERSION=1.0

    DEFINE_SHADER SHADER_NAME="Slope Analysis" BLEND_COLORS=NO STRETCH_TO_RANGE=YES SHADE_SLOPES=YES
    0.8,RGB(255,255,255)
    9.15,RGB(214,214,214)
    16.25,RGB(132,132,132)
    26.100,RGB(51,51,51)
    END_DEFINE_SHADER

    Any help would be appreciated.
  • global_mapper
    global_mapper Administrator
    edited January 2014
    I have updated the DEFINE_SHADER script command so you can indicate that the slope values are in percent rather than degrees. Just add SLOPES_PERCENT=YES to the DEFINE_SHADER script command then you can directly enter slope percent values. I have placed a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v15.xx installation folder to give it a try. If you are using the 64-bit v15 version there is a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip .

    Note the formula to get degrees from slope percent is:

    slope_deg = ::atan( slope_percent / 100 )

    Thanks,

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

    Thanks very much. This worked very well! I made a few adjustments and ended with exactly what I was looking for. The revised script is:

    GLOBAL_MAPPER_SCRIPT VERSION=1.0

    DEFINE_SHADER SHADER_NAME="Slope Analysis" BLEND_COLORS=NO STRETCH_TO_RANGE=YES SHADE_SLOPES=YES SLOPES_PERCENT=YES
    0-8,RGB(255,255,255)
    8.1-15,RGB(214,214,214)
    15.1-25,RGB(132,132,132)
    25.1-100,RGB(51,51,51)
    END_DEFINE_SHADER

    I do have one question and one comment. First is there a way to create a legend on the screen with slope categories? Second, I did create areas by making a geotiff, reloading and using the digitizer tool. The resulting areas have "stepped" edges. I realize this is from the pixel shape and the fact that I am tell the program to only pick solid colors. I was wondering if there was a way to create smooth lines between areas (I have no idea if this is a large or small task programming-wise). I would think it would be similar to creating anti-alias edges. Anyway, just a thought. Thanks very much for your help. This will go a long way in improving our work flow.

    John Kennedy
    Harleysville, PA
  • Jasmine_BMG
    Jasmine_BMG BMG Staff
    edited January 2014
    Hi Noklu,

    You should not need to export a GeoTIFF to create Area features from your grid. If you right click on the DEM layer in the Overlay Control Center, there will be a function available to create area/vector features from the selected. Once vector feature created – you can select the Area Feature with the Digitizer tool, right click to access the Edit menu and use the option to 'Smooth Selected Lines' under the ‘Vertex Editing’ option.

    Regards,

    Jasmine
  • Noklu
    Noklu Global Mapper User Trusted User
    edited January 2014
    Thanks,
    I will try that.
  • global_mapper
    global_mapper Administrator
    edited January 2014
    John,

    You might also want to try the Simplify/Reduce option under the same submenu in the Digitizer Tool. In a script you can use the EDIT_VECTOR command with the SIMPLIFICATION parameter to simplify the features after creation. Note that when the vertices for the feature change the areas could come apart slightly or slightly overlap.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • Noklu
    Noklu Global Mapper User Trusted User
    edited February 2014
    I have played around using this script and have been very pleased with the results. I have used it on a TIN generated from contours and have been able to create a more traditional looking slope map. I have been able to clip the shader at the site boundary, export as a png file and bring it into BricsCAD with out any problems. However, there is still one thing missing. Is there a way to have GM calculate the area in each slope category? This would save a lot of work in CAD
  • global_mapper
    global_mapper Administrator
    edited February 2014
    You can use the GENERATE_EQUAL_VAL_AREAS command (Global Mapper Scripting Reference) to create areas of similar slope after you have the slope grid or colored slope image layer, then use the GENERATE_REPORT (Global Mapper Scripting Reference) command on that new area layer to get a total enclosed area report for each slope category in a nice text file.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
Sign In or Register to comment.