Skip to content

Latest commit

 

History

History
77 lines (51 loc) · 2.81 KB

quick_start.md

File metadata and controls

77 lines (51 loc) · 2.81 KB

Quick start guide

In this quick start guide you will set up synchronization between your PostGIS database and new Mergin Maps project.

Prerequisites

  • PostGIS database - details for DB setup
  • Docker engine

If you are on Windows and do not have Docker installed, you can consider installing it in Windows Subsystem for Linux.

1. Add data to DB

Create a new schema (sync_data) in your postgis database (here dbsync) with few points. You can simply use this file and run:

$ psql -h localhost -d dbsync -U postgres -f sample_data/test_data.sql

2. Create an empty Mergin Maps project

Go to Mergin Maps website and create a new blank project (and call it e.g. db-sync):

new_project

Once the project page opens, you should see there are not any files there:

new_project_2

and your full project name for later will be <workspace>/<project-name>, e.g. john/db-sync

3. Start syncing

Prepare config.yaml configuration file, and replace <username>, <password> and <workspace> with the real values (and also update database connection's username/password):

mergin:
  url: https://app.merginmaps.com
  username: <username>
  password: <password>
init_from: db
connections:
   - driver: postgres
     conn_info: "host=localhost dbname=dbsync user=postgres password=mysecretpassword"
     modified: sync_data
     base: sync_data_base
     mergin_project: <workspace>/db-sync
     sync_file: sync_db.gpkg
daemon:
  sleep_time: 10

Run this Docker command (see installation guide for alternative options how to run db-sync):

docker run --network host -it -v ${PWD}:/settings lutraconsulting/mergin-db-sync /settings/config.yaml

and you should see a new GeoPackage file in your Mergin Maps project.

new_project_3

4. Set up QGIS project

To be able to use the synchronized GeoPackage as a survey layer:

The QGIS and GeoPackage files will be a valid Mergin Maps project ready for surveying. Read more about QGIS project configuration on Mergin Maps and Mergin Maps Input documentations.

In order to stop syncing simply stop docker container.