Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Last active March 22, 2021 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/e8b9281d07334f3b77eb4b45c42073d8 to your computer and use it in GitHub Desktop.
Save ThomasG77/e8b9281d07334f3b77eb4b45c42073d8 to your computer and use it in GitHub Desktop.

Generate tiles scan 1000

Deps

Need GDAL 3.1+ or at least latest gdal2tiles.py file https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/scripts/gdal2tiles.py with a lower GDAL version, 7zip and wget installed

Commands to execute

wget ftp://SCAN_1000_ext:Jee3choh6iezooce@ftp3.ign.fr/SCAN1000_2-1__JP2-E100_LAMB93_FXX_2020-02-01.7z.001
7z x SCAN1000_2-1__JP2-E100_LAMB93_FXX_2020-02-01.7z.001
cd SCAN1000_2-1__JP2-E100_LAMB93_FXX_2020-02-01/SCAN1000/1_DONNEES_LIVRAISON_2020-03-00188/SC1000_JP2-E100_LAMB93_FXX/
gdalbuildvrt -a_srs epsg:2154 scan1000.vrt *.jp2
# Need GDAL 3.1 for --xyz option or take the latest file from https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/scripts/gdal2tiles.py
gdal2tiles.py --s_srs="EPSG:2154" --xyz --zoom=2-10 scan1000.vrt output_folder

Serve tiles locally

We use http-server Node.js utility to serve local directory. We consider you are in directory SCAN1000_2-1__JP2-E100_LAMB93_FXX_2020-02-01/SCAN1000/1_DONNEES_LIVRAISON_2020-03-00188/SC1000_JP2-E100_LAMB93_FXX/ before running the following:

http-server # Node.js utility to serve local directory

Consume now in QGIS

Add in "XYZ Tiles" url the following

Then, add the layer to the map in QGIS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment