Calculator of polygon directions

3582
24
07-11-2019 07:11 PM
MRC
by
New Contributor III

Hello everyone, 

i have a problem, pls help me solve...

i have two shaple files : 1. line - the streets

                                       2. polygon- the polygon of the parcel of land

then i want to calculator of the dicrections of the polygon following the street line, the result i expert is list of the table show : N- if the direction of the polygon is north, W -if the direction of polygon is west , NW - north - west , S is it south and ....

i have attached two file shp for you references ... pls help me 

Sorry for my bad english,

thank you...

if you aren't understand my problem just tell me explain more....

Tags (1)
0 Kudos
24 Replies
MRC
by
New Contributor III

i attached more information about the directions..

0 Kudos
MRC
by
New Contributor III

please help me? anybody ?

0 Kudos
MRC
by
New Contributor III

...

0 Kudos
MRC
by
New Contributor III

anyone coder here?

0 Kudos
RichardFairhurst
MVP Honored Contributor

Based on your map example, it is an ideal situation where the parcel is rectangular.  If every parcel was rectangular and at the exact tangent angle to the street, the easiest method would be to create linear referenced routes with your centerlines.  Then use Feature to Point with the inside option to extract the centroid of the parcel.  Then you can use the Locate Features Along Routes tool to get the measure and distance of the point along the centerline with an adequate search radius.  I usually get all events for all centerlines within the radius and eliminate events that have an address street name that does not match the centerline name.  I summarize the point on the parcel field to get a count of events for each parcel to determine if more than one event was created along a curve in the centerline, since technically all points along a tangent radial curve to the centroid are valid events, and manually eliminate all but one of those points.  An event layer can be created which displays an angle field and that layer can be exported to a real point feature class that will store the angle field values permanently.  From the angle you can determine the compass bearing of the tangent line from the parcel centroid point to the centerline.  You can also tell if the parcel is on the left or right hand side of the centerline, because the distance values are positive or negative depending on which side of the line the point is on.

You can join the point to the parcel using the parcel number and calculate over the angle or compass direction.

MRC
by
New Contributor III

Thanks for your help @Richard

Unfortunately the parcel has a lot of shapes, not only rectangular but also have other shapes as you can see of my folder attachments, i couldn't calculator correctly the directions, My idea is write code python for calculator this problems, but my ability to write code is very poor... when im write result show not like me expert ..

could you give me an advise ...

The most difficult thing in this problem is that I cannot determine the direction of the parcel following the directions of the streets line..

If you can write code to help me, I am very grateful to you!

Again Thank you very much, wish you good health....

0 Kudos
RichardFairhurst
MVP Honored Contributor

No code exists, except for the ideal situation.   While I can imagine some other methods, there is no way to know for sure what the parcel shape is without deep learning AI that I don't know how to write.  All I could do is solve the problem for the ideal situation and then come up with a way to determine if it worked and try another set of geoprocessing steps for the parcels that failed.  That probably would involve weeks of trial and error to come up with a 95% to 99% solution.  I don't have the time to do that.  Python is not the issue, the issue is coming up with the sequence of geoprocessing steps and validation checks at each stage to identify the parcels that passed and failed the previous steps you applied and coming up with an alternative geoprocessing set of steps that fits the majority of the parcels that failed.  No one knows all of those steps and validation checks for this problem.  Python only makes it easier to apply the steps in the right order in a repeatable manner once you figure them out, but it cannot figure out what those steps are for you (without AI).

AI will only get to a 90% to 99% solution at best as well, although the benefit is that it does the learning process and applies the solutions much quicker if you can come up with a way to train it.  However, no set of automated logical solutions will ever reach 100%.  100% can only be achieved at some point by coming up with some way to identify candidates that you suspect didn't get solved by all of the steps you have already applied and inspecting and manually solving each one at some point, and even then somethings won't get caught.

MRC
by
New Contributor III

You're right @Richard

With python code when built up, I could accept the error of 90-95%, the remaining 5-10% I will have to handle the hand to correct. I realized that it is very difficult to do this problem correctly with too few conditions, as you say i also think there is no technology AI can identify the direction of the parcel, If you could help me write a short code for cases that can only be solved 90%, I believe I can solve the remaining 10%, thank you very much for taking the time for me.

I also know that you have very little time, but if you could take some time to help me, I really thank you very much... 

0 Kudos
JohannesBierer
Occasional Contributor III

Isn't it possible to use the near tool and calculate the near angle?