--- On Fri, 21/8/09, BlueMM <[email protected]> wrote:
> I think this is why I am concerned about adding the addr:
> tags to the ref
> relations, is it not redundant data given that we have
> suburb boundaries, we
> know with reasonable certainty that a node is in what
> suburb/state/country? I

A little redundancy can save a ton of CPU cycles calculating this every time, 
this is why tiles get cached rather than drawn on the fly for each request :)

Since we're consolidating all the highway information 1 or 2 extra tags per 
relation will be less data in total than we started with.

That said I finally figured out a suitable SQL query against pgsql/postgis to 
calculate it.

select name from planet_osm_polygon where ST_Contains(way, 
ST_SetSRID(ST_Point(149.8422 * 20037508.34 / 180, ln(tan(((90 + -29.4642) * 
pi()) / 360)) / (pi() / 180) * 20037508.34 / 180), 900913))

That's for the point -29.4642, 149.8422, but you can use the same ST_Contains() 
function to compare relations with polygons so it's relatively straight forward 
to find out what state/country a line falls in.

Once I convert the MySQL queries across to PostGIS queries the lookup times on 
searches should be less as a result.


      

_______________________________________________
Talk-au mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/talk-au

Reply via email to