Difference between revisions of "CEM How to generate tiles for leaflet basemap"
From SCECpedia
Jump to navigationJump to searchLine 30: | Line 30: | ||
Georeference and Export a tif file | Georeference and Export a tif file | ||
select georeferencing and exit | select georeferencing and exit | ||
+ | |||
+ | |||
+ | {| | ||
+ | | [[FILE:qgis1.png|thumb|300px|gqis1]] | ||
+ | | [[FILE:qgis2.png|thumb|300px|gqis2]] | ||
+ | | [[FILE:qgis3.png|thumb|300px|gqis3]] | ||
+ | | [[FILE:qgis4.png|thumb|300px|gqis4]] | ||
+ | |} | ||
+ | {| | ||
+ | | [[FILE:qgis5.png|thumb|300px|gqis5]] | ||
+ | | [[FILE:qgis6.png|thumb|300px|gqis6]] | ||
+ | | [[FILE:qgis7.png|thumb|300px|gqis7]] | ||
+ | | [[FILE:qgis8.png|thumb|300px|gqis8]] | ||
+ | | [[FILE:qgis9.png|thumb|300px|gqis9]] | ||
+ | |} | ||
== generate image tile set == | == generate image tile set == | ||
== add to leaflet's basemap collection == | == add to leaflet's basemap collection == |
Revision as of 17:57, 9 August 2024
Contents
create new basemap for leaflet
goal: to create leaflet basemap overlay layer
georeference a png image file
Install QGIS from qgis.org
// With a png file, Create georeferenced tif image with QGIS // >>QGIS dashboard-load openstreet map-georeferencer-pick coordinates from map to referencer-export tiff image // Create tiles from the georeferenced image with gdal2tiles: (pip install gdal2tiles) // gdal2tiles.py -e --zoom=6-16 georeference_image.tif output_folder
Run QGIS
Start a new project first icon with a blank paper load a map Select XYZ Tiles and OpenStreetMap and zoom to region of interest
Load a png that needs to be geo-referenced select Layer -> georeferencer select open-raster and load the png file
Mark several map coordinates select 'From Map Canvas' and mark the matching location at the background map(remember to click OK) There will be a matching marker on the background map and georeferencer map
Georeference and Export a tif file select georeferencing and exit