Feature #1047
API: Import geometries
Description
In many cases geometries for places, features and stratigraphic units already exist as research data from various sources and could be used for the data input.
So far I imported them directly in the PostgreSQL PostGIS using sql commands.
It would be very very helpful to have the possibility to import them already in the edit view of our physical things.
Therefore I suggest to start with WKT and then extend this to .shp files in the future.
WKT could be achieved by inserting the string as text and creating the polygon then via PostGIS geometry from WKT
shp: https://gis.stackexchange.com/questions/41799/adding-shapefiles-to-postgis-database
+1 Berni
History
Updated by Alexander Watzinger over 1 year ago
- Target version changed from 193 to 4.1.0
Moving this feature to 4.1.0 because we will release the major version 4.0.0 first and than see if this can be implemented with the new API.
Updated by Alexander Watzinger about 1 year ago
- Category set to Backend
- Target version changed from 5.0.0 to 5.2.0
Updated by Bernhard Koschicek about 2 months ago
- Target version changed from Wishlist to API
- Category changed from Backend to API
- Subject changed from Import geometries to API: Import geometries
Browsing through old issues, and found that. I will move this to the API section.
I will start with geojson, because they don't need extra packages, are human-readable, easy to manipulate and QGIS and ArcGIS can easily convert .shp files to geojson.
This has to be a cooperative with the UI, since Stefan wants it in the edit view.
In a first version, it should be possible to upload a geojson with several geometries (no Multi Geometries and no Z value) with a name field, which creates a new entry for each geometry.
Early additional features will be:- link to existing Place entity through id field
- link to types through id if geojson import creates a new entity
- create one entity with n geometries
Question to Stefan
WKT could be achieved by inserting the string as text and creating the polygon then via PostGIS geometry from WKT
This can actually be done in the SQL interface provided under /sql or? Can you send me an example from you of such a string?
Updated by Bernhard Koschicek about 2 months ago
- Category changed from API to Data import/export
Updated by Alexander Watzinger about 2 months ago
Just wanted to add it would be very useful to add many geometries in one go just in case this wasn't meant implicit already. What I mean is not just many geometries for one entry but also for multiple entities.
But first we should implement adding entities themselves.
Updated by Bernhard Koschicek about 2 months ago
- link to existing Place entity through id field
- link to types through id if geojson import creates a new entity
- create one entity with n geometries
with any amount of geometries coming from a geojson. Of course, it does only basic forms of data validation, but if the input data is fine, it works like a charm.
I will try to write specifications of such an import function until the meeting 28.01.21, so we can discuss this. The main format of data import will be json. Later we can add something like csv, excel and xml, because they are quite easy to convert to json.