Moving Point Features within Polygon Features

3925
6
04-16-2016 01:32 PM
PeterWilson
Regular Contributor

Please note that I only have a ArcGIS Standard Licence. I have posted the following "Python Near Analysis (No Advanced Licence)"​ . Dan Patterson has provided me with some homework, which I'll be going through. I have another question that builds onto of the following. Once I've determined the shortest distance between each point feature. I'd like to filter out the point features that are within 3m or less of each other. I'm then looking for proximity techniques of being able to move the point features away from each other until they are over 3m away from each other, but still within the blue polygons. Any suggestions and workflows using Python will be appreciated.

ProximityAnalysis.png

0 Kudos
6 Replies
DanPatterson_Retired
MVP Esteemed Contributor

Peter, can you zip and post that example as either a gdb or shapefile.  I presume that it is already in projected coordinates.  questions

  • And it is not the polygon that you want moved, just the point because the simplest thing would be to find the points that are within the 3 m threshold and simply move it to the farthest polygon point.  But I suspect you want a 'nice' placement for the point but still within the polygon.
  • do you care about the geometry order of the points when it is done?
  • can both points be moved as long as they exceed the threshold? (picture a vector between the two points, then simply sliding each a finite increment away from each other.  In such a scenario, one or both points could be moved to attain the goal
  • I will have more

Dan

PS  I can simplify your first question now that I know it is a point-in-polygon distance case, since the search radius only needs to be applied to those points within a circular radius rather than searching all points.  I will post that incarnation there later

0 Kudos
PeterWilson
Regular Contributor

Hi Dan

I've attached the zipped file geodatabase containing the point and polygon features.

A few points that need to be taken into consideration:

  • I really like to keep the points as central as possible
  • When moving the points they need to be moved with half meter increments
  • Once the points have been moved they will need to be rechecked to ensure they are not within 3m or less of the other points
  • The points are representing the polygons that they are falling within.
  • The points are then being used to obtain a unique id, based on a spheriod grid system of 3m grids (or less closer to the poles). Unfortunately I don't have access to the grid before requesting the unique id. So by ensuring that the points are at least 3m apart from each other, I'm ensured that the returned id is unique for each building footprint.

Thanks Dan

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Peter, I did have a quick run through using the advanced tools (which you don't have) and there were only a handful of locations that fell within the tolerance... I have attached the table.  those that are remotely within that range have buildings attached to buildings.  More commentary from you since it is now a question of whether the distances are 'real' or whether they simply reflect the methodology of how the points are placed since I can easily come up with a method of denoting 'centrality' within the building footprint which will make more or less polygons fall within the tolerance...without having to do any fancy moving.  Obviously, this is not what you want... hence the backgrounder on the application.

table_selection.png

0 Kudos
PeterWilson
Regular Contributor

Hi Dan

Thanks for getting back to me on the following. By the way, I'm currently working through the NumPy Einsum Distance documentation that you provided me with as well as through the Numpy Reference Documentation to better understand how the following works.

With regards to the moving of the points within the polygons. The following is only part of the rest of the algorithm that I'm currently busy developing. It's important that the points are at least 3m apart from each other but still within the polygon as they are going to refer back to the polygon once I have completed developing the following algorithm. The Building Footprints should not overlap each other, if they do its an topology error which I fix before running the following. I'll provide you an updated polygon and point dataset tonight, after I've ensured its clean of any topology errors. Thanks Dan for all the help and guidance.

DuncanHornby
MVP Frequent Contributor

How will you deal with the scenario if you move a point in any direction it places it within 3m of another point?

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Luckily, both points are centroids or label points of polygons.  Their areas are large and the bounding rectangles have extents that the threshold distance is in the same order of magnitude as the threshold distance.  Hence, one only need extend one or both point along the vector formed by their connection.  Consider two points separated by 3.1 m, the vector formed by their connection creates a line, just 'project' one point along the vector so that it isn't on the line by 0.11m, if it falls within the polygon, you are done (in all cases it does.  Also, switching from centroid to another measure of centrality often solves the problem (ie median centre, weighted mean center, sometimes labelpoint  etc etc).  The tests are trivial and not time consuming by any stretch of the imagination, even if one did this using arcpy...which I am not

PS  I should point out that rather than projecting along the 'vector', one can project normal to one of the points (it is sometimes simpler) because Pythagorean theorem ensures that the hypotenuse of the triangle will be longer than its base

0 Kudos