Generic implementation of OGC API with Node.js, Express and PostgreSQL
Run cp env.sample .env
and adapt the content of the .env
file to your environment.
It must at least have the following environment variables:
DB_NAME='<db_name>'
DB_HOST='<host_name>'
DB_PORT=<port_number>
DB_USER='<user_name>'
DB_PASSWORD='<user_password>'
APP_HOST_PORT=<application_port_on_the_host>
Create a config.yml
file with the informations you want to display for each collection. You can take example on config.example.yml
.
Install the dependencies running the following command:
npm ci
Start the server running the following command:
node index.js
Note: For development purposes, you can use nodemon
to automatically restart the server when a file is changed. To do so, run the following command:
nodemon index.js
If you want to have geopose information, add the entries is_azimuth
(in case you have an azimuth instead of a yaw, the boolean must be true
. In this case, we convert your azimuth to yaw), yaw_field
, roll_field
and pitch_field
to your configuration file, as in the following example:
providers:
- type: feature
name: PostgreSQL
data:
schema: public
id_field: id
table: images
geom_field: location
is_azimuth: true
yaw_field: azimuth
roll_field: roll
pitch_field: tilt