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

Refurbished spring icon (fix #325 using @imagico first tests) #3189

Merged
merged 4 commits into from
Apr 30, 2018
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 0 additions & 6 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -1201,12 +1201,6 @@
marker-clip: false;
}

[feature = 'natural_spring'][zoom >= 14] {
marker-file: url('symbols/spring.svg');
marker-placement: interior;
marker-clip: false;
}

[feature = 'power_generator']['generator:source' = 'wind'],
[feature = 'power_generator'][power_source = 'wind'] {
[zoom >= 15] {
Expand Down
18 changes: 18 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,24 @@ Layer:
type: shape
properties:
minzoom: 8
- id: springs
geometry: point
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(SELECT
St_Centroid(way) AS way, "natural"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure, but I suspect that this code makes test rendering on z14+ very long. Instead of 2-3 s it takes like 10+ s every time and there's heavy I/O load, which means big database query most probably.

This is nasty performance bug. Could you look closer and fix it?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think dropping St_Centroid should give a similar result?

Also this might result in the spring icon being displayed outside of the spring polygons in case of moon-shaped springs - do we want that? Dropping the St_Centroid should solve that too.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is beyond my knowledge, but sounds reasonable. I don't know how should the code look like after dropping it, could you show the proper code that I could test?

Copy link
Collaborator

@matthijsmelissen matthijsmelissen Apr 30, 2018

Choose a reason for hiding this comment

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

Simply like this (like a few lines below):

way, "natural"

Make sure to test it on spring areas.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It works somehow wrong then -
Example place: https://www.openstreetmap.org/way/436133353#map=18/50.43224/20.50234

screenshot-2018-5-1 openstreetmap carto kosmtik 1
screenshot-2018-5-1 openstreetmap carto kosmtik

Copy link
Collaborator

@matthijsmelissen matthijsmelissen Apr 30, 2018

Choose a reason for hiding this comment

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

What looks wrong according to you? Note that the text in the second image is not the same as the text in the first image.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, it's just a mess with different interior algorithm again - when compared with my own master it looks OK, drinkable water name+icon is just moved with this area:

tnkhxidd

Copy link
Collaborator

Choose a reason for hiding this comment

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

For all 6 such areas in Poland the icon is placed the same as before, so it looks like this is not even needed. I believe marker-placement: interior in MSS file does the job.

I'm not sure if we should wait for @Penegal with this or just update this line somehow and merge it?

Copy link
Collaborator

@kocio-pl kocio-pl Apr 30, 2018

Choose a reason for hiding this comment

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

BTW: I hope soon we will have exactly the same interior algorithm in Kosmtik and on the OMSF servers, we're really close:

FROM planet_osm_polygon
WHERE "natural" IN ('spring')
UNION ALL
SELECT
way, "natural"
FROM planet_osm_point
WHERE "natural" IN ('spring')
) AS springs
properties:
minzoom: 14
- id: water-lines
class: water-lines
geometry: linestring
Expand Down
31 changes: 24 additions & 7 deletions symbols/spring.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions water-features.mss
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,11 @@
}
}
}

#springs {
[natural = 'spring'][zoom >= 14] {
marker-file: url('symbols/spring.svg');
marker-placement: interior;
marker-clip: false;
}
}