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

fraction of soil class wth small shapes of a shapefiles #41

Open
ShervanGharari opened this issue Mar 19, 2024 · 8 comments
Open

fraction of soil class wth small shapes of a shapefiles #41

ShervanGharari opened this issue Mar 19, 2024 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@ShervanGharari
Copy link

The soil class fraction for a shape within the provided shapefile Steppler_shapefile.zip is 0.
the output looks like this (example):

COMID, frac_12
123, 1
124, 1
125, 0
126, 1
127, 1

It seems all the shapefiles have positive areas and are valid. I am wondering if you can take a look @kasra-keshavarz or reproduce this issue. It can be very well that the shapefile is smaller than the grid. I did not explore this but might cause an issue for exactextract.
Also sorry, it seems scratch is not working, otherwise I would have copied past the actual output file.

@kasra-keshavarz
Copy link
Collaborator

I will have a look, thanks.

@kasra-keshavarz kasra-keshavarz self-assigned this Mar 19, 2024
@kasra-keshavarz kasra-keshavarz added the bug Something isn't working label Mar 19, 2024
@kasra-keshavarz
Copy link
Collaborator

I cannot find a COMID with 125 value inside the geometry file. The attached screenshot is all I see:
image

@ShervanGharari
Copy link
Author

yes, they are PolygonId, now I have access to the file from scratch. it looks like this:

PolygonId,lat,lon,frac_12
3,49.3335105341665,-98.3644685359446,1
10,49.3275226774114,-98.370363499065,1
11,49.3289547776079,-98.3906932890098,1
12,49.3282924861091,-98.3818005323894,1
13,49.3277355933317,-98.3666231385368,1
14,49.3271788959891,-98.3906642418226,1
15,49.3266241088553,-98.3885633609083,1
16,49.3269500028119,-98.3802684664347,1
17,49.32618004397,-98.3593108346827,1
18,49.3244355344646,-98.3909474941817,1
19,49.3228138123735,-98.3889258661066,1
21,49.3322670278447,-98.3661465185802,1
24,49.3308761146068,-98.3675766704112,1
26,49.3345258398447,-98.3618156592226,1
27,49.3316590643539,-98.3655269498655,1
28,49.3253373050675,-98.380462708457,1
29,49.3297748037927,-98.3881149420671,1
30,49.3296758726058,-98.3872957837495,1
31,49.3295857594588,-98.3827450445958,1
32,49.3282652171595,-98.3573339741446,0
33,49.3279296238513,-98.3728481827443,1
34,49.3295594163184,-98.3748796615995,1
35,49.329834381477,-98.3704316142598,1
36,49.3310410364066,-98.3665894839823,1
37,49.3307253659404,-98.3655096585408,1
38,49.3284934805845,-98.3616227644936,1
39,49.33140027253,-98.359595091066,1
40,49.3352603866151,-98.3578874015903,1

PolygonId or COMID the output should be the same(?). the frac_12 is 0 for 32. That is the issue.

@kasra-keshavarz
Copy link
Collaborator

I will check this and get back to you.

With newer versions of gistool, you can give the ID column of the geometry file as to the --fid argument using which you want the zonal stats be report for.

@ShervanGharari
Copy link
Author

it is the latest gistool I assume. We were working on this a few days ago. The config is here:
https://github.com/ShervanGharari/FHIMP/blob/ERA5MODIS/hydro-models/02_model_agnostic/model-agnostic.json#L62
This has another issue one of the files for land cover or soil was not generated or it was empty.
I would suggest the following to see if you can reproduce both:
1- git clone the ERA5MODIS branch and see if you can get the final result from GIS tool. note that the domain is pfaf 28 which is set there.
2- replace the shapefile with the shapefile from here to see also if you can reproduce what we have seen with fract_12
3- there is another issue on top of all for datatool which seems to stop when the shapefile (the small one is given). I had to manually adjust the min and max lat lon.
So to make it short there are three issues. I think the first is to see if you can reproduce each and every one of them. We can then systematically address this.
sorry if this is a bit too much for this issue. We can break it to datatool or FHIMP.

@ShervanGharari
Copy link
Author

For the soil issue and the shared shapefile here, I suspect this might be an issue with exactextract for shapefiles that is small that fall in just one grid maybe. Just a speculation, I did not have much time to check this in detail, I might come back to this later this week.

@kasra-keshavarz
Copy link
Collaborator

Since the usda_mode_soilclass_250m_ll was problematic, I just changed the default variable to the raster with the global coverage. So, this variable does not exist anymore. Does this resolve the issue you think?

@ShervanGharari
Copy link
Author

ok let me try one more time with the new gistool and will let you know. I think, I need to report the issues here more systematically. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants