Comments (6)
Thanks for the nice report!
from exactextract.
Update 3: I tried the same raster with the cli and it works well so the issue must come from the pybind11 layer
from exactextract.
Can you share the full call to exact_extract
? I'm having trouble replicating this.
from exactextract.
Hello, sure! I managed to reproduce it with a minimal example:
import json
import rasterio as rio
import numpy as np
from exactextract import exact_extract, __version__
print("exact_exctract version: ", __version__)
GEOJSON = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[3.0, 7.0],
[3.0, 10.0],
[0.0, 10.0],
[0.0, 7.0],
[3.0, 7.0],
],
],
},
}
],
}
with open("test_zone.json", "w") as out:
json.dump(GEOJSON, out)
data = np.array([[0, 1, 0], [1, 9, 1], [0, 1, 0]], dtype=np.int32)
transform = rio.transform.from_origin(0, 10, 1, 1)
with rio.open(
"sick_raster.tif",
"w",
driver="GTiff",
width=data.shape[1],
height=data.shape[0],
count=1,
dtype="int32",
crs="+proj=latlong",
transform=transform,
nodata=-1
) as dst:
dst.write(data, 1)
exact_extract("sick_raster.tif", "test_zone.json", ops=['sum'])
And found out also that is the presence of nodata
that triggers the error. If nodata=None
it works well, for any other value it crashes.
from exactextract.
Also it only happens for all the signed integers. the unsigned variants uint8,16,32,64
work well with a nodata value set
from exactextract.
Thank you for the quick fix!
from exactextract.
Related Issues (20)
- error using Docker HOT 8
- Support circular statistics
- Check input layer CRS HOT 1
- Error when using `exact_extract` with any extra arguments to statistics HOT 6
- Migrate exactextractr into this repository
- Compilation error traced to `set` function override in `gdal_feature`
- Error in `test_stats` HOT 1
- Add multithreading capabilities
- Build fails on Ubuntu Noble
- Fraction output for python version HOT 3
- How to avoid the INSERT 0 1 in the cli output HOT 4
- exactextract Python, no coverage_fraction? HOT 2
- problem with python, error: Never get here. HOT 13
- Error with 'make' command HOT 1
- Strange behavior in computation of 'frac', 'values', and 'coverage' stats with Python binding HOT 6
- Add operation to get per-category count
- RasterSequentialProcessor: subdivide based on block size
- Custom Python functions should receive NODATA pixels
- Unexpected result for stats with no result using integer rasters HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from exactextract.