Skip to content

Known map sources

peterLaurence edited this page Jul 24, 2016 · 3 revisions

Here we list some map sources.

  1. USGS US Topo 7.5-minute map
  2. OpenStreetMap

USGS US Topo 7.5-minute map

Those maps can be downloaded from the official USGS viewer. The downloaded file is a GeoPDF, so a little work is needed to convert it to an image.

The USGS provides an official procedure to convert GeoPDF to GeoTIFF. For simplicity, this is summarized here :

  1. Install gdal

    On Ubuntu, you can install gdal-bin from the multiverse repository. GDAL also has distributions for Windows and MacOS.
    If you want to check your version, run

    gdalinfo --version
    
  2. Run the command :

    gdal_translate your_pdf.pdf image.tif --config GDAL_PDF_BANDS 3 --config GDAL_PDF_DPI 500

    That command will include all the layers of the PDF. If you only want some of them, the official doc explains how to do it. You can choose the desired dpi of the produced tif.

  3. Reduce the size of the produced file

    For a 7.5' map, the .tif file can be as large as 500Mb. It is possible to reduce the file size without noticing an image quality decline.

    gdal_translate -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR image.tif reduced_image.tif

    That step can take some time (~30min depending on your computer).

  4. Tile the map with Libvips

  5. Calibration

    Given the relatively small extent of 7.5-minute maps, and because of how those maps are built, it is strongly advised to set the calibration to "None", and use two latitude/longitude calibration points.

OpenStreetMap

See https://github.com/osmdroid/osmdroid/blob/44408833ca2c16c5cf35b8681e9fa02ef3099263/OSMMapTilePackager/readme.md

Example of usage for osmdroid-packager-5.2-jar-with-dependencies.jar :

java -jar osmdroid-packager-5.2-jar-with-dependencies.jar -u http://b.tile.openstreetmap.org/%d/%d/%d.png -t MapName -d ArchiveName.zip -zmin 10 -zmax 12 -n 51.091099 -s 41.366379 -e 9.543055 -w -4.790556

where you choose MapName and ArchiveName at your convenience.

Possible servers are :

Classic map

Cycle map

Clone this wiki locally