Slope settings

Noklu
Global Mapper UserTrusted User
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
-
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 -
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%+.
-
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 -
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. -
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 -
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 -
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 -
Thanks,
I will try that. -
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 -
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
-
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
Howdy, Stranger!
Categories
- 12.2K All Categories
- 5.3K Features Discussion
- 312 Downloading Imagery
- 1.2K Elevation Data
- 371 Georeferencing Imagery Discussion
- 580 GM Script Language
- 42 User Scripts
- 111 GPS Features
- 388 Projection Questions
- 788 Raster Data
- 1.3K Vector Data
- 6.4K Support
- 159 Announcement and News
- 881 Bug Report
- 554 SDK
- 1.1K Suggestion Box
- 3.6K Technical Support
- 520 Other Discussion
- 125 GIS Data Sources
- 26 Global Mapper Showcase
- 217 How I use Global Mapper
- 99 Global Mapper Forum Website