[OSM-talk] Parking symbols: YUCK!

Dave Stubbs osm.list at randomjunk.co.uk
Mon Feb 25 10:40:06 GMT 2008


On Sun, Feb 24, 2008 at 11:14 PM, Robert (Jamie) Munro
<rjmunro at arjam.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
>  Hash: SHA1
>
>
>  Tom Hughes wrote:
>  | In message <47C0892E.10708 at frankieandshadow.com>
>  |           David Earl <david at frankieandshadow.com> wrote:
>  |
>  |> Unfortunately removing the related node isn't going to work, because
>  |> Mapnik won't then render parking symbols. And it is a lot of work to do
>  |> that.
>  |
>  | I believe it will - as far as I know mapnik has rendered those
>  | symbols for parking areas for some time.
>  |
>  |> Since we have contradictory behaviour in the two renderers we can't
>  |> resolve this automatically unless osmarender can look and see on the fly
>  |> if there is a P node inside the area it is trying to do one for
>  |> automatically.
>  |
>  | I believe it is fundamentally wrong to add nodes which duplicate
>  | areas, although I know it is quite common.
>
>  I agree with this wholeheartedly. 1 item on the ground should be 1 item
>  in the database. What no one else has suggested is that if you really
>  need to put something in the DB twice, then at least use a relationship
>  to link the DB objects together.
>
>  I expect that someone with PostGIS knowledge can construct a query to
>  quickly identify all the parking nodes inside parking areas and produce
>  a list. I'm sure that many of us could write a perl or python script to
>  take this list and delete or relate the nodes.
>

As of the last planet there are 5881 such nodes. Interestingly there
are one or two car parks with two or three nodes in them.
My hugely overcomplicated postgis query could delete these for mapnik
in about 30 seconds if it was important to do so.

You can get a list with the following (there's probably a nicer SQL
query than this, but this pretty much represents the way I first
thought it through, and it seems to work):
select p.osm_id from planet_osm_point as p, planet_osm_polygon as a
where a.osm_id!=p.osm_id and a.osm_id in (select a.osm_id from
planet_osm_point as p, planet_osm_polygon as a where
a.amenity='parking' and p.amenity='parking' and a.way && p.way and
intersects(a.way, p.way) group by a.osm_id having count(p.osm_id) > 1)
and p.amenity='parking' and a.way && p.way and intersects(a.way,
p.way);

(osm2pgsql creates 1 point for each parking area and gives it the
osm_id of the area, so every area has at least 1 point already in the
postgis db)




More information about the talk mailing list