Serial port and GPS

OsmDldTest Class

Command line application for downloading OpenStreetMap maps.

For a list of all members of this type, see OsmDldTest Members.

System.Object
   serial.OsmDldCfg
      serial.OsmDldTest

[Visual Basic]
Public Class OsmDldTest
    Inherits OsmDldCfg
    Implements ICmdLineOpt
[C#]
public class OsmDldTest : OsmDldCfg, ICmdLineOpt

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Usage osm.exe options, where options are:

-basename=str Basename for the exported map files. The export creates then a file called str.map and a number of files with names str<num>.png, .jpeg or .osm. Also paths can be used, eg. /tmp/mytown, the directories named in the path must exist.
-exporter=str Defines the exporter to use for creating the resulting maps. Currently the web service www.openstreetmap.org supports only the following exporters: osm, mapnik and osmarender, so that the value of this parameter may be one of these three strings. The exporter osm causes creation of osm-files beeing an openstreetmap specific XML description of the map. mapnik and osmarender produce png or jpeg bitmaps. Currently only these bitmap formats are supported in the classes BmpMap and BmpMaps. The service www.openstreetmap.org is very sensitive, especially the mapnik exporter is often unavailable, unfortunately it seems to produce more accurate maps that the exporter osmarender. The exporters have also numerous limitations regarding the size of the resulting bitmaps and size of the exported area, so that values of -steplat, -steplon, -scale and -osmarender_zoom have to be found, by which the service www.openstreetmap.org works at all.
-export_format=str Format of the bitmap files exported by the exporter, currently png or jpeg.
-minlat=float Minimum latitude of the whole area to download. Format of the number according to Utils.coord2dec(), this means either a floating point number with a dot as decimal separator or a number with degrees, minutes, seconds, eg. 12d34m45.678sE for 12 degrees, 34 minutes and 45.678 seconds East.
-maxlat=float Maximum latitude of the whole area to download. Number format according to Utils.coord2dec().
-minlon=float Minimum longitude of the whole area to download. Number format according to Utils.coord2dec().
-maxlon=float Maximum longitude of the whole area to download. Number format according to Utils.coord2dec().
-steplat=float The whole area is subdivided into small rectangles. This is the step for subdividing the latitude part. This value must be > 0. For example for -minlat=48.0, -maxlat=48.05 and -steplat=0.03 the southern edges of the resulting rectagles will be at 48.0 and 48.03 incl. and the northern edges wii be located at 48.03 and 48.06 excl.
-steplon=float The step for subdividing the longitude part.
-scale=int Mapnik scale. No idea, how to compute it, usually values about 54500 give good results. Mapnik export does not work for wrong scales and it usually ends with a cryptic error message. In doubt try to export data from the interactive service on http://www.openstreetmap.org and try to find a working value there. This value is considered only for the exporter mapnik.
-osmarender_zoom=int Zoom for the osmarender exporter, considered only for osmarender. Exports resulting in height/width > 2000 pixels don't work so the values of zoom, steplat and steplon has to selected carefully. In doubt try the interactive service first.
Alternatively to this command line tool the applications map.exe and and sgps.exe contain a GUI interface for downloading maps described in the class OsmDldForm.

Example

            osm.exe -basename=test1 \
            -minlat=48.06 \
            -maxlat=48.22 \
            -minlon=11.43 \
            -maxlon=11.69 \
            -steplat=0.04 \
            -steplon=0.08 \
            -exporter=osmarender \
            -osmarender_zoom=15 \
            -export_format=jpeg
            
causes download of files test10.jpeg ... test115.jpeg containing the area from 11.63E 48.1N to 11.75E 48.18N. Each of the files contains contains a rectangle with 0.08 degree width (longitude) and 0.04 height (latitude). Additionally it creates the map file test1.map describing, which rectangle is included in which bitmap file. The path to this map file can be given as parameter to the class BmpMaps in applications map.exe or sgps.exe, which will show the requested position within one of the downloaded bitmap file. The bitmap files are created using the exporter osmarender with the osmarender zoom of 15, what results with bitmap sizes of 1864x1395 pixels. The following call
            osm.exe -basename=test3 \
            -minlat=48.10 \
            -maxlat=48.18 \
            -minlon=11.46 \
            -maxlon=11.54 \
            -steplat=0.01 \
            -steplon=0.02 \
            -exporter=osm
            
downloads maps for the area from 11.46E 48.11N to 11.54E 48.18N. It results in 32 files test30.osm to test331.osm each containing the OpenStreetMap specific XML description of rectangles with width 0.02 degree (longitude) and height of 0.01 degree (latitude). The map file test3.map lists the edges of rectangles exported to the single XML files. Please consider, that the class BmpMaps used in map.exe or sgps.exe is currently not able to use to osm format.

Requirements

Namespace: serial

Assembly: osm (in osm.exe)

See Also

OsmDldTest Members | serial Namespace