Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[geogig-dev] export diff command - Removed features?

Dear Geogig developers,

this is a great project, and I would be very happy to see it proceed and growing.

These days, I've been expermimenting around with geogig, especially interested in the new "diff-export" command added recently by Victor Olaya. My goal is to regularily poll geogig for diffs and export only those diffs into a PostGIS database table (of which I know it is not being modified by any other tool) in order to gain speed.

When exporting diffs with "geogig shp export-diff", I've wondered why I never found a changetype "R" for removed features in the resulting shapefile. Only when the "old" switch is on, the removed features appear in the list, but no changetype "A" for added this time.

With the current behaviour, I would have to call "export-diff" twice, once in the normal way, and a second time with --old to get the IDs of the removed features.

After a closer look and some debugging, I traced the issue down to org.locationtech.geogig.geotools.plumbing.ExportDiffOp.java. There, around line 180, the "new Ref" is checked for null. Only if it is not null, a line will be added to the output shapefile, and omitted otherwise.

In my opinion, in that case geogig should ouput at least a feature consisting of the feature ID and the Changetype "R" for Removed. Or, alternatively, the complete old feature (the one which isn't null).

Outputting the whole "old" feature in that case would probably break if we had changes on the features columns between those two commits, but only taking the feature ID would not break, I guess.

With that information in place, one could write some SQL procedure (or other code) which "patches" a database in terms of "update table where ID=id", "insert into table" and "delete from table where ID=id"

What's your opinion on this? Maybe I could help out with some code on this issue.

Kind regards,
Sebastian


Back to the top