Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export of table without geometry fails #399

Open
MarkusHesse42 opened this issue Oct 17, 2017 · 2 comments
Open

Export of table without geometry fails #399

MarkusHesse42 opened this issue Oct 17, 2017 · 2 comments

Comments

@MarkusHesse42
Copy link

MarkusHesse42 commented Oct 17, 2017

The call "geogig geopkg export -i .." fails for tables without geometry.

For testing I created a very simple table in postgres:

CREATE TABLE ga.test_detail
(
  nummer bigint NOT NULL,
  name character varying(32),
  CONSTRAINT test_detail_pkey PRIMARY KEY (nummer)
)
WITH (
  OIDS=TRUE
);

and filled in some data.

I imported it successfully to geogig:

geogig pg import --host $GG_HOST --port $GG_PORT --schema $GG_SCHEMA --database $GG_DATABASE --user $GG_USER --password $GG_PASSWORD --table test_detail
geogig add
geogig commit -m "Datail"

The simple export to GeoPackage works:

geogig geopkg export test_detail test_detail

But if I want to export with option "-i", it fails:

geogig geopkg export -i test_detail test_detail

The error message is:

Exporting from test_detail to test_detail...
test_detail exported successfully to test_detail

Exporting repository metadata from 'HEAD:test_detail' (commit b62f2db7c360a38dc4ad36fca1b80ed9c76c530d)...
Unable to export: Table 'test_detail' does not exist

The error message in geogig.log is

2017-11-23 14:31:05,779 ERROR [main] o.l.g.c.GeogigCLI [GeogigCLI.java:390] Unable to export: Table 'test_detail' does not exist
java.lang.IllegalStateException: Table 'test_detail' does not exist
        at com.google.common.base.Preconditions.checkState(Preconditions.java:197) ~[guava-18.0.jar:na]
        at org.locationtech.geogig.geotools.geopkg.InterchangeFormat.export(InterchangeFormat.java:176) ~[geogig-geotools-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.geotools.geopkg.GeopkgAuditExport._call(GeopkgAuditExport.java:59) ~[geogig-geotools-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.geotools.geopkg.GeopkgAuditExport._call(GeopkgAuditExport.java:24) ~[geogig-geotools-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.repository.AbstractGeoGigOp.call(AbstractGeoGigOp.java:154) ~[geogig-api-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.geotools.cli.geopkg.GeopkgExport.runInternal(GeopkgExport.java:91) ~[geogig-geotools-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.cli.AbstractCommand.run(AbstractCommand.java:68) ~[geogig-cli-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.cli.GeogigCLI.executeInternal(GeogigCLI.java:532) ~[geogig-cli-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.cli.GeogigCLI.execute(GeogigCLI.java:368) ~[geogig-cli-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.cli.app.CLI.run(CLI.java:95) [geogig-cli-app-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]
        at org.locationtech.geogig.cli.app.CLI.main(CLI.java:113) [geogig-cli-app-1.3-SNAPSHOT.jar:1.3-SNAPSHOT]

The real problem is, that this "-i" is used by the geogig QGIS plugin when downloading a layer from the geogig repository. That means, it is not possible to work with tables without geometry in QGIS using geogig.

@DBlasby
Copy link
Contributor

DBlasby commented Oct 17, 2017

I think @emerkle826 is going to take a quick look at this.
I expect the audit tables (that "-i" setup) assume there's a geometry column. Does it work properly if you don't use "-i"?

@MarkusHesse42
Copy link
Author

Hello Dave,
as described in the initial post, the export without "-i" works.

I asume, the audit table created by "-i" are necessary for the geogig QGIS plugin to run propperly. So it is important, that this kind of export is possible when tables without geometry shall be handled inside QGIS managed by geogig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants