<br><div class="gmail_quote">On Fri, Apr 18, 2008 at 4:56 PM, Frederik Ramm <<a href="mailto:frederik@remote.org">frederik@remote.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<div class="Ih2E3d"><br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
That way you can call the osmxapi url with [polygon=belgium] or<br>
[polygon:country=belgium]<br>
<br>
What do the osmxapi developers think about it?<br>
<br>
</blockquote>
<br>
It's a nice idea.  I just need to implement the algorithm described earlier<br>
in this thread :)<br>
</blockquote>
<br></div>
Not only do you need to implement the algorithm, you also need a computing environment that will be able to execute the algorithm in an acceptable timeframe. A halfway "correct" border polygon of a landlocked state easily runs into five-digit numbers of polygon nodes, and then for each of the 250 million nodes in the database, you have to find out whether it lies in that polygon.<br>

<br>
(An obvious optimization is to compute the largest rectangle contained in, and the largest rectangle containing, the polygon. First check if point is outside the outer bbox - if yes, you're done. Then check if point is inside the inner bbox - if yes, you're done. Only after that do the actual polygon test.)<br>

</blockquote><div><br>Yes, the algorithm is simple, it's implementation is a little more challenging.<br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Bye<br><font color="#888888">
Frederik<br>
</font></blockquote></div><br>