[OSM-talk] osmxapi/bbox question

Frederik Ramm frederik at remote.org
Fri Apr 18 16:56:56 BST 2008


Hi,

>> That way you can call the osmxapi url with [polygon=belgium] or
>> [polygon:country=belgium]
>>
>> What do the osmxapi developers think about it?
>>
> 
> It's a nice idea.  I just need to implement the algorithm described earlier
> in this thread :)

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.

(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.)

Bye
Frederik




More information about the talk mailing list