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

Fix issue causing always full layer export of abstract geometry types #258

Merged
merged 1 commit into from Mar 23, 2018

Conversation

Projects
None yet
2 participants
@nprigour
Contributor

nprigour commented Nov 14, 2017

In org.locationtech.udig.catalog.ui.export.CatalogExportWizard when the type of layer is of the abstract type Geometry a selection during the action of a feature export (right click on a layer and selection of Export->Other->Layer To Shapefile) is ignored causing all layers features to be exported.

Signed-off-by: Nikolaos Pringouris nprigour@gmail.com

Fix issue causing always full layer export of abstract geometry types
Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
@fgdrf

This comment has been minimized.

Contributor

fgdrf commented Mar 23, 2018

Is it about exporting only selected features and selection is ignored? Or do you mean the selection within the layers view is ignored and all layers are listed in export dialog? Can you provide a dataset with abstract Geometry type to reproduce the issue. That would help to understand the problem

Many Thanks

@nprigour

This comment has been minimized.

Contributor

nprigour commented Mar 23, 2018

Hi @fgdrf
Is it not obvious from reviewing code that the problem is that selection filter (set in data.getQuery()) is actually ignored resulting always to a full layer export?

In line 173 FeatureCollection is created using the following fragment of code
SimpleFeatureCollection fc = fs.getFeatures(data.getQuery());

Then in line 212,213 a new collection is created ignoring the previous one (why?)
SimpleFeatureCollection featureCollection = fs.getFeatures();
FeatureIterator<SimpleFeature> featureIterator = featureCollection.features();

this causes all layer features to be always exported agnostic of whether a selection query exists or not for the given layer. This applies to any geometry type polygon, point, line etc.

@fgdrf

This comment has been minimized.

Contributor

fgdrf commented Mar 23, 2018

Absolutely! I could reproduce the bug and test if your fix works for abstract and non abstract geometries. I'm wondering why it's broken for Geometry while it works for e.g. (Multi)Polygons ..

@fgdrf

This comment has been minimized.

Contributor

fgdrf commented Mar 23, 2018

Great! Works as expected and both, Abstract and Non-Abstract geometries selected features are exported only while unselected are not exported.

@fgdrf fgdrf added the bug label Mar 23, 2018

@fgdrf fgdrf added this to the uDig-2.0.0 milestone Mar 23, 2018

@fgdrf fgdrf merged commit 2f05a08 into locationtech:master Mar 23, 2018

1 check passed

ip-validation
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment