~qeef/click-building

Click building (backend) allows to store GeoJSON FeatureCollection in PostGIS database and query the nearest feature over FastAPI.
Fix api to return polygon
Add gitignore
Merge branch 'feature/api'

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~qeef/click-building
read/write
git@git.sr.ht:~qeef/click-building

You can also use your local clone with git send-email.

#Click building (backend)

Click building (backend) allows to store GeoJSON FeatureCollection in PostGIS database and query the nearest feature over FastAPI.

The usecase is to store buildings footprints and return the closest building per request containing coordinates.

The project is published under MIT License.

#Contribute

Use OneFlow branching model and keep the changelog.

Write great git commit messages:

  1. Separate subject from body with a blank line.
  2. Limit the subject line to 50 characters.
  3. Capitalize the subject line.
  4. Do not end the subject line with a period.
  5. Use the imperative mood in the subject line.
  6. Wrap the body at 72 characters.
  7. Use the body to explain what and why vs. how.

#Develop

You need running database for development:

cd deploy
docker-compose up db
export DB_HOST=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' cbdb)

Then, you are able to connect to the database with:

psql -d cbdb -U cbuser -h $DB_HOST

with password pass.

#Store feature collection

When you export DB_HOST, you may store feature collection stored in file.geojson with:

PYTHONPATH=. python3 click_building/store.py /path/to/test.geojson

#Run JSON API

When you export DB_HOST variable, you may run the JSON API with:

uvicorn click_building.api:app --reload