OpenComptage is a QGIS plugin to manage Canton Neuchâtel’s Comptages
The purposes of the QGIS plugin are:
- plan the future traffic measure
- prepare the current traffic measure
- import and management of the measure data
- centralized management of the measure data
Clone this repository with the submodules
git clone --recurse-submodules git@github.com:opengisch/OpenComptage.git
Go into the scripts
directory of the repository
cd OpenComptage/scripts
Run the docker with the development database
./start_docker.sh
Create the database structure (needed to be done only the fist time)
./create_db.sh
Link the plugin directory (comptages
directory inside the repository) to the
QGIS plugin directory. E.g.:
ln -s /home/mario/OpenComptage/comptages /home/mario/.local/share/QGIS/QGIS3/profiles/default/python/plugins
Run QGIS and enable the plugin from the plugin-manager
To completely reset the docker with all the data
cd .docker
docker-compose -f docker-compose_dev_env.yml down --volume
Requirements: PostgreSQL, ogr2ogr, psycopg2, GDAL_DATA on path (the one provided with mapserver is fine). Clone this repository with the submodules, fetch all tags and checkout to a <TAG_NAME> of your choice
git clone --recurse-submodules https://github.com/opengisch/OpenComptage.git
cd OpenComptage
git fetch --all --tags --prune
git checkout tags/<TAG_NAME> -b <TAG_NAME>
Create a database and a user with CREATE rights on it. Create a pg_service.conf file in your %USERPROFILE% directory.
Go into the scripts\windows
directory of the repository
cd .\scripts\windows
Adapt create_db.ps1
with the name of your pg_service.
Create the database structure (need to be done when model is modified, data will be reset):
.\create_db.ps1
Deploy to your custom repository
.\deploy.ps1
On the client machine, make sure you have a QGIS installed with its own pip (use OSGEO4W installer). Then, use the QGIS pip to install the additional python packages (replace OSGEO4W install directory if necessary):
$env:PATH = "C:\OSGeo4W64\apps\Python37;C:\OSGeo4W64\apps\Python37\Scripts"
python -m pip install setuptools icalendar openpyxl
The data model has been created to easily allow to add functionality to the product e.g. adding new vehicle classes and to be as simple as possible and easily usable into QGIS. It is flexible enough to support natively all the current special cases without write special management code.
The data model is created with pgmodeler
and is exported into an sql script
used by create_db.sh
script. To create a new sql from the pgmodeler’s model,
run the script create_data_model_sql_script.sh
.
English name | French name |
---|---|
damage_log | journal_panne |
device | automate |
model | model |
brand | marque |
sensor_type | type_capteur |
classe | classification |
category | categorie |
count | comptage |
installation | installation |
lane | voie |
section | troncon |
count_detail | comptage_detail |
special_period | periode_speciale |