I'm currently in the process of cleaning up a municipality's address point data. I'm working with two data sets: address points and parcel polygons. Both the address point data and the parcel polygons have a parcel ID which allows for a spatial join and a way to verify where an address is supposed to be.
There are about 50,000 geocoded address points in my dataset. An overwhelming majority of these points fall within their corresponding parcel (aka they are spatially correct).
The problem I have is that many address points were not geocoded correctly and do not fall within their corresponding parcels. Oftentimes an address point is many parcels away from the parcel it should exist in.
Is there a a process within ArcMap (or ArcPy) that would allow me to move address points that aren't within their correct parcel polygon to where they should be? Essentially, I want to identify all of the address points that do not exist within their proper parcel (using the Parcel ID) and then redistribute those points into the parcel using the matching Parcel ID.
Best Answer
The following (untested) code should do the trick. This first gets the geometry of the points and polygons into dictionaries, then uses the polygon dictionary with the contains method of the arcpy.Polygon to test if the correct point is inside it. If not it is added to a new dict and used to update the point geometry.