-
Notifications
You must be signed in to change notification settings - Fork 3
H2D
It is a two step process:
- Import the external geometries into a postgis table
- Import this table into the OHDM database.
Step 1 requires format specific database tools. Step 2 is done by our OHDMConverter.
Use shp2pgsql for this task. It produces statement which can be processed by psql.
Assumed there is a shapefile called historicGeometries an import could look like this
shp2pgsql -s 4326 historicGeometries.dbf importSchema.historicGeometries > importCommands.sql
The spatial reference system should be set (in this case 4326). If not set, 4326 will be assumed. Geomtries will stored in table historicGeometries in schema importSchema Now, the commands must be executed with psql, e.g.
psql -d your_OHDM_DB -U your_user_name -f importCommands.sql
The geometries are in the database now. In the next and final step, they are to be imported into the OHDM DB.
Set up your historic parameter file.
servername:db_host_name
portnumber:port_number
username:user_name_on_db
pwd:your_password
dbname:ohdm
schema:importhistoric
columnNameObjectName: [enter column name that contains geoobject name]
columnNameGeometry: [enter column name that contains objects' geometry]
tableName: [enter table name]
validSince: [data are valid since: format yyyy-mm-dd]
validUntil: [data are valid until: format yyyy-mm-dd]
classificationID: [enter classification id, can be found in table classification, e.g. 13 - borders]
The first few lines describe database access as usual. There are more details to describe, though. Imported data usually contain more than just geometries. Very often, data even contain more geometries for a object, e.g. borders of a country but also its capital. Each import process will only import one geometry. Nevertheless, the import can be repeated with another geometry column.
We work on a graphical tool that helps to edit those configuration files.
Run the import with a command line similar to this:
java -classpath <your-jdbc-driver.jar> -jar OHDMConverter.jar -h historic_import_parameter -d ohdm_parameter