osm-carto already renders parking spaces. See here, for instance.
But then we have a case like this one that is not being rendered, even if they share 66% of the 3 tags the last one has. The project’s query for this layer includes sorting the features by size in decreasing order, with the idea of rendering smaller features last, which should make the parking_spaces be rendered on top of the parking lot. And yet, they aren’t.
I executed the following query in and up-to-date database and I get the features I expect in the order I expect:
europe=# SELECT
"feature",
"parking_space",
"way_pixels",
ST_AsBinary("way") AS geom
FROM (
SELECT
way,
way_pixels,
parking_space,
COALESCE(amenity) AS feature
FROM (
SELECT
way, COALESCE(name, '') AS name,
('amenity_' || (CASE WHEN amenity IN ('parking', 'parking_space')
OR amenity IN ('parking') AND (tags->'parking' NOT IN ('underground') OR (tags->'parking') IS NULL) THEN amenity ELSE NULL END)) AS amenity,
tags->'parking_space' as parking_space,
surface,
way_area/NULLIF(0.07464553543479724::real*0.07464553543468355::real,0) AS way_pixels
FROM
planet_osm_polygon
WHERE
amenity IN ('parking', 'parking_space')
ORDER BY
layer, way_area DESC
) AS landcover
) AS features
WHERE "way" && ST_Transform(ST_MakeEnvelope(5.416179,43.258399,5.417617,43.259505, 4326), 3857);
feature | parking_space¹| way_pixels | way
-----------------------+---------------+------------+-----------------------
amenity_parking | | 274262.78 | \x0103000000010000000a...
amenity_parking | | 203415.11 | \x0103000000010000000e...
amenity_parking | | 48887.86 | \x0103000000010000000c...
amenity_parking_space | | 4932.7563 | \x01030000000100000005...
amenity_parking_space | | 4667.051 | \x01030000000100000005...
Is mapnik
reordering or somehow ignoring these features?
¹ yes, I just noticed the parking_space
column is empty. Either daily updates with osm2pgsql
does not include the extra tags (the tags->'parking_space' as parking_space
in my query, which I added to the original one from the project; I’m interested in parking space types), or I do have an issue with my update process, but I still thinks these places should be rendered with the original code.
Opinions? Ideas?