Set number of decimal points for LENGTH Attribute
trax.namibia
Global Mapper UserTrusted User
Hi Mike,
Under the 'General' Tab of 'Configuration" I can choose the 'Distance Measure Units' (Metric, Nautical' etc...)
This is great, but is there a way for me to get GM12/13 to set the number of decimal points of the chosen unit so that when I export my vector data as a shapefile I can round road segments to say whole KMs rather than KM.123?
Thanks,
Bruce.
Under the 'General' Tab of 'Configuration" I can choose the 'Distance Measure Units' (Metric, Nautical' etc...)
This is great, but is there a way for me to get GM12/13 to set the number of decimal points of the chosen unit so that when I export my vector data as a shapefile I can round road segments to say whole KMs rather than KM.123?
Thanks,
Bruce.
Comments
-
Bruce,
So you want to truncate the coordinates so they are snapped to say the nearest km on export? There isn't currently a way to do that, the Shapefile format stores full double-precision values for each coordinates, so the snapping would have to be done in GM, although I suppose I could easily add an option for that to Shapefile export so you could snap values to the nearest integer. Is there some reason you want to snap the coordinates like this?
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
I don't think I have expressed my question very well. Sorry about that.
If I create a vector line object (or objects) and then right click, I have the option to 'Add/update the Measure Attributes of Selected Features' and GM will then update/create the attribute called 'LENGTH' giving me the total length of the segment rounded to X decimal places.
Ideally, I would like GM to create an additional attribute called say LENGTH_WHOLE which then creates the new attribute with a whole number rounded to a choice of decimal points chosen in the format selected under Configuration>General>Distance Measure Units.
Currently, Distance Measure Units gives five choices of:
'Metric m/km'
'Nautical ft/nm'
'Statute ft/miles'
'Chains chains/miles'
'Yards yrds/miles'
Would it be also possible to change this to the discrete choices of:
Metres
Kilometres
Feet
Nautical Miles
Miles
Yards
Thanks,
Bruce. -
Bruce,
Ah I see what you are saying. There is an option on the right-click option in the Measure Tool to always use base units, which for metric will always use meters,statute will use feet, etc. Perhaps that option will get you what you want, or do you need a way to force it to the larger of the units, like kilometers?
There isn't currently a way to force it to an integer, but if you still require that after using the 'always use base units' option I can add that.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Hi Mike,
I had never used the measure tool before, but I see that it is a good way of forcing a unit type. Great, but I see it doesn't have KMs (as you pointed out).
So, can you introduce KMs to the Measure Tool and some way of forcing an integer so that when I export my data, I will have an attribute field which shows whole KMs? (Even better, if less than one KM, .KM)
Thanks,
Bruce. -
Bruce,
I added new right-click menu options to the Measure Tool to force the measurements to use the larger unit and also an option to use whole numbers (if > 0.5 units). These options will also affect how the measure attributes are set. I have placed a new build at http://www.globalmapper.com/global_mapper13.zip with the change for you to try. Simply download that file and extract the contents into your existing v13.xx installation folder to give it a try. If you are using the 64-bit v13 version there is a new build at http://www.globalmapper.com/global_mapper13_64bit.zip .
Let me know if I can be of further assistance.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
http://www.globalmapper.com -
Mike, you really are brilliant. Just what I need.
I hope the folks at Bluemarble Geographics have rewarded you appropriately!
Many thanks.
Categories
- 12.7K All Categories
- 5.6K Features Discussion
- 342 Downloading Imagery
- 1.3K Elevation Data
- 380 Georeferencing Imagery Discussion
- 628 GM Script Language
- 53 User Scripts
- 113 GPS Features
- 414 Projection Questions
- 819 Raster Data
- 1.3K Vector Data
- 6.6K Support
- 177 Announcement and News
- 908 Bug Report
- 558 SDK
- 1.2K Suggestion Box
- 3.7K Technical Support
- 562 Other Discussion
- 129 GIS Data Sources
- 27 Global Mapper Showcase
- 233 How I use Global Mapper
- 107 Global Mapper Forum Website