### Running OpenPOIService Application with Flask-Werkzeug (Default Port) - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Starts the OpenPOIService application using Flask-Werkzeug, making it accessible at `http://localhost:5000/` by default. This command is for local development and testing. It requires a configured database and imported data to function correctly. ```sh python manage.py run ``` -------------------------------- ### Creating OpenPOIService Database via Docker Exec - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Executes the `create-db` command inside the running OpenPOIService container to initialize an empty database. This command assumes the container is already running and provides an interactive terminal for execution. It's a post-deployment step for database setup. ```sh docker exec -it container_name /ops_venv/bin/python manage.py create-db ``` -------------------------------- ### Setting OpenPOIService Application Configuration - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Sets the `APP_SETTINGS` environment variable to specify the configuration class for the OpenPOIService application. This allows switching between production and development settings, influencing database connections, logging, and other behaviors. This must be run before starting the application. ```sh export APP_SETTINGS="openpoiservice.server.config.ProductionConfig|DevelopmentConfig" ``` -------------------------------- ### Creating OpenPOIService Database (Local) - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Executes the `create-db` command using the `manage.py` script to initialize an empty POI database locally. This command is used when running OpenPOIService directly without Docker. It requires a Python environment with OpenPOIService dependencies installed. ```sh python manage.py create-db ``` -------------------------------- ### Running Openpoiservice with Docker Compose Source: https://github.com/giscience/openpoiservice/blob/main/README.md This shell command is used to start the Openpoiservice API container using Docker Compose. It specifies the path to the `docker-compose.yml` file and runs the 'api' service in detached mode (`-d`), allowing it to run in the background. ```Shell docker-compose -f /path/to/docker-compose.yml up api -d ``` -------------------------------- ### Initializing POI Database with Docker Compose Service - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Initializes the POI database by bringing up the `init` service defined in the main Docker Compose file. This command is part of the integrated Docker setup for OpenPOIService, automating the database creation process. It's an alternative to manual `create-db` execution. ```sh docker-compose -f /path/to/docker-compose.yml up init ``` -------------------------------- ### Example OpenPOIService Category Configuration - YAML Source: https://github.com/giscience/openpoiservice/blob/main/README.md Illustrates the structure of `categories.yml`, which maps OpenStreetMap tags to custom category IDs used by OpenPOIService. This YAML configuration defines hierarchical categories and their unique identifiers. It's essential for how POIs are categorized and queried within the system. ```yaml transport: id: 580 children: aeroway: aerodrome: 581 aeroport: 582 helipad: 598 heliport: 599 amenity: bicycle_parking: 583 sustenance: id: 560 children: amenity: bar: 561 bbq: 562 ... ``` -------------------------------- ### Running OpenPOIService Application with Flask-Werkzeug (Custom Port) - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Starts the OpenPOIService application using Flask-Werkzeug, binding it to all network interfaces (`0.0.0.0`) and a custom port (`8080`). This allows access from other machines on the network. It's useful for testing in a networked environment or when port 5000 is occupied. ```sh python manage.py run -h 0.0.0.0 -p 8080 ``` -------------------------------- ### Example OpenPOIService Column Mappings Configuration - YAML Source: https://github.com/giscience/openpoiservice/blob/main/README.md Demonstrates a section of `ops_settings.yml` controlling which OpenStreetMap tags are imported into the database and made queryable via the API. This YAML configuration allows specifying additional OSM tags like 'wheelchair', 'smoking', and 'fees' for inclusion. It dictates the data available for filtering and retrieval. ```yaml wheelchair: smoking: fees: ``` -------------------------------- ### Deploying OpenPOIService API Container (Standalone) - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md This command deploys only the `api` service of OpenPOIService using a standalone Docker Compose file. It runs the service in detached mode, requiring manual database management and connection. This setup is suitable for environments where the database is managed externally. ```sh docker-compose -f /path/to/docker-compose-standalone.yml up api -d ``` -------------------------------- ### Dropping OpenPOIService Database (Local) - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Executes the `drop-db` command using the `manage.py` script to delete the local POI database. This action is irreversible and should be performed with caution, typically for development or cleanup purposes. It requires a local Python environment setup. ```sh python manage.py drop-db ``` -------------------------------- ### Exposing PostgreSQL Port in Docker Compose Source: https://github.com/giscience/openpoiservice/blob/main/README.md This configuration snippet demonstrates how to expose the PostgreSQL database port (5432) from within the Docker container to a specified host port. This is necessary if you wish to access the database from outside the container, as it is not exposed by default in the all-in-one Docker Compose setup. Remember to replace '' with your desired host port. ```YAML ports: - :5432 ``` -------------------------------- ### Running OpenPOIService Tests - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Sets the `TESTING` environment variable to `True` and then executes the test suite for OpenPOIService using `manage.py`. This command runs all defined unit and integration tests to verify application functionality. It's crucial for development and quality assurance. ```sh export TESTING="True" && python manage.py test ``` -------------------------------- ### Importing OSM Data into OpenPOIService DB via Docker Exec - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Executes the `import-data` command within the OpenPOIService container to import OpenStreetMap (OSM) data into the database. This process populates the POI database with geographical information. It requires a pre-existing database and OSM PBF files to be accessible by the container. ```sh docker exec -it container_name /ops_venv/bin/python manage.py import-data ``` -------------------------------- ### Importing OSM Data into OpenPOIService DB (Local) - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Executes the `import-data` command via `manage.py` to parse and import OpenStreetMap data into the local POI database. This populates the database with POI information from PBF files. It depends on `imposm.parser` and requires OSM data files to be accessible. ```sh python manage.py import-data ``` -------------------------------- ### Dropping OpenPOIService Database via Docker Exec - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Executes the `drop-db` command inside the running OpenPOIService container to delete the existing database. This command is irreversible and should be used with caution, typically for cleanup or reinitialization purposes. It requires the container to be active. ```sh docker exec -it container_name /ops_venv/bin/python manage.py drop-db ``` -------------------------------- ### Querying POIs around a Buffered Point (sh) Source: https://github.com/giscience/openpoiservice/blob/main/README.md This `curl` command queries the OpenPOIService for Points of Interest (POIs) within a specified bounding box and buffered point. It uses a `POST` request to the `/pois` endpoint, defining the geometry with a `bbox`, a `geojson` point, and a `buffer` distance in meters. The `request` type is 'pois'. ```sh curl -X POST \ http://localhost:5000/pois \ -H 'Content-Type: application/json' \ -d '{ "request": "pois", "geometry": { "bbox": [ [8.8034, 53.0756], [8.7834, 53.0456] ], "geojson": { "type": "Point", "coordinates": [8.8034, 53.0756] }, "buffer": 250 } }' ``` -------------------------------- ### Listing All POI Categories (sh) Source: https://github.com/giscience/openpoiservice/blob/main/README.md This `curl` command retrieves a comprehensive list of all available POI categories. It sends a `POST` request to the `/pois` endpoint with the `request` type set to 'list'. No geometry or filter parameters are required for this type of request. ```sh curl -X POST \ http://127.0.0.1:5000/pois \ -H 'content-type: application/json' \ -d '{ "request": "list" }' ``` -------------------------------- ### Querying POIs by Category Groups (sh) Source: https://github.com/giscience/openpoiservice/blob/main/README.md This `curl` command fetches POIs filtered by a list of `category_group_ids`. It performs a `POST` request to the `/pois` endpoint, providing geometry details (bbox, geojson, buffer) and a `limit`. The `filters` object is used to specify the `category_group_ids` for the query. ```sh curl -X POST \ http://localhost:5000/pois \ -H 'Content-Type: application/json' \ -d '{ "request": "pois", "geometry": { "bbox": [ [8.8034, 53.0756], [8.7834, 53.0456] ], "geojson": { "type": "Point", "coordinates": [8.8034, 53.0756] }, "buffer": 100 }, "limit": 200, "filters": { "category_group_ids": [160] } }' ``` -------------------------------- ### Querying POIs by Specific Categories (sh) Source: https://github.com/giscience/openpoiservice/blob/main/README.md This `curl` command retrieves POIs filtered by a list of specific `category_ids`. It sends a `POST` request to the `/pois` endpoint, including geometry parameters (bbox, geojson, buffer) and a `limit` for the number of results. The `filters` object specifies the desired `category_ids`. ```sh curl -X POST \ http://localhost:5000/pois \ -H 'Content-Type: application/json' \ -d '{ "request": "pois", "geometry": { "bbox": [ [8.8034, 53.0756], [8.7834, 53.0456] ], "geojson": { "type": "Point", "coordinates": [8.8034, 53.0756] }, "buffer": 100 }, "limit": 200, "filters": { "category_ids": [180, 245] } }' ``` -------------------------------- ### Updating POI Database with Docker Compose Service - Shell Source: https://github.com/giscience/openpoiservice/blob/main/README.md Updates the POI database by bringing up the `update` service defined in the main Docker Compose file. This command is used for refreshing or synchronizing the database with new data or schema changes. It's part of the integrated Docker management for OpenPOIService. ```sh docker-compose -f /path/to/docker-compose.yml up update ``` -------------------------------- ### Retrieving POI Statistics (sh) Source: https://github.com/giscience/openpoiservice/blob/main/README.md This `curl` command requests statistical information about POIs within a defined geographical area. It sends a `POST` request to the `/pois` endpoint with the `request` type set to 'stats'. The geometry is specified using a `bbox`, `geojson` point, and `buffer`. ```sh curl -X POST \ http://129.206.7.157:5005/pois \ -H 'Content-Type: application/json' \ -d '{ "request": "stats", "geometry": { "bbox": [ [8.8034, 53.0756], [8.7834, 53.0456] ], "geojson": { "type": "Point", "coordinates": [8.8034, 53.0756] }, "buffer": 100 } }' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.