Project

General

Profile

Feature #1047

Import geometries

Added by Stefan Eichert over 3 years ago. Updated 2 months ago.

Status:
Acknowledged
Priority:
Normal
Assignee:
-
Category:
Data import/export
Target version:
Start date:
2019-07-31
Estimated time:

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


Related issues

Related to OpenAtlas - Feature #1567: Enhanced ImportAcknowledged2021-08-25Actions

History

#1

Updated by Alexander Watzinger over 3 years ago

  • Target version set to 187
#2

Updated by Alexander Watzinger over 3 years ago

  • Status changed from New to Acknowledged
#3

Updated by Alexander Watzinger over 3 years ago

  • Target version changed from 187 to 193
#4

Updated by Alexander Watzinger over 3 years 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.

#5

Updated by Alexander Watzinger about 3 years ago

  • Target version changed from 4.1.0 to 5.0.0
#6

Updated by Alexander Watzinger about 3 years ago

  • Category set to Backend
  • Target version changed from 5.0.0 to 5.2.0
#7

Updated by Alexander Watzinger about 3 years ago

  • Target version changed from 5.2.0 to Wishlist
#8

Updated by Bernhard Koschiček-Krombholz over 2 years ago

  • Description updated (diff)
#9

Updated by Bernhard Koschiček-Krombholz about 2 years ago

  • Subject changed from Import geometries to API: Import geometries
  • Category changed from Backend to API
  • Target version changed from Wishlist to 208

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?

#10

Updated by Bernhard Koschiček-Krombholz about 2 years ago

  • Category changed from API to Data import/export
#11

Updated by Bernhard Koschiček-Krombholz about 2 years ago

  • Assignee set to Bernhard Koschiček-Krombholz
#12

Updated by Alexander Watzinger about 2 years 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.

#13

Updated by Bernhard Koschiček-Krombholz about 2 years ago

I wrote already a script that does:
  • 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.

#14

Updated by Alexander Watzinger over 1 year ago

  • Status changed from Acknowledged to Assigned
#15

Updated by Bernhard Koschiček-Krombholz over 1 year ago

#16

Updated by Bernhard Koschiček-Krombholz 6 months ago

  • Target version changed from 208 to Wishlist
#17

Updated by Alexander Watzinger 6 months ago

  • Status changed from Assigned to Acknowledged
  • Assignee deleted (Bernhard Koschiček-Krombholz)

Removing assignees from wishlist issues, just in case anyone else wants to work on it.

#18

Updated by Alexander Watzinger 5 months ago

  • Subject changed from API: Import geometries to Import geometries
  • Description updated (diff)

Looking into it with Bernhard just now. Removing API because implementation maybe solved another way.

#20

Updated by Stefan Eichert 2 months ago

If we consider a shapefile import, this would probably need its own user interface in order to select which feature of the shapefile is considered to be imported.
A shapefile can contain multiple geometries/features like a "geom" table in PostGIS. So we would have to read the shapefile and let the user select from a list or table with a geometry preview which feature should be imported and linked to the respective entity. Also the Coordinate Reference System needs to be transformed to WGS84. Therefore the shapefile must contain the respective information or the user has to provide it.
I think also some kind of bulk import would be a good idea. Given the example of a cemetery plot, one could enter all the graves first and then load the shapefile of the graves. In the next step the OpenAtlas features could be correlated with the ones from the shapefile. This would really accelerate the data acquisition with already existing digital geometries e.g. in shapefile format.
Technically this could also be done with shp2pgsql in PostGIS: https://gis.stackexchange.com/questions/39238/how-to-import-using-shp2pgsql

Also available in: Atom PDF