User:Steve8

From OpenStreetMap Wiki
Jump to: navigation, search
Subversion Logo Steve8 commits code to OpenStreetMap SVN under the name steve8.
Hot logo.svg Steve8 volunteers at WikiProject Haiti.


Contributions

Recording of tracks in and around Enfield/North London. Done originally with a Garmin etrex Venture (and later with a Navi GT11) and a bicycle or on foot, in my spare time, usually weekends. I have cycled along any street in the area that wasn't yet in Openstreetmap, and have joined data up to Barnet, which was already pretty well mapped.

Considerable amount of work on style sheet improvements and additions on mapnik layer of slippy map. Any suggestions to trac please. Maintain the mapnik "map key" files, linked from sidebar on slippy map.

Also has a complete set of Ordnance Survey 7th Series sheets, which are being scanned and rectified and made available as they come out of copyright.

Background

I am a trained cartographer, currently working as the Educational Development Manager in the Centre for Learning and Teaching Enhancement at Middlesex University.

Contact

Happy to be contacted by email on: steve8@mdx.ac.uk - steve8 on IRC - steev8 on twitter

UK Yahoo Imagery Coverage Map

Customised mapnik output for UK Yahoo Coverage Map. Only zoom levels 6-11 are used.

UK Railway Map

Customised mapnik output for UK Railway Map. Only zoom levels 6-11 are used.

UK Canal Map

Customised mapnik output for UK Canal Network. Only zoom levels 6-11 are used.

Tube Network Map

Customised mapnik output for London Tube Network. Only zoom levels 11-14 are used.

Custom outputs

An experiment in customising output with Inkscape (can be viewed in full at [1]) Outputs.png

Map Legend

The notes below are for a first stab at adding a legend capability to osmarendered maps. It involves four stages, and can be customised by user. Keytest.png

