Jawaban:
Tidak ada layanan atau alat yang tersedia yang dapat saya pikirkan. Tetapi jika Anda merasa nyaman di baris perintah dan mau menghabiskan waktu untuk bermain-main, berikut adalah cara yang bisa bekerja
Setelah Anda mendesainnya, eksporlah sebagai PNG bergeoreferensi .
nik2img.py <TileMill export name>.xml <desired file name>.png -d <pixel width> <pixel height> --srs <desired projection, probably 900913> --bbox <bounding box parameters> -v -w pgw
Gunakan gdal_translate untuk mengubahnya menjadi GeoTIFF.
gdal_translate -of GTiff -a_srs <desired projection, probably EPSG:3857, as above> <desired file name>.png <desired file name>.tiff
Saya juga tidak tahu alat. Jika Anda merasa tidak nyaman di baris perintah, saya akan mengunduh data dari OSM, memuat ke GIS desktop dan mengekspor GeoTiff ATAU menggunakan QGIS dengan plugin ini dan kemudian membuat Geotif kosong untuk area yang Anda minati dan kemudian lihat apakah Anda dapat menggabungkan data ke dalam file kosong. Saya belum mencobanya di QGIS, tetapi dengan beberapa pekerjaan itu harus mungkin. Anda akan ingin memeriksa persyaratan lisensi untuk OSM sebelum melakukan itu.
Saya berasumsi Anda memiliki stylesheet dasar dan hillshading yang relevan sudah disiapkan - jika tidak, lihat halaman github untuk stylesheet Anda (mis. Https://github.com/hotosm/HDM-CartoCSS )
#!/usr/bin/python
from datetime import datetime
from subprocess import call
import ConfigParser
import math
import dateutil.tz
roughLatRadius = 110574
roughLonRadius = 111111
description = 'Generated from OSM data - unknown date'
copyright = '(C) OpenStreetMap contributors, see http://www.openstreetmap.org/copyright'
def getDimensions(lon, lat, geosize, scale):
latDims = geosize * roughLatRadius / scale
lonDims = geosize * math.cos(math.radians(lat)) * roughLonRadius / scale
return str(int(math.ceil(lonDims))) + " " + str(int(math.ceil(latDims)))
def renderOneImage(lon, lat, geosize, scale):
dims = getDimensions(lon, lat, geosize, scale)
extent = str(lon) + " " + str(lat) + " " + str(lon + geosize) + " " + str(lat + geosize)
output_file = "osm_hot_" + extent.replace(" ", "_") + "_" + str(scale) + "m" + ".tif"
temp_file = "temp.png"
now = datetime.utcnow().replace(tzinfo=dateutil.tz.gettz('UTC')).isoformat()
print "Generating", output_file
call("nik2img.py --format=RGB24 --world-file=pgw --mapnik-version=1 --dimensions " + dims + " --srs=4326 --no-open --bbox " + extent + " osm_hot_style.xml " + temp_file, shell=True)
call('gdal_translate -a_srs EPSG:4326 -q -mo "TIFFTAG_ARTIST=WhoEver" -mo "TIFFTAG_IMAGEDESCRIPTION=' + description + '" -mo "TIFFTAG_COPYRIGHT=' + copyright + '" -mo "TIFFTAG_DOCUMENTNAME=OSM Humanitarian Style map - ' + str(scale) + 'm per pixel" -mo "TIFFTAG_DATETIME=' + now + '" ' + temp_file + " " + output_file, shell=True)
def makerange(start, end, step):
while start < end:
yield start
start += step
def renderImages(min_x, min_y, max_x, max_y, stepsize, scale):
for lon in makerange(min_x, max_x, stepsize):
for lat in makerange(min_y, max_y, stepsize):
renderOneImage(lon, lat, stepsize, scale)
if __name__ == '__main__':
config = ConfigParser.ConfigParser()
config.read('osm.cfg')
description = 'Generated from OSM data as of ' + config.get('Metadata', 'ExtractDate', 0)
copyright = config.get('Metadata', 'CopyrightStatement', 0)
for scale in ['100', '50', '20', '10', '5', '2', '1', '0.5']:
for entry in config.items(scale):
(entry_name, entry_value) = entry
(min_x, min_y, max_x, max_y, stepsize) = entry_value.split(',')
renderImages(float(min_x), float(min_y), float(max_x), float(max_y), float(stepsize), float(scale))
File konfigurasi ( osm.cfg
) terlihat seperti:
[Metadata]
ExtractDate: 2015-03-05T21:21:02Z
CopyrightStatement: (C) OpenStreetMap contributors, see http://www.openstreetmap.org/copyright
[100]
# around 2 degree steps are good at 100 metres
phillipines: 118, 4, 127, 20, 2
[50]
# around 1-2 degree steps are good at 50 metres
phillipines: 118, 4, 127, 20, 1
[20]
# around 0.5 to 1 degree steps are good at 20 metres
samar: 124, 11, 126, 13, 0.5
northwest: 120, 12.4, 124.5, 14.5, 0.5
northofmanila: 120, 14.5, 122.4, 19.6, 0.5
[10]
# roughly 0.4 degree steps are sane at 10 metres
[5]
# around 0.2 degree steps are good at 5 metres
[2]
# around 0.1 degree steps are good at 2 metres
guiuan: 125.5, 10.9, 125.8, 11.1, 0.1
tacloban: 124.8, 11.1, 125.1, 11.4, 0.1
legazpi: 123.5, 13.1, 123.8, 14.5, 0.1
manila: 120.8, 14.2, 121.2, 14.7, 0.1
subicbay: 120.1, 14.7, 120.4, 15.0, 0.1
[1]
# around 0.05 degree steps are good at 1 metre
[0.5]
# around 0.02 degree steps are good at 0.5 metres
tacloban: 124.8, 11.1, 125.1, 11.4, 0.02