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

Clip and intersect do not work on certain vector layers #20338

Closed
qgib opened this issue Feb 6, 2015 · 6 comments
Closed

Clip and intersect do not work on certain vector layers #20338

qgib opened this issue Feb 6, 2015 · 6 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@qgib
Copy link
Contributor

qgib commented Feb 6, 2015

Author Name: Bogdan Hlevca (@bhlevca)
Original Redmine Issue: 12144
Affected QGIS version: master
Redmine category:processing/qgis


I have seen this reported in the past. Because the shape files are slightly larger than allowed I paste here the links to my shared drive.

I have the following setup:

I want to clip TorontoHarbourBathymetry : https://drive.google.com/file/d/0B5r7QXFf0ZlabmFjNmlUdGFTV3c/view?usp=sharing
with a masking layer TorontoHarbourWaterMaskCorr : https://drive.google.com/file/d/0B5r7QXFf0ZlaQWQyWTdsbG1zZlE/view?usp=sharing

and the result is an empty layer.

TorontoHarbourWaterMaskCorr was edited by me from Toronto_waterfront_water_mask_water: https://drive.google.com/file/d/0B5r7QXFf0ZlaT1hjSmM1SVV2RTQ/view?usp=sharing

When I clip with the original (Toronto_waterfront_water_mask_water) clipping works, but not with the corrected one. I verified the topology and metadata and they look the same (i.e the topology shows some invalid geometry in both)

I tried with ArcGIS and the clipping is done perfectly. The result is here TorontoHarbourBathymetryWater: https://drive.google.com/file/d/0B5r7QXFf0ZlaQWpIVF9HSUR0d1k/view?usp=sharing


@qgib
Copy link
Contributor Author

qgib commented Feb 7, 2015

Author Name: Giovanni Manghi (@gioman)


QGIS (the underlying libraries) is known to be less forgiving than arcgis when input layers have geometry issues.

In your case the clip layer has some autointersections and this make the qgis tool to fail. Example:

ERROR 1: TopologyException: Input geom 1 is invalid: Self-intersection at or near point 634635.8444026924 4831683.9208947709 at 634635.8444026924 4831683.9208947709

Of course you clean beforehand your layers and this usually makes the trick. Attached the result after cleaning the clip layer with the tool "make valid" you can find in the processing toolbox after having installed the "Processing LWGEOM Provider". Using grass v.overlay (always available in processing toolbox) does also work in this case usually also with unclean vectors.

The real (long standing) issue here is that the users are usually unaware of the geometry problems. We should add something, as option, to check/clean the vectors on the fly while doing geoprocessing operations (like probably arcgis does). Feel free to open a feature request and/or discuss it in the users/developers mailing lists.


  • category_id was configured as 44
  • status_id was changed from Open to Closed
  • resolution was changed from to invalid

@qgib
Copy link
Contributor Author

qgib commented Feb 7, 2015

Author Name: Giovanni Manghi (@gioman)


  • 8390 was configured as clipped.dbf.zip

@qgib
Copy link
Contributor Author

qgib commented Feb 7, 2015

Author Name: Bogdan Hlevca (@bhlevca)


At least you should pop up an error message instead of silently creating an empty layer. By any programming rules this is not right even if the input is bad.

@qgib
Copy link
Contributor Author

qgib commented Feb 8, 2015

Author Name: Giovanni Manghi (@gioman)


Bogdan Hlevca wrote:

At least you should pop up an error message instead of silently creating an empty layer. By any programming rules this is not right even if the input is bad.

yes, this is why I wrote my last statement in #20338 (comment)
thanks for filing the feature request.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

@qgib
Copy link
Contributor Author

qgib commented Aug 7, 2017

Author Name: Jürgen Fischer (@jef-n)


  • subject was changed from Clip and interesect do not work on certain vector layers to Clip and intersect do not work on certain vector layers
  • description was changed from I have seen this reported in the past. Because the shape files are slightly larger than allowed I paste here the links to my shared drive.

I have the following setup:

I want to clip TorontoHarbourBathymetry : https://drive.google.com/file/d/0B5r7QXFf0ZlabmFjNmlUdGFTV3c/view?usp=sharing
with a masking layer TorontoHarbourWaterMaskCorr : https://drive.google.com/file/d/0B5r7QXFf0ZlaQWQyWTdsbG1zZlE/view?usp=sharing

and the result is an empty layer.

TorontoHarbourWaterMaskCorr was edited by me from Toronto_waterfront_water_mask_water: https://drive.google.com/file/d/0B5r7QXFf0ZlaT1hjSmM1SVV2RTQ/view?usp=sharing

When I clip with the original (Toronto_waterfront_water_mask_water) clipping works, but not with the corrected one. I verified the topology and metadata and they look the same (i.e the topology shows some invalid geometry in both)

I tried with ArcGIS and the clipping is done perfectly. The result is here TorontoHarbourBathymetryWater: https://drive.google.com/file/d/0B5r7QXFf0ZlaQWpIVF9HSUR0d1k/view?usp=sharing

to I have seen this reported in the past. Because the shape files are slightly larger than allowed I paste here the links to my shared drive.

I have the following setup:

I want to clip TorontoHarbourBathymetry : https://drive.google.com/file/d/0B5r7QXFf0ZlabmFjNmlUdGFTV3c/view?usp=sharing
with a masking layer TorontoHarbourWaterMaskCorr : https://drive.google.com/file/d/0B5r7QXFf0ZlaQWQyWTdsbG1zZlE/view?usp=sharing

and the result is an empty layer.

TorontoHarbourWaterMaskCorr was edited by me from Toronto_waterfront_water_mask_water: https://drive.google.com/file/d/0B5r7QXFf0ZlaT1hjSmM1SVV2RTQ/view?usp=sharing

When I clip with the original (Toronto_waterfront_water_mask_water) clipping works, but not with the corrected one. I verified the topology and metadata and they look the same (i.e the topology shows some invalid geometry in both)

I tried with ArcGIS and the clipping is done perfectly. The result is here TorontoHarbourBathymetryWater: https://drive.google.com/file/d/0B5r7QXFf0ZlaQWpIVF9HSUR0d1k/view?usp=sharing

  • regression was configured as 0
  • easy_fix was configured as 0

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant