Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding rendering for amenity=parking_entrance [WIP] #2875

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,13 @@
}
}

[feature = 'amenity_parking_entrance'][parking = 'underground'][zoom >= 18] {
marker-file: url('symbols/parking_entrance.svg');
marker-fill: @transportation-icon;
marker-placement: interior;
marker-clip: false;
}

[feature = 'amenity_pharmacy'][zoom >= 17] {
marker-file: url('symbols/pharmacy.svg');
marker-fill: @health-color;
Expand Down
6 changes: 5 additions & 1 deletion project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1427,6 +1427,7 @@ Layer:
tags->'power_source' as power_source,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'parking' as parking,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does another column do to the number of combinations, and does it cause problems with a combinatorial explosion?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no deeper understanding of SQL in layers - I just try to make it work and look similar to other features. Some guidelines or tutorial for adding things would be welcome.

What you think should be done here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://vimeo.com/68093876 talks about the problem starting at 10:52-14:21. The best way to check this isn't a problem here is to compare the line count of the XML output. If it increases by a dozen lines, that's fine. If it increases by 10000 lines, it's a problem.

I suspect this is okay, but I'm not 100% sure. If you added something that styled all objects with some parking value then it would definitely be a problem.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the code I have ever added to osm-carto was some SVG XML for icons, so that's probably not the case for me.

I understand the combinatorial explosion principle, my problem is rather what you can see at 16:40. Some common layers are so complex, that they don't even fit on the screen, so it's hard to know which visual section is needed and how should it look like.

I refer to "visual sections", because with so many elements it's hard to see the logical structure and know what is nested inside something other - even with all the indents. Maybe putting some of the lists into variables or including them from other files would help, if it's possible?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where can I find those generated XML files, in particular having a setup closely following
https://github.com/gravitystorm/openstreetmap-carto/blob/master/DOCKER.md
?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just need CartoCSS:

https://github.com/mapbox/carto#installation

Then you can just run:

carto openstreetmap-carto/project.mml > project.xml

It might be easier to go inside the running container and use existing Kosmtik module:

docker exec -it openstreetmapcarto_kosmtik_1 \
/usr/lib/node_modules/kosmtik/node_modules/carto/bin/carto \
/openstreetmap-carto/project.mml > project.xml

You might remember that carto can be run against desired API version using -a.

CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer',
'confectionery', 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist',
'garden_centre', 'hairdresser', 'hifi', 'ice_cream', 'car', 'car_repair', 'bicycle', 'mall', 'pet',
Expand All @@ -1450,6 +1451,7 @@ Layer:
OR historic IN ('memorial', 'monument', 'archaeological_site')
OR tags->'memorial' IN ('plaque')
OR highway IN ('bus_stop', 'elevator', 'traffic_signals')
OR tags->'parking' IN ('underground')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see that we need to change the WHERE clause

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you suggest tu put here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this case should be already covered by "OR amenity IS NOT NULL"

OR (power = 'generator' AND (tags @> '"generator:source"=>wind' OR tags @> 'power_source=>wind'))
ORDER BY way_area desc
) AS amenity_points_poly
Expand Down Expand Up @@ -1492,7 +1494,7 @@ Layer:
'police', 'post_box', 'post_office', 'pub', 'biergarten', 'recycling', 'restaurant', 'food_court',
'fast_food', 'telephone', 'taxi', 'theatre', 'toilets', 'drinking_water',
'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility',
'charging_station', 'arts_centre', 'ferry_terminal') THEN amenity ELSE NULL END,
'charging_station', 'arts_centre', 'ferry_terminal', 'parking_entrance') THEN amenity ELSE NULL END,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other cases where we've added something to this query, but not the one above?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean amenity-points but not amenity-points-poly? I don't know, I just saw on the wiki that it's allowed only on nodes. I'm still undecided however if should I add it to amenity-line, since it makes sense to tag the service highway.

What's your opinion?

'emergency_' || CASE WHEN tags->'emergency' IN ('phone') THEN tags->'emergency' ELSE NULL END,
'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
Expand Down Expand Up @@ -1524,6 +1526,7 @@ Layer:
tags->'power_source' as power_source,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'parking' as parking,
CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer',
'confectionery', 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist',
'garden_centre', 'hairdresser', 'hifi', 'ice_cream', 'car', 'car_repair', 'bicycle', 'mall', 'pet',
Expand All @@ -1550,6 +1553,7 @@ Layer:
OR tags @> 'emergency=>phone'
OR highway IN ('bus_stop', 'elevator', 'traffic_signals')
OR tags @> 'ford=>yes' OR tags @> 'ford=>stepping_stones'
OR tags->'parking' IN ('underground')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above with the WHERE clause

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How should I correct it?

OR (power = 'generator' AND (tags @> '"generator:source"=>wind' OR tags @> 'power_source=>wind'))
ORDER BY score DESC NULLS LAST
) AS amenity_points
Expand Down
14 changes: 14 additions & 0 deletions symbols/parking_entrance.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.