Opened 11 years ago

Closed 10 years ago

#1116 closed enhancement (fixed)

[mapnik] rendering of ele tag on peaks

Reported by: kubajz@… Owned by: steve8@…
Priority: trivial Milestone:
Component: mapnik Version:
Keywords: Cc:

Description

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 Plöckenstein (1378)

Attachments (2)

peak-test-ele-on-all.png (142.2 KB) - added by dalkvist@… 11 years ago.
peak-test.png (114.7 KB) - added by dalkvist@… 11 years ago.
ele only on peaks with a name tag

Download all attachments as: .zip

Change History (6)

comment:1 Changed 11 years ago by Tom Hughes

Owner: changed from Tom Hughes to steve8@…

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.

Changed 11 years ago by dalkvist@…

Attachment: peak-test-ele-on-all.png added

Changed 11 years ago by dalkvist@…

Attachment: peak-test.png added

ele only on peaks with a name tag

comment:2 Changed 11 years ago by dalkvist@…

Resolution: worksforme
Status: newclosed
<!-- 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>

comment:3 Changed 11 years ago by dalkvist@…

Resolution: worksforme
Status: closedreopened

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	

comment:4 Changed 10 years ago by steve8@…

Resolution: fixed
Status: reopenedclosed

Done in version lodged 17th December 2008

Note: See TracTickets for help on using tickets.