random polygon sample generation
laughlin
Global Mapper UserTrusted User
Hi,
Not sure which topic best suited to this query but here goes...
For planning archaeological surveys, a blend of systematic and judgmental factors come into play and it is always nice to offset the biases of each. With a DEM and air photo loaded over a study area, i am wondering if it is possible to randomly select a sample of square gridded survey areas clipped to extent of a study area. Ideally, this sample output would be based on real map grid units (ex. a 1 km grid based on loaded map data specs). The master 'grid' could also be generated in GM and exported as a layer and the random cell selection run on that.
Also wondering if it would be possible to stratify the process a bit directly in GM to include distance from certain slope values, elev ranges, watercourses, etc.
Certainly can be worked out by hand and calculator based on graphic output of base data from GM with the grid overlay for ref. Results marked up on hard copy, transposed to screen objects and saved to a new file as the survey targets. Would be great if all was feasible within GM.
If anyone has tackled a similar chore, greatly appreciate any solutions along the way.
- Laughlin
Not sure which topic best suited to this query but here goes...
For planning archaeological surveys, a blend of systematic and judgmental factors come into play and it is always nice to offset the biases of each. With a DEM and air photo loaded over a study area, i am wondering if it is possible to randomly select a sample of square gridded survey areas clipped to extent of a study area. Ideally, this sample output would be based on real map grid units (ex. a 1 km grid based on loaded map data specs). The master 'grid' could also be generated in GM and exported as a layer and the random cell selection run on that.
Also wondering if it would be possible to stratify the process a bit directly in GM to include distance from certain slope values, elev ranges, watercourses, etc.
Certainly can be worked out by hand and calculator based on graphic output of base data from GM with the grid overlay for ref. Results marked up on hard copy, transposed to screen objects and saved to a new file as the survey targets. Would be great if all was feasible within GM.
If anyone has tackled a similar chore, greatly appreciate any solutions along the way.
- Laughlin
Comments
-
Laughlin,
There isn't currently any way to do random selection of features within a sample area. We do plan to add a feature in the short term to create a random set of distributed points within an area, so perhaps that could be used as a starting point when implemented. I'm not sure if that will be in v14.2 or v15.0.
Thanks,
Mike
Global Mapper Guru
gmsupport@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi.
Has this feature been implemented yet ? I'm using v15.1.4
Jeroen -
Jeroen,
Yes we have added the option to create randomly distributed points inside selected areas in the latest builds. When you have an area selected the right-click Advanced Feature Creation submenu now has an item to create randomly distributed points.
I have placed new builds with the latest changes at the links below:
32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip
Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:
32-bit: C:\Program Files (x86)\GlobalMapper15
64-bit: C:\Program Files\GlobalMapper15_64bit
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Thanks for the fast reply ,
I need this for adding individual trees inside forest areas, so would it be possible, to make the number of points depend on the area of the polygon ?
Jeroen -
Jeroen,
There is an option "Generate this number in total" where the number of points specified will be evenly distributed over all selected areas. The number of points that are placed in a given area feature will be proportional to the that feature's area (ie its fraction of the total selected area). Will this work for you?
Peter -
Peter,
Not really, I would have to tweak this value every time I have to generate a map for a new area.
A point density option, would remain the same for different maps.
Jeroen -
Yes, I can see how this would be useful. I've added this to our TODO list as ticket #13675. I'll post when the new option is available.
-
Great, thanks alot
Jeroen -
Jeroen,
I've added the point density option. It will be available in the next daily build (later today or tomorrow).
32-bit: http://www.bluemarblegeo.com/downloa...l_mapper15.zip
64-bit: http://www.bluemarblegeo.com/downloa...er15_64bit.zip
Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:
32-bit: C:\Program Files (x86)\GlobalMapper15
64-bit: C:\Program Files\GlobalMapper15_64bit -
Hi Peter.
I've tested the new density option, but there seems to be a bug in the minimum distance calculation.
I've created a 1 sq km area, and tried to create 6400 pts with a minimum distance of 5 meters, but this results in a popup window telling me that the minimum distance has to be less than 4.46 m.
I'd say there should be plenty of room for 6400 pts.
A 80x80 grid with a 5 m grid spacing, should fit inside this area without a problem.
Is this a bug, or am I doing something wrong ?
Best regards
Jeroen -
This is by design. I’m using a Monte Carlo method to generate the point locations, where a random coordinate is calculated. A point is created at that location if the random coordinate is within the selected area and is not closer to any other point than the specified minimum separation. If the total area of the points, assuming a radius of one-half the minimum separation, approaches the feature area, it will take a very long time to generate all of the points since more of them will not meet the separation criteria. Thus, I’ve defined the maximum radius (half the largest value you can enter for minimum separation) such that the total area of the points be no more than 0.1 the feature area. For your numbers, this give a max separation of 4.46m. I suppose I could increase this area ratio factor a bit, but as I mentioned, this becomes problematic.
-
I've just increased the max area ratio from 0.1 to 0.5 - seems to work OK. Update will be available in next build.
-
Ok, I see.
Thanks.
Jeroen -
Hi again.
I've spotted an issue, with the random point sampling.
It ignores holes in areas, and will fill these with points to.
Regards.
Jeroen -
Yes, you are correct. I've created a ticket for this, #13754. I'll post when the fix is available.
-
Actually, after a closer look, I found that points are NOT generated in islands. That is, as long as the islands are not selected along with their parent areas. Islands will be selected if you drag the digitizer tool to select all items within a box, or if you use the Edit | Select All menu. To select the parent area, excluding the islands, you must click on the “non-island” part of the area. Multiple areas can be selected by ctrl-click.
I did, however, find a bug which I corrected. The area of islands was not accounted for in my calculations of point density. This would affect the distribution of points using the “Total number of points” mode, the number of points generated using the “Points per unit area” mode, and the pre-generate validation of dialog settings. The fix will be available in the next daily build. -
I've made a new daily build with Peter's changes. I have placed new builds with the latest changes at the links below:
32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip
Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:
32-bit: C:\Program Files (x86)\GlobalMapper15
64-bit: C:\Program Files\GlobalMapper15_64bit
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation -
Hi Peter.
Not clicking the islands or deselecting them afterwards, is not really an option for me, since I have datasets containing thousands of areas.
Would it be possible to add an option, specifying if you want to fill holes/areas or both ?
Best regards
Jeroen -
I've reopend the ticket and will have the new option for you soon.
-
I have added a "Generate points in selected islands" option. This will be unchecked by default. The update will be available in the next build.
Thanks for the great suggestions! -
Great , thanks.
Jeroen -
There is a new build with Peter's changes. I have placed new builds with the latest changes at the links below:
32-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip
64-bit: http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip
Simply download the .zip file for the build that you are using and extract over your existing installation files. The likely locations to extract to are as follows:
32-bit: C:\Program Files (x86)\GlobalMapper15
64-bit: C:\Program Files\GlobalMapper15_64bit
Thanks,
Mike
Global Mapper Guru
geohelp@bluemarblegeo.com
Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
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