Downloads maps for the given coordinates.
Divides the given area between minimum and maximum latitude and longitude into rectangles according to the given steps for the latitude and longitude. For each rectangle it makes then a POST request to the openstreetmap server with the URL defined in the variable URI with the following parameters:
maxlat | maximum latitude of the rectangle |
minlon | minimum longitude of the rectangle |
maxlon | maximum longitude of the rectangle |
minlat | minimum latitude of the rectangle |
format | Selects the exporter to use. Currently it should be either osm , mapnik or osmarender . The exporter osm creates openstreetmap xml files, mapnik and osmarender are able to create jpeg or png bitmaps. In my opinion mapnik creates better exports than osmarender, but it often doesn't work. |
mapnik_format | Currently it should ne either png or jpeg This setting is considered only for the exporter mapnik. |
osmarender_format | Currently it should ne either png or jpeg . This setting is considered only for the exporter osmarender. |
mapnik_scale | The mapnik scale given in the configuration. This setting is considered only for the exporter mapnik. |
osmarender_zoom | The osmarender zoom factor. No idea about a correct value, but the height of the resulting osmarender bitmap must be maximally 2000 pixels. The higher the zoom and the bigger the area resulting from the latitude step then the higher is the resulting bitmap. For example I was able to export bitmaps using steplat 0.04 and ther osmarender zoom factor of 15. This setting is considered only for the exporter osmarender. |
If the content type of the resulting web response it one of:
image/png
image/jpeg
text/xml; charset=utf-8
then the whole response is stored to a file. The name of the file results from aCfg.basename, a sequential number of the file and and a file extension suitable for the selected exporter and export type. The file name extension is:
png
for the export type png of the exporter mapnik or osmarenderjpeg
for the export type jpeg of the exporter mapnik and osmarenderosm
for the XML files created by the exporter osmAfter each download, regardless if it was successfull or not, the method calls the given callback delegate aCb. In this delegate the user of this method can for example show the progress of the download process or evtl. error messages. If the delegate callback returns false, then the download process is interrupted.
The call to this method should result in a set of png, jpeg or osm files with map fragments according to the given parameters and in one map description file. The names of the created file start with the given basename. Both the map description file and the created bitmap files with the map fragments can be used for the initialization of the class BmpMap, so it can be used as the map definitions in the applications sgps.exe and map.exe (as long, as the xml format osm was not used).
Warning The download of the mapnik generated files from www.openstreetmap.org is very sensitive and it often ends with an error, if requested for a too large area or a scale factor resulting with a too big bitmap. If the method generates exceptions with the message text like "ContentType text/html ContentLength n" then either decrease the step values or increase the scale factor. Also downloading maps using the osmarender exporter fails, if the size of the height of the resulting bitmap will be > 2000 pixels. In this case you'll have to adapt the osmarender zoom parameter.
OsmDld Class | serial Namespace | URI