claeis / ili2db

interlis import/export to relational databases
30 stars 30 forks source link

ili2gpkg: error no dburl given but dburl is not mentionned in the documentation #539

Closed nicolas-heigvd closed 3 months ago

nicolas-heigvd commented 7 months ago

Hi,

when running the ili2gpkg-5.1.0 tool this way, it naturally raises an error:

# java -jar ili2gpkg-5.1.0.jar --models mymodel.ili
no dburl given
function not supported

But there is 0 occurrence of the dburl string in the embedded documentation of the tool:

# java -jar ili2gpkg-5.1.0.jar --help
INTERLIS 2-loader for GeoPackage, Version 5.1.0-58fc980cc6639b2c16a3cff8a0fa19ef1484b11c
  Developed by Eisenhut Informatik AG, CH-3401 Burgdorf
  See http://www.interlis.ch for information about INTERLIS
  Parts of this program have been generated by ANTLR; see http://www.antlr.org
  This product includes software developed by the
  Apache Software Foundation (http://www.apache.org/).

DESCRIPTION
  Translates INTERLIS 2 data model definitions to a GeoPackage schema.
  Loads INTERLIS 2 data into a GeoPackage database.
  Unloads INTERLIS 2 data from a GeoPackage database.

USAGE
  java -jar ili2gpkg.jar [Options] [file.xtf]

OPTIONS

--import               do an import.
--update               do an update.
--replace              do a replace.
--delete               do a delete.
--export               do an export.
--schemaimport         do an schema import.
--preScript file       before running a function, run a script.
--postScript file      after running a function, run a script.
--dbparams file        config file with connection parameters.
--dbfile gpkgfile       The filename of the database.
--metaConfig file      Meta-Config file for ili2db.
--validConfig file     Config file for validation.
--disableValidation    Disable validation of data.
--disableAreaValidation Disable AREA validation.
--forceTypeValidation  restrict customization of validation related to "multiplicity"
--disableBoundaryRecoding disables the correction of self touching lines
--disableRounding      Disable rounding of import/export data.
--deleteData           on schema/data import, delete existing data from existing tables.
--defaultSrsAuth  auth Default SRS authority null
--defaultSrsCode  code Default SRS code
--modelSrsCode  model=code SRS code per model
--multiSrs             create a DB schema that supports multiple SRS codes
--domains genericDomain=concreteDomain overrides the generic domain assignments on export
--altSrsModel originalSrsModel=alternativeSrsModel assigns a model with an alternative SRS (but same structure as orinal model)
--modeldir  path       Path(s) of directories containing ili-files.
--models modelname     Name(s) of ili-models to generate an db schema for.
--dataset name         Name of dataset.
--baskets BID          Basket-Id(s) of ili-baskets to export.
--topics topicname     Name(s) of ili-topics to export.
--createscript filename  Generate a sql script that creates the db schema.
--dropscript filename  Generate a sql script that drops the generated db schema.
--noSmartMapping       disable all smart mappings
--smart1Inheritance     enable smart1 mapping of class/structure inheritance
--smart2Inheritance     enable smart2 mapping of class/structure inheritance
--coalesceCatalogueRef enable smart mapping of CHBase:CatalogueReference
--coalesceMultiSurface enable smart mapping of CHBase:MultiSurface
--coalesceMultiLine    enable smart mapping of CHBase:MultiLine
--coalesceMultiPoint   enable smart mapping of MultiPoint structures
--coalesceArray        enable smart mapping of ARRAY structures
--coalesceJson         enable smart mapping of JSON structures
--expandMultilingual   enable smart mapping of CHBase:MultilingualText
--expandLocalised      enable smart mapping of CHBase:LocalisedText
--createGeomIdx        create a spatial index on geometry columns.
--createEnumColAsItfCode create enum type column with value according to ITF (instead of XTF).
--createEnumTxtCol     create an additional column with the text of the enumeration value.
--createEnumTabs       generate tables for enum definitions and use xtfcode to reference entries in generated enum tables.
--createEnumTabsWithId generate tables with T_Id for enum definitions and use ids to reference entries in generated enum tables.
--createSingleEnumTab  generate all enum definitions in a single table.
--beautifyEnumDispName replace underscore with space in dispName of enum table entries
--createStdCols        generate T_User, T_CreateDate, T_LastChange columns.
--t_id_Name name       change name of t_id column (T_Id)
--idSeqMin minValue    sets the minimum value of the id sequence generator.
--idSeqMax maxValue    sets the maximum value of the id sequence generator.
--createTypeDiscriminator  generate always a type discriminator column.
--disableNameOptimization disable use of unqualified class name as table name.
--nameByTopic          use topic+class name as table name.
--nameLang lang        use names of ili model in given language as table/column name.
--maxNameLength length max length of sql names (null)
--sqlEnableNull        create no NOT NULL constraints in db schema.
--sqlColsAsText        Every simple-type attribute will be mapped to a text column, to enable the import of invalid data
--sqlExtRefCols        external references will be mapped to a column with the ili OID domain, to enable the import of not available objects
--strokeArcs           stroke ARCS on import.
--skipPolygonBuilding  keep linetables; don't build polygons on import.
--skipReferenceErrors  ignore/do not report reference errors.
--skipGeometryErrors   ignore/do not report geometry errors.
--keepAreaRef          keep areaRef as additional column on import.
--createTidCol         create an additional column T_Ili_Tid
--importTid            read transient TIDs into column T_Ili_Tid
--exportTid            write transient TIDs from column T_Ili_Tid
--importBid            read transient BIDs into T_ILI2DB_BASKET.T_Ili_Tid
--exportFetchSize nrOfRecords      set the fetch size for the SQL query statements
--importBatchSize nrOfRecords     set the batch size for the SQL insert/update statements
--createImportTabs     create tables with import statistics. (T_ILI2DB_IMPORT)
--createBasketCol      generate T_basket column.
--createDatasetCol     generate T_datasetname column (Requires --dataset)
--createFk             generate foreign key constraints.
--createFkIdx          create an index on foreign key columns.
--createUnique         create UNIQUE db constraints.
--createNumChecks      create CHECK db constraints for numeric data types.
--createTextChecks     create CHECK db constraints for text data types.
--createDateTimeChecks create CHECK db constraints for date/time data types.
--createMandatoryChecks create CHECK db constraints for MANDATORY attributes.
--ILIGML20             use eCH-0118-2.0 as transferformat
--exportModels modelname  export data according to the given base ili-models
--exportCrsModels modelname  export data according to the given ili-model (with alternate CRS)
--ver4-noSchemaImport  do no implicit schema import during data import
--doSchemaImport       do implicit schema import during data import
--ver4-translation     supports TRANSLATION OF in ili2db 4.x mode (incompatible with ili2db 3.x versions).
--ver3-translation     supports TRANSLATION OF in ili2db 3.x mode (incompatible with ili2db 4.x versions).
--translation translatedModel=originModel assigns a translated model to its orginal language equivalent.
--createMetaInfo       Create aditional ili-model information.
--iliMetaAttrs file    Import meta-attributes from a .toml file (Requires --createMetaInfo)
--createTypeConstraints   Create CHECK constraint on t_type columns.
--dbschema  schema     The name of the schema in the database. Defaults to not set.
--gpkgMultiGeomPerTable Create more than one geometry per table, if required (no secondary table).
--proxy host           proxy server to access model repositories.
--proxyPort port       proxy port to access model repositories.
--log filename         log messages to given file.
--logtime              include timestamps in logfile.
--xtflog filename      log messages to given XTF file.
--verbose              print additional information in validation results.
--gui                  start GUI.
--trace                enable trace messages.
--help                 Display this help text.
--version              Display the version of ili2gpkg

Also, note that testing it using dburl as an option is also not working:

# java -jar ili2gpkg-5.1.0.jar --models mymodel.ili --dburl mymodel.gpkg
--dburl: unknown option

Thanks.

PS: I know I have to use the --dbfile option to specify the output GeoPackage filename.

java.version 17.0.10

edigonzales commented 7 months ago

dburl is the jdbc url and is composed of various parameters. When using ili2gpkg it's just the file name: https://github.com/claeis/ili2db/blob/master/ili2gpkg/src/ch/ehi/ili2gpkg/GpkgMain.java#L55