question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

1.8.13.post1 causes mask filter to act like a bounding box filter

See original GitHub issue

Expected behavior and actual behavior.

I have a script that summarizes features in dataset A that intersect with features in dataset B. This code relies on .items(mask=geometry_B) to select the features of dataset A that exist within each feature of dataset B.

This code works fine in Fiona 1.8.13. But in 1.8.13.post1, it seems to filter by bounding box, rather than the actual feature geometry.

Steps to reproduce the problem.

This is a simplified version of the code in question. I am unable to share the data, but I could come up with other data to reproduce the problem, if it becomes necessary.

with fiona.open('dataset_b.gpkg') as dataset_b:
    for feature in dataset_b:
        with fiona.open('dataset_a.gpkg') as dataset_a:
            items = dataset_a.items(mask=feature["geometry"])

Operating system

macOS 10.15.3

Fiona and GDAL version and provenance

Fiona: 1.8.13.post1 GDAL: 2.4.2 (built from source)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
nikmolnarcommented, Jun 18, 2020

Thank you @sgillies and @rbuffat for all your work figuring this out!

0reactions
rbuffatcommented, Jun 18, 2020

Until new wheels are released, it should be possible to compile Fiona from source with:

brew install gdal
pip install  --upgrade --force-reinstall --no-deps --no-binary :all: Fiona rasterio shapely
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fiona Documentation - Read the Docs
Fiona can read and write real-world data using multi-layered GIS formats and zipped virtual file systems and integrates readily with other ...
Read more >
Changelog — GeoPandas 0.12.2+0.gefcb367.dirty ...
The mask parameter of GeoSeries/GeoDataFrame.clip() now accepts a rectangular mask as a list-like to perform fast rectangle clipping using the new ...
Read more >
homebrew-core - Homebrew Formulae
a2ps 4.14 Any‑to‑PostScript filter aacgain 1.8 AAC‑supporting version of mp3gain aalib 1.4rc5 Portable ASCII art graphics library aamath 0.3 Renders mathematical expressions as ASCII art
Read more >
Untitled
... 0002-Rsyslog-support-multiple-actions-in-filters-and-sele.patch ... 0028-multipath-make-flushing-maps-work-like-other-command.patch ...
Read more >
advertisement - StudyLib
Robot goniometer as applied for in U.S. Patent 4,119,212. ... identify the major problems that cause robots to be inaccurate and give a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found