First stage: Cut and paste the following text and save the file as "keydata.xml":
<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.3' generator='JOSM'>
  <node id='-1' action='modify' lat='51.659222896764604' lon='-0.04734995261557801' />
  <node id='-2' action='modify' lat='51.659222896764604' lon='-0.04554411154020111' />
  <node id='-3' action='modify' lat='51.65813087696919' lon='-0.047381087806532794' />
  <node id='-4' action='modify' lat='51.65813311870294' lon='-0.04552817032243226' />
  <node id='-5' action='modify' lat='51.65694545160091' lon='-0.047443358188442336' />
  <node id='-6' action='modify' lat='51.65694545160091' lon='-0.04548184115829156' />
  <node id='-7' action='modify' lat='51.65573267364284' lon='-0.04753676376130666' />
  <node id='-8' action='modify' lat='51.655731179153676' lon='-0.04548184115829156' />
  <node id='-9' action='modify' lat='51.65459661279528' lon='-0.04752156978812073' />
  <node id='-10' action='modify' lat='51.65459511830612' lon='-0.04548184115829156' />
  <node id='-11' action='modify' lat='51.65350837560103' lon='-0.047505628570351885' />
  <node id='-12' action='modify' lat='51.653510617334774' lon='-0.04548034666912574' />
  <node id='-13' action='modify' lat='51.65232043822796' lon='-0.04753271088910477' />
  <node id='-14' action='modify' lat='51.65231608600694' lon='-0.04549640193503433' />
  <node id='-15' action='modify' lat='51.64677863573631' lon='-0.04700218442552004'>
    <tag k='amenity' v='parking' />
  </node>
  <node id='-16' action='modify' lat='51.659011977969605' lon='-0.04485913733919608'>
    <tag k='place' v='town' />
    <tag k='name' v='trunk road' />
  </node>
  <node id='-17' action='modify' lat='51.65795659434826' lon='-0.04492140772110563'>
    <tag k='place' v='town' />
    <tag k='name' v='primary road' />
  </node>
  <node id='-18' action='modify' lat='51.65680006243719' lon='-0.044936601694291554'>
    <tag k='place' v='town' />
    <tag k='name' v='secondary road' />
  </node>
  <node id='-19' action='modify' lat='51.655585789989956' lon='-0.044952542912060404'>
    <tag k='place' v='town' />
    <tag k='name' v='unclassified road' />
  </node>
  <node id='-20' action='modify' lat='51.65443378792463' lon='-0.04492140772110563'>
    <tag k='place' v='town' />
    <tag k='name' v='cycle path' />
  </node>
  <node id='-21' action='modify' lat='51.6532862693268' lon='-0.04495030117831166'>
    <tag k='place' v='town' />
    <tag k='name' v='footpath' />
  </node>
  <node id='-22' action='modify' lat='51.652192054175885' lon='-0.044952542912060404'>
    <tag k='place' v='town' />
    <tag k='name' v='railway' />
  </node>
  <node id='-23' action='modify' lat='51.646613999727194' lon='-0.04504297371556035'>
    <tag k='place' v='town' />
    <tag k='name' v='parking' />
  </node>
  <node id='-24' action='modify' lat='51.66093003162948' lon='-0.035418548041083145' />
  <node id='-25' action='modify' lat='51.64613559872066' lon='-0.03543450055570178' />
  <node id='-26' action='modify' lat='51.660930408148076' lon='-0.04797246114151561' />
  <node id='-27' action='modify' lat='51.64615521629205' lon='-0.04797246114151561' />
  <node id='-28' action='modify' lat='51.66025681533055' lon='-0.04738430166154321' />
  <node id='-29' action='modify' lat='51.66025281651256' lon='-0.04558483356417724' />
  <node id='-30' action='modify' lat='51.660111426166836' lon='-0.04484505223526011'>
    <tag k='place' v='town' />
    <tag k='name' v='motorway' />
  </node>
  <node id='-31' action='modify' lat='51.65129946302367' lon='-0.04756424847127981' />
  <node id='-32' action='modify' lat='51.65129863143126' lon='-0.04554484538423577' />
  <node id='-33' action='modify' lat='51.65113407976998' lon='-0.044945022685113786'>
    <tag k='place' v='town' />
    <tag k='name' v='canal' />
  </node>
  <node id='-34' action='modify' lat='51.6503197526151' lon='-0.04752426029133835' />
  <node id='-35' action='modify' lat='51.6503197526151' lon='-0.04548486311432357' />
  <node id='-36' action='modify' lat='51.650194357541345' lon='-0.04494502268511378'>
    <tag k='place' v='town' />
    <tag k='name' v='stream' />
  </node>
  <node id='-37' action='modify' lat='51.6496399535561' lon='-0.047584242561250545' />
  <node id='-38' action='modify' lat='51.6496399535561' lon='-0.045504857204294306' />
  <node id='-39' action='modify' lat='51.649040130856974' lon='-0.045504857204294306' />
  <node id='-40' action='modify' lat='51.649040130856974' lon='-0.047584242561250545' />
  <node id='-41' action='modify' lat='51.64913253015611' lon='-0.04502499904499671'>
    <tag k='place' v='town' />
    <tag k='name' v='industrial area' />
  </node>
  <node id='-42' action='modify' lat='51.64872022541745' lon='-0.04760423665122127' />
  <node id='-43' action='modify' lat='51.64872022541744' lon='-0.04552485129426504' />
  <node id='-44' action='modify' lat='51.64818038498824' lon='-0.04552485129426504' />
  <node id='-45' action='modify' lat='51.64818038498824' lon='-0.04760423665122127' />
  <node id='-46' action='modify' lat='51.64822796569703' lon='-0.045029829455389456'>
    <tag k='place' v='town' />
    <tag k='name' v='retail area' />
  </node>
  <node id='-47' action='modify' lat='51.64782049136876' lon='-0.04762423074119201' />
  <node id='-48' action='modify' lat='51.64782049136876' lon='-0.04554484538423577' />
  <node id='-49' action='modify' lat='51.64728065093955' lon='-0.04554484538423577' />
  <node id='-50' action='modify' lat='51.64728132338795' lon='-0.04762423074119201' />
  <node id='-51' action='modify' lat='51.64733722002074' lon='-0.04506981763533092'>
    <tag k='place' v='town' />
    <tag k='name' v='residential area' />
  </node>
  <segment id='-52' from='-1' to='-2' />
  <segment id='-53' action='modify' from='-3' to='-4'>
    <tag k='highway' v='primary' />
  </segment>
  <segment id='-54' from='-5' to='-6' />
  <segment id='-55' from='-7' to='-8' />
  <segment id='-56' action='modify' from='-9' to='-10'>
    <tag k='highway' v='cycleway' />
  </segment>
  <segment id='-57' from='-11' to='-12' />
  <segment id='-58' from='-13' to='-14' />
  <segment id='-59' from='-24' to='-25' />
  <segment id='-60' from='-26' to='-24' />
  <segment id='-61' from='-25' to='-27' />
  <segment id='-62' from='-27' to='-26' />
  <segment id='-63' from='-28' to='-29' />
  <segment id='-64' from='-31' to='-32' />
  <segment id='-65' from='-34' to='-35' />
  <segment id='-66' from='-37' to='-38' />
  <segment id='-67' from='-38' to='-39' />
  <segment id='-68' from='-39' to='-40' />
  <segment id='-69' from='-40' to='-37' />
  <segment id='-70' from='-42' to='-43' />
  <segment id='-71' from='-43' to='-44' />
  <segment id='-72' from='-44' to='-45' />
  <segment id='-73' from='-45' to='-42' />
  <segment id='-74' from='-47' to='-48' />
  <segment id='-75' from='-48' to='-49' />
  <segment id='-76' from='-49' to='-50' />
  <segment id='-77' from='-50' to='-47' />
  <way id='-78' action='modify'>
    <seg id='-52' />
    <tag k='highway' v='trunk' />
  </way>
  <way id='-79' action='modify'>
    <seg id='-53' />
    <tag k='highway' v='primary' />
  </way>
  <way id='-80' action='modify'>
    <seg id='-54' />
    <tag k='highway' v='secondary' />
  </way>
  <way id='-81' action='modify'>
    <seg id='-55' />
    <tag k='highway' v='unclassified' />
  </way>
  <way id='-82' action='modify'>
    <seg id='-56' />
    <tag k='highway' v='cycleway' />
  </way>
  <way id='-83' action='modify'>
    <seg id='-57' />
    <tag k='highway' v='footway' />
  </way>
  <way id='-84' action='modify'>
    <seg id='-58' />
    <tag k='railway' v='rail' />
  </way>
  <way id='-85' action='modify'>
    <seg id='-62' />
    <seg id='-60' />
    <seg id='-59' />
    <seg id='-61' />
    <tag k='railway' v='rail' />
  </way>
  <way id='-86' action='modify'>
    <seg id='-63' />
    <tag k='highway' v='motorway' />
  </way>
  <way id='-87' action='modify'>
    <seg id='-64' />
    <tag k='waterway' v='canal' />
  </way>
  <way id='-88' action='modify'>
    <seg id='-65' />
    <tag k='waterway' v='stream' />
  </way>
  <way id='-89' action='modify'>
    <seg id='-67' />
    <seg id='-68' />
    <seg id='-69' />
    <seg id='-66' />
    <tag k='landuse' v='industrial' />
  </way>
  <way id='-90' action='modify'>
    <seg id='-73' />
    <seg id='-70' />
    <seg id='-71' />
    <seg id='-72' />
    <tag k='landuse' v='retail' />
  </way>
  <way id='-91' action='modify'>
    <seg id='-77' />
    <seg id='-74' />
    <seg id='-75' />
    <seg id='-76' />
    <tag k='landuse' v='residential' />
  </way>
