Hi everyone
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,
Aaron
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?
Excuse me for not understanding, but why would you want to check if the text is in the area? Are you not concerned about the point only?
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...
Aaron
My knowledge is too limited for this, I'm sorry. Maybe one of our senior mathematicians will take a look at this and let you know if it's possible.
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?
Unless I'm misunderstanding you, I think that's the same as your original suggestion, and won't allow for irregular shapes.
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...
No let's say on a specific line, we have a part of the boundary. Or a few pixels, as the left boundary. And on the same horisontal line, we have the right boundary of a few pixels. Now we check that the point itself, is between the pixels.
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.
No keep it in this forum. You will get in trouble for "double posting".