Prepare your data#

The [GeoPackage] is the central format. We recommend working on a blank copy of your data, containing only the structure of your tables. This allows you to insert your field data, archive the data by plans and then insert them in your production database.

How to prepare your data#

Below you will find some use cases and tips to take full advantage of the plugin. These tips are to be adapted to your work process.

Note

The following sections are not intended to replace the QGIS manual and GIS training. They are only meant to give you some hints to assist you in the preparation of the data for this plugin. It is up to you to adapt them to your working environment.

As a preamble, we would like to remind you why we don’t use PostgreSQL/PostGIS data directly. This information comes from user experience and discussions between users and developers.

  • The integration of topographic points can sometimes cause shifts, corrections to be made, etc. It is not preferable to integrate these directly into the production database.

  • We want to keep a temporary drawing file for the monitoring of the projects. This is how the notion of archiving comes into play, as you will see in the next step.

  • The data entered in the field is often “raw” and will go through an automatic enrichment cycle (which the plugin does in part) or manually. These steps can be chained in QGIS.

  • Similarly, some structures will control the drawing file produced by the field operator and provide it to another entity for integration into the database.

  • The GPKG as a flat file, also allows the division between actors/trades as in the demonstration: a file per trade. This allows greater flexibility in the field process.

  • Some structures go through “temporary” schemes for the integration

  • There is a difference in scheme (simplification?) between the data to be collected in the field and those in the database

  • You may not have a PostgreSQL database

The plugin follows the logic of other business tools where a template (the empty GPKG) will be used to receive the field data. Once the new GPKG is created, it can be integrated into the overall plan. We find the same logic as the realization of a DWG in CAD and integration into the DWG overall plan (or in postgis).

Once the data is acquired and processed with the plugin, you get an archive of these drawings that you can put back into your database.

Your GIS is composed of Shapefile?#

QGIS allows you to convert your files into different formats including [GeoPackage]. Several means can be used to achieve this.

To do this, you can:

  • save the files using the “Export->Save entities as” menu

  • use the QConsolidate plugin which allows you to export each file present in the project in a different GeoPackage and creates a new QGIS project containing these new layers

  • use the conversion command ogr2ogr. This one is present in the QGIS processing tool and has the advantage to being able to specify conversion options. This is the method we recommend.

Use of ogr2ogr via QGIS#

  • Open the tool Format Conversion in the processing toolbox.

  • select your Shapefiles as input and specify your [GeoPackage] as output.

Notice on the screenshot below, that an extra column is present. It has been displayed using the job wheel. It allows you to define an option, here ‘-append’. This option will allow you to add several tables in one and the same [GeoPackage], as it is the case in our demonstration.

To empty the tables and have only the empty data, which is what we recommend, for later use of the archive, you can add the ‘-limit 0’ option

Note

For more information we let you refer to the ogr2ogr manual.

ogr2ogr

Your files are converted into [GeoPackage], you can import them into a new QGIS project and perform the step of creating your codification.

Your GIS is composed of GeoPackage files?#

You can either proceed as for the conversion of Shapefiles by using the format conversion tool, or you can copy your [GeoPackage] to a directory and then use the tool empty tables.

Is your GIS in a PostgreSQL database?#

As for [GeoPackage] or [Shapefile] you can use the format conversion tool.

There are also other plugins for converting PostgreSQL to [GeoPackage]. Our recommendation is the plugin ExportDBMapper that we have developed for the occasion.

Unlike other plugins, this one has the particularity of being able to be fully integrated into a QGIS processing chain. This plugin is in a way a fusion of the best of QConsolidate and ogr2ogr.

Note

The project documentation is available at this page.

Export step#

You define the export of your PSQL data in GPKG and you obtain a YAML file which will be useful to you to carry out this conversion with the possibility in addition of having a QGIS project file.

You can open the QGIS project and create your codification as described in the next step.

Import step#

For those who wish to automatically reload the data processed by LSCI into a PostgreSQL database, all you have to do is create the YAML configuration file for the export phase.

You will find on our repository a script example allowing to realize this kind of processing. This one is to be adapted to your environment.

Note

LandSurveyCodesImport is a generic “brick” that integrates fully into the QGIS processing chain. You are free to configure the post- and pre-processing for the automation of your topographic data integration. If you wish to benefit from an assistance or a training on these subjects, contact us.