-
Notifications
You must be signed in to change notification settings - Fork 133
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
In Shapefile layers, uncommitted features are affected by all operations. #348
Comments
This is quite a serious bug. I just check it and indeed the behaviour if you try to edit more than one feature without prior committing the changes is really weird! |
Checking a little bit further it seems that we have this issue in udig even in version 2.0.0 that uses geotools 14.1. I had to go 4-5 years back in time that is udig 1.4 and geotools 9.0-M0 to see correct behavior during multiple edits of a shapefile layer! |
Thanks for confirming. It should be using the constructor with the Filter parameter. The default filter is Filter.INCLUDE, so queryAdded() will return everything rather than only the features matching the user's query. |
FYI: You may encounter this issue while testing with ShapeFiles. |
But @akater320 I cannot understand if the problem is indeed where you mention, shouldn't all FeatureSources be affected since this method getReader is final and used by all FeatureSources that inherit from the ContentFeatureSource (that is to say all type of sources)? I.e. I work for some years with JDBCFeatureSources (MySQL) in udig and the problem surely not present there! |
Excellent point @nprigour JDBCFeatureReader never gets wrapped by a DiffFeatureReader in this block. |
Hi @akater320, |
Hi @akater320, would it be possible to revise the https://osgeo-org.atlassian.net/projects/GEOT/issues/GEOT-6293 jira issue according to what I am proposing in geotools/geotools#2604 (see my latest comment) so that we can proceed with the geotools fix. If you are unable to rename the issue and/or its description, please inform back so that I generate another one and we set the GEOT-6293 as duplicate. |
The fix for this is being included in GeoTools 22.1. |
When editing a shapefile layer, uncommitted features are affected by (almost) all edit operations.
Examples:
Select any feature (e.g. polygon) in a shape file layer. That polygon plus all uncommitted polygons will be selected.
Attempt to delete any feature in a shapefile layer. That polygon plus all uncommitted polygons will be deleted.
Attempt to move/modify the geometry of any feature. All uncommitted features will be assigned a copy of the same geometry. The result is multiple features stacked on top of each other.
This seems to be caused by GeoTools not propagating the filter/query to the DiffFeatureReader. All features in the current transaction will be added to the returned iterator.
ContentFeatureSource.java
The text was updated successfully, but these errors were encountered: