7

Try buffering your polygons with 0 distance, sometimes it fixes geometry errors. If you want to ignore the invalid geometries, you can set it Options - Processing - General:


5

You can use QGIS expression with overlay functions: they work even with invalid geometries. To attach to each point the $id of the polygon, use this expression (poly is the name of the polygon layer): array_to_string(overlay_within('poly', $id)) Two polygons with intentionally invalid geometries. Points are correctly assigned to the polygons they are within,...


4

@GermánCarrillo already provided a pretty useful link to a great answer. Here is something more specific about your script, where there are a few issues: Since you are looking for intersecting features, there is no need to sort the layer by ids (or is there something you did not mention?) You are iterating over the whole layer for each feature and checking ...


4

A point has no 2D area or "range" so if there is a distance between it and another geometry, they are disjunct. A point has to lie exactly on the line for any of the geometry predicates you mention to evaluate to True. As you mention in your comment, there is a distance of >0 between your point and the line so they do not intersect. The image ...


4

Solution 1 Run Menu Processing / Toolbox / Line Intersections (see documentation) to get a new layer with points showing where lines cross (red dots in the screenshot). You can select twice the same layer as Input and and Intersect layer or two different layers, depending which intersections you're looking for. Solution 2 Create line intersections with ...


2

If you want to go the R way I would suggest this workflow: assign each polygon an unique id / such as the polyid in your example perform sf::st_join(points, polygons) on your points and polygons objects, with - crucially - your points in the first place of the join; it will produce your points object, enriched by the data columns from the polygons object (...


2

Visualising the point count in a Polygon dynamically in ArcGIS Online is not possible. According to the ArcGIS Arcade: Visualisation page, the Arcade expressions only allow access to the $feature and $view.scale attributes - in other words you cannot access the " Geometry Intersection" between the polygon and points using this methodology. ArcGIS ...


2

I've had good luck cleaning geometry with the "Fix Geometries" tool found within the QGIS Processing Toolbox (Ctrl+Alt+T).


2

This is an older question and the accepted answer was probably correct at the time, however I believe that with new versions of QGIS, (specifically 3.16) an introduction of the overlay_intersection (and overlay_contains/crosses/within/ etc) functions in the expression editor, can allow for spatial queries to be developed within the Field Calculator. Another ...


1

The following example uses package sf, after building a example data set, the objects are intersected, which yields "clipped" polygons; afterwards, these are filtered to those comprising at least 50% of the species distribution. # build polygons for example library(sf) library(dplyr) mat_A = matrix(c(0,0,10,0,10,10,0,10,0,0),ncol = 2, byrow=TRUE) ...


Only top voted, non community-wiki answers of a minimum length are eligible