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

points in polygon: does not count points on boundaries #14915

Closed
qgib opened this issue Mar 12, 2012 · 5 comments
Closed

points in polygon: does not count points on boundaries #14915

qgib opened this issue Mar 12, 2012 · 5 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Mar 12, 2012

Author Name: alobo - (alobo -)
Original Redmine Issue: 5163
Affected QGIS version: 1.7.4
Redmine category:processing/qgis


Results from points in polygon
are different than those obtained from R.
Results from qgis are always equal to or lower than
the number calculated by R.
Visual inspection indicates that only points on polygon boundaries
are affected.
In the attached layer quadratsnbpoints
nbp: calculated in R
PNTCNT: calculated by qgis


@qgib
Copy link
Contributor Author

qgib commented Mar 14, 2012

Author Name: cfarmer - (cfarmer -)


This is because it isn't programmed to test for intersections :-p The tool checks for containment: It uses QgsGeometry.contains, rather than QgsGeometry.intersects. I suppose intersections would also be perfectly valid, but it is called 'points in polygon' :-p
I don't have a development environment set up at the moment, so can't fix/implement this right away - so will leave this ticket open. Any other developers want a quick fix? Just change line 143 in doPointsInPolygon from " if inGeom.contains(tmpGeom.asPoint()):" to " if inGeom.intersects(tmpGeom):".

Carson

@qgib
Copy link
Contributor Author

qgib commented Mar 15, 2012

Author Name: Alexander Bruy (@alexbruy)


Fixed in changeset "9151fd583b5062a4e085bba70364cd3c0a0c4885".


  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Mar 15, 2012

Author Name: Alexander Bruy (@alexbruy)


  • resolution was changed from to fixed

@qgib
Copy link
Contributor Author

qgib commented Apr 15, 2012

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was changed from 35 to Version 1.8.0

@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 qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels May 24, 2019
@qgib qgib added this to the Version 1.8.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 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! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

No branches or pull requests

1 participant