Serial port and GPS

OsmDld Class

Map download from www.openstreetmap.org.

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

System.Object
   serial.OsmDld

[Visual Basic]
Public Class OsmDld
[C#]
public class OsmDld

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

Download maps from http://www.openstreetmap.org in format suitable for initializing the class BmpMaps, so in format suitable for the applications sgps.exe and map.exe. See the description for the method OsmDld.download() for more details. See the description of the classes BmpMap and BmpMaps for more details on the format of files created during the download.

Example

[C#]

            using System;
            using System.Globalization;
            public class OsmDldApp {
            private static bool dld_progress(int       i,
            int       n,
            OsmDldRec dldrec,
            Exception excp) {
            Console.Write("map {0}/{1} ", i + 1, n);
            if (excp == null)
            Console.WriteLine("successfully downloaded");
            else
            Console.WriteLine(excp.Message);
            return true;
            } /* dld_progress() */
            public static void Main(string[] args) {
            OsmDldDelegate cb;
            OsmDldCfg      cfg;
            string         basename;
            double         minlat, maxlat, minlon, maxlon, steplat, steplon;
            int            scale;
            if (args.Length < 7)
            Console.WriteLine(@"Wrong usage");
            else {
            try {
            cfg = new OsmDldCfg();
            cfg.format = "mapnik";
            cfg.basename = args[0];
            cfg.strminlat = args[1];
            cfg.strmaxlat = args[2];
            cfg.strminlon = args[3];
            cfg.strmaxlon = args[4];
            cfg.strsteplat = args[5];
            cfg.strsteplon = args[6];
            cfg.scale = int.Parse(args[7]);
            cb = new OsmDldDelegate(OsmDldApp.dld_progress);
            OsmDld.download(cb, cfg);
            }
            catch(Exception excp) {
            Console.WriteLine(excp.StackTrace);
            }
            }
            }
            }
            

Requirements

Namespace: serial

Assembly: map (in map.exe)

See Also

OsmDld Members | serial Namespace | OsmDld.download