keeps/dbptk-developer

Problem with exporting GIS data with datatype geometry from SQL Server Express 19

mindw0rks opened this issue · 1 comments

Problem with exporting GIS data with datatype geometry from SQL Server Express 19 using Desktop version as well as Developer version. Desktop version produces SIARD with null values in geometry type cells, and Developer version doesn't even produce SIARD file.

Steps required to reproduce the bug:

  1. java -jar "-Dfile.encoding=UTF-8" dbptk-app-2.9.7.jar migrate --import microsoft-sql-server --import-server-name=localhost --import-database="GeoDB" --import-username=sa --import-password="password" --import-disable-encryption --export siard-2 --export-file=geodb.siard --export-gml-directory="C:\Users\User\Desktop\Siard"
  2. Error in a log file:
    2022-03-15 00:45:57,318 [main] DEBUG (c.d.m.j.i.JDBCImportModule) query: SELECT [ID], [Name], [BoundaryType], [geom] FROM [dbo].[ParkBoundaries]
    2022-03-15 00:45:57,332 [main] DEBUG (c.d.m.r.Reporter) cellProcessingUsedNull, message: - Problem processing cell value and NULL was used instead, in table ParkBoundaries, in column geom, in the 1st row
    com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from udt to BLOB is unsupported.
    at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:190)
    at com.microsoft.sqlserver.jdbc.DataTypes.throwConversionError(DataTypes.java:1117)
    at com.microsoft.sqlserver.jdbc.ServerDTVImpl.getValue(dtv.java:2481)
    at com.microsoft.sqlserver.jdbc.DTV.getValue(dtv.java:193)
    at com.microsoft.sqlserver.jdbc.Column.getValue(Column.java:132)
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2082)
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getValue(SQLServerResultSet.java:2067)
    at com.microsoft.sqlserver.jdbc.SQLServerResultSet.getBlob(SQLServerResultSet.java:2580)
    at com.databasepreservation.modules.jdbc.in.JDBCImportModule.rawToCellSimpleTypeBinary(JDBCImportModule.java:1957)
    at com.databasepreservation.modules.jdbc.in.JDBCImportModule.convertRawToCell(JDBCImportModule.java:1738)
    at com.databasepreservation.modules.jdbc.in.JDBCImportModule.convertRawToRow(JDBCImportModule.java:1686)
    at com.databasepreservation.modules.jdbc.in.JDBCImportModule.migrateDatabaseTo(JDBCImportModule.java:2140)
    at com.databasepreservation.DatabaseMigration.migrate(DatabaseMigration.java:123)
    at com.databasepreservation.Main.runMigration(Main.java:294)
    at com.databasepreservation.Main.internalMain(Main.java:125)
    at com.databasepreservation.Main.main(Main.java:81)

dbptk-app.log.txt
dbptk-report-20220315014140001.txt

Currently, DBPTK only supports exporting GIS data from Oracle, and only when it uses SDO_Geometry, and it does so by (also) producing a GML file in the result.
https://github.com/keeps/dbptk-developer/wiki/Application-usage#available-export-modules-for-the-export-module-options-part

Export module "siard-2":
-egml,   --export-gml-directory=value                (optional) directory in which to create .gml files from tables with geometry data.

Generally, we don't recommend preserving GIS data (only) with SIARD, but to (also) use a GIS related file format, like GML, which can then be imported to open-source GIS tools like QGIS.