User:MHohmann
Manuel Hohmann:
|
I support the existing CC-BY-SA 2.0 license and don't want data or active users to be abandoned.
This picture probably describes me best: http://i5.photobucket.com/albums/y172/mhohmann/Disputation/Hat1.jpg
Contents |
Mapping activities
My current mapping activities include:
- tertiary roads in the districts of Gifhorn, Uelzen and Lüneburg
- agricultural roads in the district of Gifhorn
- POIs in Hamburg, Wolfsburg, along the B 4 between Lüneburg and Uelzen and L 270 between Uelzen and Wittingen
- housenumbers in Hamburg, Wolfsburg and the district of Gifhorn
- several parking lots at airports and fairgrounds
- research institutes and universities (mainly DESY, Hamburg)
I use a Garmin eTrex Vista HCx for data acquisition and JOSM (latest) for editing.
Proposals
Navit is an open source routing software capable of using OpenStreetMap data. It has been ported to a variety of portable devices, running Linux or Windows CE. Among these, there is now a working port to TomTom navigation devices, which are ARM based portable devices running Linux. The binary files as well as setup instructions can be found in Navit's Wiki:
http://wiki.navit-project.org/index.php/Navit_on_TomTom
For questions, please have a look at the discussion at Navit's Sourceforge forum:
http://sourceforge.net/projects/navit/forums/forum/512959/topic/3561185
Application: GPX layers with popups in OpenLayers
I recently faced the task of presenting GPX data on a web-based slippy map, so that information included as comments / descriptions in the GPX files is shown in popup boxes. After some trial and error, I finally managed to create such a map using OpenLayers. Here are two examples; have a look at the source code for more information.
- http://manuelhohmann.dyndns.org/orpheus/G8Map.html
- http://manuelhohmann.dyndns.org/mhohmann2/geschichten/wochenende/Map.html
Here is a simple, commented example source:
<html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>GPX Popup Example</title> <script src="http://www.openlayers.org/api/OpenLayers.js"></script> <script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"></script> <script type="text/javascript"> var map; function init() { // First of all, we need to create the map. map = new OpenLayers.Map ("map", { controls:[ new OpenLayers.Control.Navigation(), new OpenLayers.Control.PanZoomBar(), new OpenLayers.Control.LayerSwitcher(), new OpenLayers.Control.Attribution()], maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34), maxResolution: 156543.0399, numZoomLevels: 19, units: 'm', projection: new OpenLayers.Projection("EPSG:900913"), displayProjection: new OpenLayers.Projection("EPSG:4326") } ); // Add the base layers. map.addLayer(new OpenLayers.Layer.OSM.Mapnik("Mapnik")); map.addLayer(new OpenLayers.Layer.OSM.Osmarender("Osmarender")); // This will enable us to autozoom the map to the displayed data. var dataExtent; var setExtent = function() { if(dataExtent) dataExtent.extend(this.getDataExtent()); else dataExtent = this.getDataExtent(); map.zoomToExtent(dataExtent); }; // Now add a layer for the GPX data. The file "Somefile.gpx" contains some GPX data - in this case, waypoints and routes. var lgpx = new OpenLayers.Layer.Vector("GPX Data", { protocol: new OpenLayers.Protocol.HTTP({ url: "Somefile.gpx", format: new OpenLayers.Format.GPX({extractWaypoints: true, extractRoutes: true, extractAttributes: true}) }), strategies: [new OpenLayers.Strategy.Fixed()], style: {fillColor: "darkred", strokeColor: "red", strokeWidth: 2, strokeOpacity: 0.5, pointRadius: 5}, projection: new OpenLayers.Projection("EPSG:4326") }); // This will perform the autozoom as soon as the GPX file is loaded. lgpx.events.register("loadend", lgpx, setExtent); map.addLayer(lgpx); // This function creates a popup window. In this case, the popup is a cloud containing the "name" and "desc" elements from the GPX file. function createPopup(feature) { var lonlat = feature.geometry.getBounds().getCenterLonLat().clone(); lonlat.transform(new OpenLayers.Projection("EPSG:900913"), new OpenLayers.Projection("EPSG:4326")); feature.popup = new OpenLayers.Popup.FramedCloud("gpx", feature.geometry.getBounds().getCenterLonLat(), null, '<div><h1>' + feature.attributes.name + '</h1><p>' + feature.attributes.desc + '</p><p>' + lonlat.lat + '° N</p><p>' + lonlat.lon + '° E</p></div>', null, true, function() { selcontrol.unselectAll(); } ); map.addPopup(feature.popup); } // This function destroys the popup when the user clicks the X. function destroyPopup(feature) { feature.popup.destroy(); feature.popup = null; } // This feature connects the click events to the functions defined above, such that they are invoked when the user clicks on the map. var selcontrol = new OpenLayers.Control.SelectFeature(lgpx, { onSelect: createPopup, onUnselect: destroyPopup }); map.addControl(selcontrol); selcontrol.activate(); // Finally, center the map - this will activate the autozoom / autocenter feature. if(!map.getCenter()) map.setCenter(null, null); } </script> </head> <body onload="init();"> <div style="width:100%; height:100%" id="map"></div> </body> </html>