Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

[mapnik] rendering of ele tag on peaks #1116

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 4 comments
Closed

[mapnik] rendering of ele tag on peaks #1116

openstreetmap-trac opened this issue Jul 23, 2021 · 4 comments

Comments

@openstreetmap-trac
Copy link

Reporter: kubajz[at]kbx.cz
[Submitted to the original trac issue database at 9.50pm, Wednesday, 13th August 2008]

It would be nice to render altitudes of peaks. The value of ele could be rendered in parenthesis right after the name of the peak (if there is any) or the value could be rendered as a separate line under the name of the peak.

An example could be found here:
http://www.openstreetmap.org/?lat=48.7739&lon=13.8621&zoom=14&layers=B00FTF

It should be rendered as Plckenstein (1378)

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 10.12am, Thursday, 14th August 2008]

Punting to Steve, but I suspect this is hard as you won't know how many lines mapnik decided to use for the name so you won't know how far to offset the height from the point to get it below the name. As far as parenthesis go, that would require mapnik to be able to combine several attributes into a single text rendering and I'm not sure it can do that at the moment.

@openstreetmap-trac
Copy link
Author

Author: dalkvist[at]gmail.com
[Added to the original trac issue at 10.49pm, Wednesday, 27th August 2008]

<!-- before the style named text -->
  <Style name="peak-ele">
    <Rule>
      <Filter>[natural] = 'peak'</Filter>
      <MaxScaleDenominator>100000</MaxScaleDenominator>
      <TextSymbolizer name="name" face_name="DejaVu Sans Book" size="10" fill="brown" dy="10" halo_radius="1" wrap_width="20"/>
    </Rule>
  </Style>


<!-- before the layer named text -->
  <Layer name="peak-ele" status="on" 
	 srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over">
    <StyleName>peak-ele</StyleName>
    <Datasource>
      <Parameter name="type">postgis</Parameter>
      <Parameter name="user"></Parameter>
      <Parameter name="password"></Parameter>
      <Parameter name="dbname"></Parameter>
      <Parameter name="table">(select way,(name|| ' ' || ele) AS name, ele, "natural" from planet_osm_point where "natural" = 'peak' and name is not null and ele >= 1330) as name
      </Parameter>
      <Parameter name="estimate_extent">false</Parameter>
    </Datasource>
  </Layer>

@openstreetmap-trac
Copy link
Author

Author: dalkvist[at]gmail.com
[Added to the original trac issue at 10.52pm, Wednesday, 27th August 2008]

oh and you need to add the following line to the osm2pgsql style file, to get the ele tag in to the database

node	   ele		text	

@openstreetmap-trac
Copy link
Author

Author: steve8[at]mdx.ac.uk
[Added to the original trac issue at 9.30pm, Sunday, 11th January 2009]

Done in version lodged 17th December 2008

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant