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

First render of CLPC #420

Merged
merged 4 commits into from
Nov 29, 2020
Merged

First render of CLPC #420

merged 4 commits into from
Nov 29, 2020

Conversation

Phyks
Copy link
Member

@Phyks Phyks commented Aug 8, 2020

To be improved, this is a very draft first version to fix #4. This is only considering full relations (including all from, to and via members). Incomplete relations are unusable.

Examples:

https://www.openstreetmap.org/relation/10780842

Screenshot_2020-08-08 CyclOSM — Kosmtik

https://www.openstreetmap.org/relation/7506921

Screenshot_2020-08-08 CyclOSM — Kosmtik 2

I could not yet test it with a left turn.

TODO (any help welcomed! :):

  • Draw better icons, these "M12 signs" are barely readable at tiny scale.
  • Improve positionning strategy of the sign.

@brainwad
Copy link
Contributor

I have 2 suggestions on the readability of the icon: make the contents black instead of yellow, for better contrast; and remove the bicycle and enlarge the arrow to fill the whole triangle (this is already a bicycle-map, it should be obvious the sign applies to bicycles, unlike in the real world where all bicycle-specific signs need a bicycle drawn on them to not confuse car drivers).

@Phyks Phyks changed the title First render of CLPC [WIP] First render of CLPC Sep 29, 2020
@Phyks Phyks changed the title [WIP] First render of CLPC First render of CLPC Nov 27, 2020
@Phyks
Copy link
Member Author

Phyks commented Nov 27, 2020

Here is an improved version, much more readable.

2020-11-27-212206

2020-11-27-212209

@Florimondable If you think this render is good enough, I would be in favor of merging it and iterating from there, based on users' feedback.

@Florimondable
Copy link
Member

Florimondable commented Nov 28, 2020

Grey board instead of its red outline. Like trafic light.

The arrow in the first picture seems not aligned with the triangle (not parallèle with one side of the triangle).

I'm now in favor of tagging the board itself (without relation), but that's an other story.

@Phyks
Copy link
Member Author

Phyks commented Nov 29, 2020

2020-11-29-201559

@Phyks Phyks merged commit 317d15d into master Nov 29, 2020
@Phyks
Copy link
Member Author

Phyks commented Nov 29, 2020

@Florimondable I've just realized we have multiple grey tones. Note that the healthcare icon grey (#444) is different from the traffic light grey (#545454).

@Phyks Phyks deleted the clpc branch November 29, 2020 19:20
@Florimondable
Copy link
Member

@Florimondable I've just realized we have multiple grey tones. Note that the healthcare icon grey (#444) is different from the traffic light grey (#545454).

Yes, that's ok.

@Florimondable
Copy link
Member

It's broken on my PC :
Postgis Plugin: ERROR: relation "planet_osm_rels" does not exist LINE 21: JOIN planet_osm_rels r ON ( ^ in executeQuery Full sql was: 'SELECT * FROM ( SELECT ST_Centroid( ST_Intersection( ST_Union(h1.way, h2.way), ST_Difference( ST_Buffer(ST_Intersection(h1.way, h2.way), 20), ST_Buffer(ST_Intersection(h1.way, h2.way), 10) ) ) ) AS way, CASE WHEN members[array_position(members, CONCAT('w', h1.osm_id)) + 1] = 'from' THEN cast(degrees(ST_Angle(h1.way, h2.way)) AS integer) ELSE cast(degrees(ST_Angle(h2.way, h1.way)) AS integer) END AS angle FROM planet_osm_line h1 JOIN planet_osm_line h2 ON ST_Intersects(h1.way, h2.way) JOIN planet_osm_rels r ON ( parts @> array[h1.osm_id, h2.osm_id] AND r.tags @> array['type','restriction','restriction:bicycle','give_way'] ) WHERE h1.way && ST_SetSRID('BOX3D(-3.402823466385289e+38 -3.402823466385289e+38,3.402823466385289e+38 3.402823466385289e+38)'::box3d, 3857) AND h2.way && ST_SetSRID('BOX3D(-3.402823466385289e+38 -3.402823466385289e+38,3.402823466385289e+38 3.402823466385289e+38)'::box3d, 3857) AND h1.highway IS NOT NULL AND h2.highway IS NOT NULL AND h1.osm_id > h2.osm_id ) AS data LIMIT 0' encountered during parsing of layer 'clpc' in Layer [httpserver] /cyclosm-cartocss-style/tile/16/34088/23903.png?t=1606678022451 500 Trace at ProjectServer.raise (/home/florimond/node_modules/kosmtik/src/back/ProjectServer.js:261:13) at /home/florimond/node_modules/kosmtik/src/back/ProjectServer.js:75:30 at /home/florimond/node_modules/generic-pool/lib/generic-pool.js:283:11 at loaded (/home/florimond/node_modules/mapnik-pool/index.js:23:37) Postgis Plugin: ERROR: relation "planet_osm_rels" does not exist LINE 21: JOIN planet_osm_rels r ON ( ^ in executeQuery Full sql was: 'SELECT * FROM ( SELECT ST_Centroid( ST_Intersection( ST_Union(h1.way, h2.way), ST_Difference( ST_Buffer(ST_Intersection(h1.way, h2.way), 20), ST_Buffer(ST_Intersection(h1.way, h2.way), 10) ) ) ) AS way, CASE WHEN members[array_position(members, CONCAT('w', h1.osm_id)) + 1] = 'from' THEN cast(degrees(ST_Angle(h1.way, h2.way)) AS integer) ELSE cast(degrees(ST_Angle(h2.way, h1.way)) AS integer) END AS angle FROM planet_osm_line h1 JOIN planet_osm_line h2 ON ST_Intersects(h1.way, h2.way) JOIN planet_osm_rels r ON ( parts @> array[h1.osm_id, h2.osm_id] AND r.tags @> array['type','restriction','restriction:bicycle','give_way'] ) WHERE h1.way && ST_SetSRID('BOX3D(-3.402823466385289e+38 -3.402823466385289e+38,3.402823466385289e+38 3.402823466385289e+38)'::box3d, 3857) AND h2.way && ST_SetSRID('BOX3D(-3.402823466385289e+38 -3.402823466385289e+38,3.402823466385289e+38 3.402823466385289e+38)'::box3d, 3857) AND h1.highway IS NOT NULL AND h2.highway IS NOT NULL AND h1.osm_id > h2.osm_id ) AS data LIMIT 0' encountered during parsing of layer 'clpc' in Layer

@Phyks
Copy link
Member Author

Phyks commented Nov 29, 2020

I disabled the layer by default fbc1ef8. It should work now.

I make use of the planet_osm_rels table, which is created by osm2pgsql but is supposed to be somehow a temporary one, storing raw relations. This one might be deleted by users after db creation. (did you delete it?)

@Florimondable
Copy link
Member

Thanks.
I just use : osm2pgsql -c -G --hstore -d osm $1

@Phyks
Copy link
Member Author

Phyks commented Nov 30, 2020

Indeed, these tables are only created when --slim argument is passed. This argument makes osm2pgsql store data in temporary tables in the database, to ease updating (and is pretty standard if you have a live database). I added it in the docs eee7974.

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.

Render type=restriction and restriction:bicycle=give_way
3 participants