[OSM-dev] Defining the area of a country / What country is a LatLon in.

Marcus Wolschon Marcus at Wolschon.biz
Mon Nov 19 20:41:48 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jon Burgess schrieb:
> AFAIK osmosis can not take an arbitrary .osm file to use as a boundary
> either. Shapefiles are a generic format and can be converted into a list
> of points defining a polygon bounding box relatively easily.
> 
> Any borders you get from the OSM data are going to have many thousands
> of nodes with way more detail than you probably require. From what I
> recall, Brett said previously that the osmosis bounding box task was not
> optimised for bounding boxes with this many nodes and would probably be
> really slow. 

Oh, don't worry but thanks for the warning.

a) I am doing these queries only while indexing the database for
   cities, roads, zip-codes and houses. This only happens when new
   data is downloaded and only for the downloaded data. Not while
   actually searching for addresses before doing the routing.

b1) In the usual case only the enclosed bounding-box and
    outher-bonding-box of the polygon will suffice.

b2) Near the border I can determine a more simplified inner and
    outher polygon to find out what tiles (not the slippymap-tiles)
    are completely inside the country(/city/zip-code/suburb) very
    easily.

b3) If the point is inside a tile that contains a part of the border,
    I can use that border-segment with all detail while aproximating
    all other parts of the polygon by three points. Thus the evaluation
    will be very easy in the order of O(N) where N is the number of
    nodes of the border that are within the current tile.

Thus I can implement an optimized contained-in -query myself.

Marcus
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHQfUMf1hPnk3Z0cQRAvyKAKDfiZh8pl2c6q0tuS5DDV3C1CPcxgCgrTDr
Z0WNYnyQ+Ctr76GGHYX05JE=
=4Lue
-----END PGP SIGNATURE-----




More information about the dev mailing list