Search code examples
mathcomputer-sciencegeo

Mapping a place with areas?


enter image description here

I have 2 tables as you can see in the image above. How can I find a place which insides (belongs to) an area or more than 1 areas based on the coordinate of a place and the coordinates of an area? Please give me some advice for algorithm! Thanks.


Solution

  • So, basically you are trying to determine whether a point is inside a polygon or not.. You can get an idea from the following place: http://www.geeksforgeeks.org/how-to-check-if-a-given-point-lies-inside-a-polygon/ It helped me out during an interview round once...

    Basic algorithm idea: Algorithm