First post. I apologise in advance if this question is a little elementary, but I hope you are able to help.
I am working on some travel sites and would like to try to work out whether a given point is in a given area.
Let's suppose I had longitude/latitude information for Manhattan's boundary. I have a series of co-ordinates which I join together by a straight line in order to define the area.
Now... let's suppose I am given co-ordinates for, let's say, the Empire State Building and Bronx Zoo. I want to be able to mathematically deduce whether these two points fall inside or outside the boundary. Obviously, in this case, the ESB does, and the BZ doesn't. But is that easy to work out automatically?
Please note, I am not a mathematician so really need an explanation of how to work this out that a non-mathematician would understand!
Thanks a lot,
Thank you for the reply but - alas - I don't think it's as simple as that.
Take this map for example:
If you take the "L" of Lugano... this point is within the lat/long extremes but, because of the irregular shape, it doesn't fall within the boundaries of the specific region.
Or have I not understood your reply correctly?
EDIT: Oh maybe you only used the "L" as an example. I can honestly not think of a way to check if it would be in the area if the area has such an irregular shape.
Yes, the L was just an example... I was simply illustrating that it didn't 'work' for the method I think you were suggesting.
I just want to find whether point x (for which I would have lat/long co-ordinates) fits in area y (for which I would have a series of co-ordinates which, when connected together, would mark the boundary).
I'm sure there must be a way...
EDIT: Since it's going to be on a computer, why not define the positions of the pixels as boundaries, and check if a point is between the specific row of pixels?
Should I be posting this in the advanced geometry forum? It's too advanced for me, but I was hesitant about posting it there straight off, as I wasn't sure if it would be considered 'advanced' here...
So we are dividing the whole map into pixels. And then we check for all the black pixels which we say makes up the outer border of a country, for example.