hmm... sorry but I don�??t get it ... I do the join and then what? I can´t find a way to calculate distance between the two related points, a near analysis will give me the closest point but that point may not be the one I´m interested on. Using distance tools I´ll get the huge distance matrix again...That script looks good... i´ll try to look intoit and let you know how it goes... THX a lot!!
That is an important piece of information.I would think you can use the link table to assign the equivalent 5_k IDs to the points with 6_K IDs; and then use the 5_k IDs in both point sets to do what you need to do.If that's the case, try Join Field tool to transfer the equivalent 5_K IDs to the points through the common 6_K IDs.
In case you do not find a way to get a solution using the system tool, here is a python script you can try on. import arcpy proposed = r'D:\data\f.gdb\points_A' original = r'D:\data\f.gdb\points_B' # create an empty dictionary to store shapes proposed_points = {} with arcpy.da.SearchCursor(proposed, ("5k_ID", "Shape@")) as cursor: for row in cursor: # populate the dictionary # use 5k_ID field value as the key of the dictionary proposed_points[row[0]] = row[1] # create another dictionary original_points = {} with arcpy.da.SearchCursor(original, ("5k_ID", "Shape@")) as cursor: for row in cursor: # populate the dictionary # use 5k_ID field value as the key of the dictionary original_points[row[0]] = row[1] # iterate one of the dictionaries with ID values for id_5k in proposed_points: # get proposed and original points with same ID orig = original_points[id_5k] prop = proposed_points[id_5k] # now find the distance dist = prop.distanceTo(orig) print dist
import arcpy proposed = r'D:\data\f.gdb\points_A' original = r'D:\data\f.gdb\points_B' # create an empty dictionary to store shapes proposed_points = {} with arcpy.da.SearchCursor(proposed, ("5k_ID", "Shape@")) as cursor: for row in cursor: # populate the dictionary # use 5k_ID field value as the key of the dictionary proposed_points[row[0]] = row[1] # create another dictionary original_points = {} with arcpy.da.SearchCursor(original, ("5k_ID", "Shape@")) as cursor: for row in cursor: # populate the dictionary # use 5k_ID field value as the key of the dictionary original_points[row[0]] = row[1] # iterate one of the dictionaries with ID values for id_5k in proposed_points: # get proposed and original points with same ID orig = original_points[id_5k] prop = proposed_points[id_5k] # now find the distance dist = prop.distanceTo(orig) print dist
If the 5K_ID for related points in two files don't match, are there any other criteria or conditions (spatial or attribute information) that can be used to "match" them? If not, you may need to step back and look into the processes that have caused the unmatched IDs. Sometimes the problem occurs in early processes and may be solved more easily.
Are the 5k_ID values unique for each of the point feature classes? If possible, could you please share your data (keeping only the 5k_ID field)? You can send the data to my email as well: nahmed@esri.com It will be easier if you use Python script - do you want that?
Samuel,Have you had a look at Hawths analysis tools - Distance between Points tool:http://www.spatialecology.com/htools/pntdistbetw.phpRegardsAnthony
NobbirAhmed If Anthony's or Dan's suggestion hasn't solved your issue - please let me know which version of ArcGIS you are using.
Here is a workaround idea:1. Make sure the two sets of points are in the same projection/coordinate system; then use the Merge tool to combine them into one input.2. Use the Points To Line tool with the 5k_ID as the Line Field to obtain lines between each pair of proposed and real points. The line output carries the 5k_ID field and the Shape_Length values would be the distances you need. For shapefile output, you would need to add a field and then calculate the shape length, using the Add Field and Calculate Field tools.3. Run the Join Field tool to join the line output with any of the two point inputs via the common 5K_ID to transfer the Shape_Length field to it.Does it work for you?
use GenerateNearTable using the same FC for both in_features and near_features and the 'ALL' option on closest.That give you a (potentialy very big) table of distances between every point and every other.You can also get the bearing angle too, if you want.PointDistance may work for you too.You may want to make selections on the 5K_ID field before running it, to get (many) smaller tables to work with.you need an advanced license to use GenerateNearTable or PointDistanceWithout that:AddXY_management will give you locations for each point.You could then do some trig on the X,Y location differences between pairs of matched points
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.