Friday 19 October 2018

How to compare polylines attribute from the same GRID cell in ArcGIS 10?



I need some help because I do not know how to model this issue:


I have two polyline shapefiles. They have an attribute that I need to be compared. These are roads from different sources. So, I have their names and attributes.


My intention is to make this comparison within each GRID cell, so, I created a GRID with the fishnet tool, and then "Intersected" each polyline with the GRID, I have something like this:


Example


BUT, I think that it is important to use the "NAME" attribute, for a better comparison between elements with same name. I should need to distinguish polylines, like this example:


Example 2, more polylines


For example, If it compares the SE attribute with the one that crosses (it has SW), it gives me something wrong.


Maybe, another possibility is taking into account their bearing, or something related with its angle, because it happens to be, in most cases parallels.


Sorry, but I'm a bit lost. I think it is something tricky, but I hope there is a possible methodology for this purpose. Any ideas?


---- Edit ----



I'm thinking about the bearing question. This is my idea:



  1. Select all the GRID cell that intersect with my desired geo (the black one).

  2. Export to a new layer the selected. So I only have grid cells spatially containing my geo and possibly the geo to contrast (red one).

  3. Compute the bearing for each line Black and Red (previously intersected with the GRID cells).

  4. Start a WHILE-clause loop with:


WHILE counter > 0


Count the number of Black features contained into the cell. "var counter"


Select a black feature.



Take value of the QUESTIONED attribute (for example NE);


IF the red geo has a bearing value +-5% from the blacks value THEN


take (in another var) the red questioned attribute (for example NE); IF var1 == var2 THEN write "SAME" into a String field from Red geo. ELSE IF Write "ERROR" into the same string field.


END IF


END IF


Counter = Counter - 1 Next feature


END WHILE


I have never implemented such a pseudocode, any help for this? maybe is a good starting...


Anyone would adventure in that?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...