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

How to display labels for Staircase Locks ? #50

Open
pyrog opened this issue Jul 21, 2013 · 3 comments
Open

How to display labels for Staircase Locks ? #50

pyrog opened this issue Jul 21, 2013 · 3 comments

Comments

@pyrog
Copy link

pyrog commented Jul 21, 2013

Bingley Five Rise Locks

Example : Newlay Locks

  • Zoom 18
    capture decran 2013-07-21 a 09 04 12
  • Zoom 16
    display one label : Newlay Locks
    capture decran 2013-07-21 a 09 04 35

The map could have a better reading with this lock gate logo :
capture decran 2013-07-21 a 09 12 01

@yohanboniface
Copy link
Member

See mapnik/mapnik#1682

@pyrog
Copy link
Author

pyrog commented Aug 14, 2013

To avoid this problem, it's possible to map the lock only once (N+1 gates, only 1 line for a N basins lock).
In the example of Newlay, the lock_name could be simply "Newlay Lock".

Example : Lock of Picquigny
capture decran 2013-08-14 a 12 18 05

@PetrDlouhy
Copy link

Hi, I am not sure, if this issue is just about rotating point symbolizer along the line or something more. If it's just that, I was able to solve that in Prague Green map (github) for highway crossings. I used "point-transfor" with SVG icon:

#crossings[zoom >= 16] {
  point-placement: interior;
  point-transform: 'rotate([angle])';
  point-allow-overlap: true;
  point-ignore-placement: true;
  point-file: url('symbols/SVG/crossing_small.svg');
}

And counted the angle in PSQL query:

(
  select distinct on (p.way) p.way as way,
    p.crossing,
    degrees( ST_azimuth(coalesce(ST_Line_Interpolate_Point(l.way, ST_line_locate_point(l.way,p.way) * 0.99), p.way),
    coalesce(ST_Line_Interpolate_Point(l.way, (1 - (1 - ST_line_locate_point(l.way,p.way)) * 0.99)), p.way))) as angle

   from planet_osm_point p
   join planet_osm_line l
    on ST_DWithin(p.way,l.way,0.1)
   join (values
    ('motorway',1),
    ('trunk',2),
    ('primary',3),
    ('secondary',4),
    ('tertiary',5),
    ('unclassified',6),
    ('residential',7),
    ('living_street',8),
    ('service',9),
    ('cycleway',10)
   ) as v (highway,prio)
    on v.highway=l.highway
   where p.highway='crossing'
   order by p.way,v.prio
 ) as crossing

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

No branches or pull requests

3 participants