Comments (8)
Neither does GeoJSON input work.
from trefoil.
@ererkka unfortunately, it sounds like it is an issue with fiona
(which we use to read shapefiles) not being able to read your shapefile.
Since fiona
is a dependency to trefoil
, you should be able to use the fiona
CLI in the same python environment as you installed trefoil
:
https://github.com/Toblerity/Fiona#fiona-cli
fio info --indent 2 gis/sweden.shp
May tell you a bit more directly if fiona
is not able to read it.
If you have gdal
installed on your computer, running gdalinfo gis/sweden.shp
may also tell you about any potential errors in your shapefile. Note: fiona
uses some of the gdal/ogr
internals to read shapefiles, but through a different interface.
Lastly, what is the nature of gis/sweden.shp
? Is it a polygon, line, point file? How was it created? Something about that pipeline may inform us as to the issue.
from trefoil.
The shapefile consist of four polygons over Sweden, and they are in WGS84. From fio info
I get:
{ "name": "sweden", "bounds": [ 10.982554050000035, 55.33685324592171, 24.16659005000005, 69.06008174803289 ], "schema": { "properties": { "NUTS_ID": "str:80", "Clusters_c": "str:254", "country": "str:10" }, "geometry": "Polygon" }, "count": 4, "crs": "EPSG:4326", "driver": "ESRI Shapefile", "crs_wkt": "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4326\"]]" }
from trefoil.
@ererkka I wonder if the .
you have at the end of your command line call or the \
in your paths is throwing things off.
Would you mind trying this?
trefoil zones --attribute Clusters_c --like MERRA2_data/MERRA-2.tavg1_2d_lnd_Nx.20170101.SUB.nc4 gis/sweden.shp sweden_zones.nc
from trefoil.
Same thing :(
It seems that the exception is raised by rasterio.rio.options.file_in_handler()
(callback in file_in_arg
) because rasterio.shutil.exists('gis/sweden.shp')
returns False
. I wonder why is trefoil using rasterio to check the file?
from trefoil.
@ererkka no idea why I was using rasterio
for the shapefile, nor do I know how that ever worked. Very sorry for that issue and for the delays in getting it resolved!
I was able to reproduce your issue, then resolved in the fix list above. Please pull the latest from master
on this repo, and try again. If the fix works for you, I'll then push up to pypi
.
from trefoil.
Now it works. Thank you very much!
from trefoil.
š thank you for reporting this issue, @ererkka
from trefoil.
Related Issues (20)
- Add window option to to_netcdf CLI HOT 1
- Guess year as date type
- Experiment with WebP for image output HOT 1
- Add optional output directory for map_eems
- Add ability to create zones for zonal statistics HOT 1
- Add zonal statistics functions HOT 1
- Automatically crop input to web mercator bounds before projecting to web mercator
- Extract stack of netCDF files to CSV HOT 1
- Upgrade to rasterio.crs.CRS throughout HOT 1
- Investigate numpy group_by lib
- Add projection info for lambert_azimuthal_equal_area HOT 1
- Post to Pypi HOT 4
- Cannot import 'get_data_window' from rasterio > 1.0a(x) HOT 2
- Update travis config
- Update rasterio >= 1.0a9 HOT 2
- Filename order is not consistent between platforms (Unix & Windows)
- Rename this project to trefoil
- `describe` fails on datasets with `char`-type variables
- netcdf_to_raster misaligns output geotiffs
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 trefoil.