random polygon sample generation

laughlinlaughlin Global Mapper UserPosts: 18Trusted User
edited June 2014 in Vector Data
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

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2013
    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
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited May 2014
    Hi.

    Has this feature been implemented yet ? I'm using v15.1.4

    Jeroen
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2014
    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
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited May 2014
    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
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited May 2014
    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
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited May 2014
    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
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited May 2014
    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.
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited May 2014
    Great, thanks alot :)

    Jeroen
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited May 2014
    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
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited May 2014
    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
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited May 2014
    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.
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited May 2014
    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.
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited May 2014
    Ok, I see.

    Thanks.
    Jeroen
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited May 2014
    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
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited May 2014
    Yes, you are correct. I've created a ticket for this, #13754. I'll post when the fix is available.
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited May 2014
    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.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited May 2014
    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
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited June 2014
    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
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited June 2014
    I've reopend the ticket and will have the new option for you soon.
  • PShoreyPShorey Global Mapper Developer Posts: 178Moderator, Trusted User
    edited June 2014
    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!
  • jeroenDKjeroenDK Global Mapper User Posts: 18Trusted User
    edited June 2014
    Great :), thanks.

    Jeroen
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited June 2014
    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
Sign In or Register to comment.