osmosis \
--read-pbf-fast ~/Desktop/planet-190909.osm.pbf \
--log-progress \
--buffer \
--tag-filter accept-ways highway=* \
--tag-filter reject-ways highway=cycleway,motor,proposed,construction,abandoned,platform,raceway \
--tag-filter reject-ways area=yes \
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 utm | |
from shapely.geometry import Point | |
def bbox_from_point(point, meters): | |
easting, northing, zn, zl = utm.from_latlon(point.y, point.x) | |
point = Point(easting, northing) | |
bounds = point.buffer(meters).bounds | |
minx, miny, maxx, maxy = bounds | |
result = [] | |
for e, n in ((minx, miny), (maxx, maxy)): |
This file contains 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
package main | |
import ( | |
"fmt" | |
"github.com/lukeroth/gdal" | |
"github.com/paulmach/orb" | |
"github.com/paulmach/orb/project" | |
) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 contextlib import contextmanager | |
import os | |
import subprocess | |
import tempfile | |
@contextmanager | |
def maybe_download_remote(url_or_path, **kwargs): | |
""" | |
Adapted from: https://git.io/fxMdS |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
ogr2ogr -nlt PROMOTE_TO_MULTI \
-t_srs 'EPSG:4326' \
-overwrite \
-lco SCHEMA=public \
-lco PRECISION=NO \
--config PG_USE_COPY YES \
-f PostgreSQL PG:$(heroku config:get DATABASE_URL -a myapp) \
~/Downloads/natural_earth_vector.gpkg/packages/natural_earth_vector.gpkg