DOI-USGS / intersectr

See official repository here: https://code.usgs.gov/water/intersectr
Creative Commons Zero v1.0 Universal
7 stars 5 forks source link

Issues comparing intersectr output to geoknife #18

Closed dblodgett-usgs closed 5 years ago

dblodgett-usgs commented 5 years ago

Recording a support email for posterity.

I finally install the 'intersectr' successfully and test it in multiple dataset. Thanks for your work and this package is great!

For this package, may I have two more questions?

1- I compare the intersectr result with geoknife result based on the same precipitation dataset (e.g. gridMET) and same method (weighted average). However, I find for some certain county, the daily average precipitation is not quite similar (for example, for county with fips:01003, geoknife gives me 30.74mm precipitation, while intersectr gives me 28.57 mm)

I find that in your demo: https://usgs-r.github.io/intersectr/dev/articles/prism_demo.html, you also find there is a difference between the result of intersectr and geoknife (as max as 0.85 in the end of the demo). I will appreciate it if you can generally give me some hints for the main reason that results between intersectr and geoknife are different. I think probably one reason is the shape file. I use the 'sample:counties' in 'geoknife' and US county shape file (2016 version) in 'intersectr' (from here: https://catalog.data.gov/dataset/tiger-line-shapefile-2016-nation-u-s-current-county-and-equivalent-national-shapefile).

But, I am not sure what is the shape file of 'sample:counties' in 'geoknife'. Do you know where I can find the shape file, which is exactly same as 'sample:counties' in the geoknife? Another reason I think is probably the setting of cell geometry for the grid we need to intersect with our county geometry. But, I am not sure what's the specific setting in 'geoknife' for that part. I just follow the same procedure and setting you describe in your demo to process my data based on 'intersectr'.

2- When I read your demo, I find the following code in your execution intersection section:

# Need to fix in execute_intersection
intersected[, 2:ncol(intersected)] <- intersected[, 2:ncol(intersected)]

Just curious what should we fix and why we assign the right part to the same left part (intersected[, 2:ncol(intersected)]).

dblodgett-usgs commented 5 years ago

For comparison, the sample county shapefile in the GDP is available here: https://cida.usgs.gov/artifactory/gdp-geoserver/shp/US_Counties.tar.gz

I found a bug in the comparison I had done and got it fixed. All errors are <1% now and most are much smaller than 1%.

On 2, That code you pointed out was no longer relevant... I think I changed it and should have just deleted it. It's been removed now.

Fixed in #17