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

Conversation

kocio-pl
Copy link
Collaborator

@kocio-pl kocio-pl commented Oct 1, 2017

Resolves #270.
Related to #552 (comment).

This is a draft which renders such entrances but only for parking=underground, because other parkings are visible in our style anyway. I plan to:

  • add the name rendering (it might be useful to know which underground object it leads to)
  • restrict rendering only to access=yes and access=permissive (there's too many of private underground parkings)

Example:
kx73oup3

Copy link
Collaborator

@pnorman pnorman left a comment

Choose a reason for hiding this comment

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

The MSS looks okay, but the SQL needs some changes.

The icon looks okay, but I haven't reviewed it for pixel alignment.

@@ -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.

@@ -1457,6 +1458,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"

@@ -1499,7 +1501,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?

@@ -1564,6 +1567,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?

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Oct 1, 2017

The icon looks okay, but I haven't reviewed it for pixel alignment.

I've tried to make "P" 1 px wide where possible, but that makes it hardly visible, so now it's mostly rescaled parking icon. Arrow uses points on the matrix, but since it's diagonal, I would rather not call it pixel aligned.

@pnorman
Copy link
Collaborator

pnorman commented Oct 1, 2017

You're going to need to rebase the SQL changes since I merged #2866, but that makes the changes simpler.

With those changes, amenity=parking_entrance meets the WHERE clause conditions and no changes need to be made to that part of the SQL.

@matthijsmelissen
Copy link
Collaborator

@kocio-pl Are you planning to continue working on this?

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented May 7, 2018

Yes, I can resolve conflicts soon, but there are still some unanswered questions and that's why this code is still waiting.

@meased
Copy link
Contributor

meased commented May 19, 2018

Here is a pixel aligned version of the icon.

Before/After
parking_entrance_sample

@kocio-pl
Copy link
Collaborator Author

So much better - thanks!

@pnorman
Copy link
Collaborator

pnorman commented May 28, 2018

Questions answered, but we still need to know the change in lines of XML so we know if it's causing a combinatorial problem or not.

@polarbearing
Copy link
Contributor

The icon should be transparent when an access tag is set. Probably just copy the two lines as used for parking.
SVG code can be optimised by stripping the metadata, I usually do that in vi or another text editor.

@kocio-pl
Copy link
Collaborator Author

I prefer not to show any of the private entrances - it's too many of them and they would clutter the view.

@polarbearing
Copy link
Contributor

not to show any of the private entrances

Both (transparent or not at all) is fine with me. Just did not see that in the code yet.

@HolgerJeromin
Copy link
Contributor

what about rendering private ones really late?

@kocio-pl
Copy link
Collaborator Author

I'm suspicious, but not completely against. z19+ might work - it just needs testing to make sure.

@johsin18
Copy link
Contributor

johsin18 commented Nov 4, 2018

I would love to see parking entrances rendered. How can I help to get this PR merged?

@kocio-pl
Copy link
Collaborator Author

kocio-pl commented Nov 4, 2018

Could you review code comments and probably make a fork with a proper code I could test?

johsin18 pushed a commit to johsin18/openstreetmap-carto that referenced this pull request Nov 9, 2018
johsin18 added a commit to johsin18/openstreetmap-carto that referenced this pull request Nov 9, 2018
@johsin18 johsin18 mentioned this pull request Nov 9, 2018
@kocio-pl kocio-pl deleted the parking-entrance branch November 13, 2018 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants