added bootstrap buildings
This commit is contained in:
@@ -38,6 +38,30 @@ docker compose restart api worker
|
||||
The API samples all `.tif`/`.tiff` files under `DEM_PATH` recursively. In Docker,
|
||||
the default `DEM_PATH=/data/dem` points to the mounted `./data/dem` directory.
|
||||
|
||||
## Buildings Bootstrap
|
||||
|
||||
Download an OSM PBF extract and import building polygons into PostGIS:
|
||||
|
||||
```bash
|
||||
mkdir -p data/osm
|
||||
wget -O data/osm/northwestern-fed-district-latest.osm.pbf \
|
||||
https://download.geofabrik.de/russia/northwestern-fed-district-latest.osm.pbf
|
||||
sh scripts/load_buildings.sh data/osm/northwestern-fed-district-latest.osm.pbf
|
||||
docker compose restart api worker
|
||||
```
|
||||
|
||||
The import writes a `buildings` table with `geom`, `height_m`, `levels`,
|
||||
`building_type`, and `source`. Heights come from `height`, then
|
||||
`building:levels * 3.0`, then an estimated default by building type.
|
||||
|
||||
Check the API:
|
||||
|
||||
```bash
|
||||
curl -s -X POST http://localhost:8000/api/v1/buildings/query \
|
||||
-H 'Content-Type: application/json' \
|
||||
-d '{"bbox":[30.30,59.93,30.33,59.95]}' | jq '.features | length'
|
||||
```
|
||||
|
||||
For local Python development:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user