GitXplorerGitXplorer
g

tms2geotiff

public
142 stars
27 forks
1 issues

Commits

List of commits on branch master.
Unverified
323369d9404505bb881ee96d383a30adc14687ff

fix tqdm progress bar

ggumblex committed a year ago
Unverified
80ff3537eb8b52a7ec98057f36edb0b6206b6bfc

supports BigTIFF, MBTiles and tqdm progress bar (#3)

ggumblex committed 2 years ago
Unverified
62de779a9fd5472979f476a2d39dcf5bea9b3ae8

write geotiff natively, remove gdal dependency

ggumblex committed 2 years ago
Unverified
37fe17827ee642181e7ddd7b07d26e02cdb2980d

tms2geotiff add GUI

ggumblex committed 2 years ago
Verified
d7f4ab4f5e510c02b65f67bcb928135c570583c8

Merge pull request #2 from 32Vache/patch-1

ggumblex committed 3 years ago
Verified
19618abf1a26a315e3854f1a2e4a3271c09b6b23

PIL max pixels

MMeijiRestored committed 3 years ago

README

The README file for this repository.

tms2geotiff

Download tiles from Tile Map Server (online maps) and make a large image.

If output is TIFF, it can write to a GeoTIFF image. Otherwise, it will save to a normal image with a World File for georeferencing (in EPSG:3857).

  • Dependencies: Pillow, requests/httpx.
  • Optional dependencies:
    • GDAL, numpy: for writing BigTIFF (>4GB GeoTIFF)
    • tqdm: progress bar

It can save the tiles directly as a MBTiles file now. The big image file is not required to generate.

GUI: Directly run python3 tms2geotiff.py to open a GUI window.

usage: tms2geotiff.py [-h] [-s URL] [-f LAT,LON] [-t LAT,LON] [-e min_lon,min_lat,max_lon,max_lat] [-z ZOOM]
                      [-m MBTILES] [-g]
                      [output]

Merge TMS tiles to a big image.

positional arguments:
  output                output image file (can be omitted)

options:
  -h, --help            show this help message and exit
  -s URL, --source URL  TMS server url (default is OpenStreetMap: https://tile.openstreetmap.org/{z}/{x}/{y}.png)
  -f LAT,LON, --from LAT,LON
                        one corner
  -t LAT,LON, --to LAT,LON
                        the other corner
  -e min_lon,min_lat,max_lon,max_lat, --extent min_lon,min_lat,max_lon,max_lat
                        extent in one string (use either -e, or -f and -t)
  -z ZOOM, --zoom ZOOM  zoom level
  -m MBTILES, --mbtiles MBTILES
                        save MBTiles file
  -g, --gui             show GUI

If no parameters are specified, it will open the GUI.

For example,

python3 tms2geotiff.py -s https://tile.openstreetmap.org/{z}/{x}/{y}.png -f 45.699,127 -t 30,148.492 -z 6 output.tiff

downloads a map of Japan.

If the coordinates are negative, use --from=-12.34,56.78 --to=-13.45,57.89

tmssplit

Split a large GeoTIFF image into tiles for a Tile Map Server.

Dependencies: GDAL, Pillow, numpy, scipy, pyproj

usage: tmssplit.py [-h] [-z ZOOM] [-n NAME] [-s SIZE] [-p PROJ] [-t THREADS]
                   inputfile outputdir

Split a big GeoTIFF image to TMS tiles.

positional arguments:
  inputfile             input GeoTIFF file
  outputdir             output directory

optional arguments:
  -h, --help            show this help message and exit
  -z ZOOM, --zoom ZOOM  zoom level(s), eg. 15 or 14-17
  -n NAME, --name NAME  image file name format, default {z}_{x}_{y}.png
  -s SIZE, --size SIZE  image size in px, default 256px
  -p PROJ, --proj PROJ  set projection id
  -t THREADS, --threads THREADS
                        set thread number

-z is required