</osm>

FIXME: Unfortunately, it includes all the edits when setting up the legend data.

Second stage: Open the resulting keydata.xml file in JOSM, and then SAVE (as..) your usual data output file, which you then through osmarender in the normal way. Result MUST be saved as "key.svg". Convert this SVG file to PNG format - MUST be called "key.png" and be saved in your normal working ditectory. [DO NOT UPLOAD THIS DATA AT ANY TIME TO THE SERVER - it is just a file with lines in annotated with tags (but necessarily has coords attached) and will screw up teh map data if uplaoded]

Third stage: You need to add the following lines of code to your osmarender.xsl file (you might want to do this in a copy in case it goes pear shaped!), best in the "Fairly static" section, after the two copyright logos:
        <!-- Draw the KEY -->
	<xsl:template name='key'>

		<g id='gkey'>
			<!--Map key add-on-->
			
				<image 
				  x="5px" 
				  y="320px" 
				  width="160px" 
				  height="290px"
				  xlink:href="key.png">
				</image>
						 
		</g>
	</xsl:template>
Fourth stage: Then add one line to your osm-map-features.xml file (you might want to do this in a copy in case it goes pear shaped!), at the beginning, after the "showLicence=yes" line:
  showkey="yes"

Now when you run osmarender via your revised osm-map-features file you should get a fixed legend below the scaling device and it should have the same rendered output that the map has. WARNING: this version only has the main subset of the map features that I currently use. You can change that by: editing the keydata file accordingly, and then changing the values of width and height to match the resulting PNG file that you get.

NB: you only have to do all this once, UNLESS you change any of the rendering details in your osm-map-features file, when the graphic will be out of sync with your map.

Any comments/suggestions welcomed, particularly how to shorten the keydata.xml file to cut out the edits that were necessarily done to align the elements.