voxcity.downloader.oemjยถ
Module for downloading and processing OpenEarthMap Japan (OEMJ) satellite imagery.
This module provides functionality to download, compose, crop and save satellite imagery tiles from OpenEarthMap Japan as georeferenced GeoTIFF files. It handles coordinate conversions between latitude/longitude and tile coordinates, downloads tiles within a polygon region, and saves the final image with proper geospatial metadata.
- Key Features:
Convert between geographic (lat/lon) and tile coordinates
Download satellite imagery tiles for a specified region
Compose multiple tiles into a single image
Crop images to a specified polygon boundary
Save results as georeferenced GeoTIFF files
- Example Usage:
polygon = [(139.7, 35.6), (139.8, 35.6), (139.8, 35.7), (139.7, 35.7)] # Tokyo area save_oemj_as_geotiff(polygon, โtokyo_satellite.tiffโ, zoom=16)
Functionsยถ
|
Download and save OpenEarthMap Japan imagery as a georeferenced GeoTIFF file. |
Module Contentsยถ
- voxcity.downloader.oemj.save_oemj_as_geotiff(polygon, filepath, zoom=16, *, ssl_verify=True, allow_insecure_ssl=False, allow_http_fallback=False, timeout_s=30)ยถ
Download and save OpenEarthMap Japan imagery as a georeferenced GeoTIFF file.
This is the main function that orchestrates the entire process of downloading, processing, and saving satellite imagery for a specified region.
- Parameters:
polygon (list) โ List of (lon, lat) coordinates defining the region to download. Must be in clockwise or counterclockwise order.
filepath (str) โ Output path for the GeoTIFF file
zoom (int, optional) โ Zoom level for detail. Defaults to 16. - 14: ~9.5m/pixel - 15: ~4.8m/pixel - 16: ~2.4m/pixel - 17: ~1.2m/pixel - 18: ~0.6m/pixel
Example
>>> polygon = [ (139.7, 35.6), # Bottom-left (139.8, 35.6), # Bottom-right (139.8, 35.7), # Top-right (139.7, 35.7) # Top-left ] >>> save_oemj_as_geotiff(polygon, "tokyo_area.tiff", zoom=16)
Note
Higher zoom levels provide better resolution but require more storage
The polygon should be relatively small to avoid memory issues
The output GeoTIFF will be in Web Mercator projection (EPSG:3857)