This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Splits rasters into chunks and creates contours""" | |
| import os | |
| import argparse | |
| import uuid | |
| import re | |
| from osgeo import gdal | |
| def chunk(): | |
| """Splits rasters into 5000 x 5000 chunks.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """Deal with raster transparency and convert to MBTiles""" | |
| import os | |
| import re | |
| from string import Template | |
| from shutil import copyfile | |
| from osgeo import gdal | |
| import rasterio | |
| PATH = 'data/geotiff/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| import mercantile | |
| import urllib | |
| import time | |
| import os | |
| def download_tile(tileurl, tile, output_dir, pause=1): | |
| url = tileurl + '/{z}/{x}/{y}.png'.format(**tile.__dict__) | |
| local_path = url.replace(tileurl, output_dir) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mercantile | |
| import requests | |
| import settings | |
| def getStyle(): | |
| r = requests.get('https://api.mapbox.com/styles/v1/axismaps/' + settings.MAPBOX_STYLE + '?access_token=' + settings.MAPBOX_TOKEN) | |
| return r.json()['modified'] | |
| def download_tile(tileurl, tile, modified): | |
| url = tileurl + '/{z}/{x}/{y}.mvt'.format(**tile.__dict__) |
OlderNewer