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

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

Merged

Conversation

nprigour
Copy link
Contributor

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

Signed-off-by: Nikolaos Pringouris <nprigour@gmail.com>
@fgdrf
Copy link
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
Copy link
Contributor Author

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
Copy link
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
Copy link
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants