Closed rickw-ward closed 6 years ago
Unless @jterstriep or @max-zilla has a better idea, I can do this using psql2shp funcition in PostGIS following (https://gis.stackexchange.com/questions/55206/how-can-i-get-a-shapefile-from-a-postgis-query).
If you prefer it is also possible to directly connect qgis or arcmap to the database. https://terraref.gitbooks.io/terraref-documentation/content/accessing-betydb-with-arcmap.html
related: see also https://github.com/terraref/reference-data/issues/81
I'll figure out the direct connection, but not this week. Hoping to generate plot level means tomorrow.
I assume the shp file sets will contain range and column information- additional info on location attributes is welcome.
@rickw-ward see if these work mac_plots.zip
Here is the code that I used:
pgsql2shp -f season1.shp -h localhost -u bety -P bety bety \
"SELECT sitename, geometry FROM sites WHERE sitename like '%Season 1 Range%'"
pgsql2shp -f season2.shp -h localhost -u bety -P bety bety \
"SELECT sitename, geometry FROM sites WHERE sitename like '%Season 1 Range%'"
Note
Let me know if you need additional information
checking now
@dlebauer please compare shp file set you sent with those in zips below to see offset in E/W axis. Ours are for inner two rows only, but that doesn't explain offset. The link below is to an in-season NDVI orthomosaic that shows actual rows (and foundations of gantry and sprinkler heads).
MAC 2 row season 2 sorghumexpfall2016v5_lblentry_1to7.zip
foundation and sprinkler shp files.zip
https://drive.google.com/open?id=0B5btztQSCEFxa1hJS3FpTm5mUnM
@dlebauer This screen capture shows shift between our two plot polygons. Sorry- I still can't consolidate into one directory.
I'll take a closer look at the files you sent later today.
Neither version eeds to capture the plot perfectly. I know we discussed at length last year... but perhaps we should create a new set that excludes the range ends and is better centered between columns.
I'll use my .shp files for season 2. Perhaps the E/W shift of the shp file you sent is due to the conversion formula between coordinate reference systems?
Hopefully it isn't because of conversion between coordinate reference systems. There are obvious limitations to using different definitions of plot boundaries.
My understanding is that our database contains definitions from the F13_TERRA_field_book that were measured with the gantry and were to be considered the canonical plot definitions. That does not make these 'better', and I can change our definitions, but this would need to be done ASAP as we are launching our first re-analyses tomorrow or Friday.
looks like this discussion from last fall: https://github.com/terraref/computing-pipeline/issues/187 should have been resolved by https://github.com/terraref/computing-pipeline/issues/196.
It is unclear why there is still a discrepancy. In https://github.com/terraref/computing-pipeline/issues/187 I proposed that we could have multiple definitions of plots, but now I think we should try to identify a canonical definition of the plots.
@rickw-ward for season 2, it looks like we have defined the same plots as those in your shape files in addition to the other set of plots that do not align. In the image below you can see the plots from your shapefile (grey) with the plots in the database on top (thin red line):
I've deleted the plot definitions that do not align with the ones that you have from the database:
delete from sites where sitename like '%Field Plot%Season 2'
delete from citations_sites where site_id in (select id from sites where sitename like '%Field Plot%Season 2')
delete from sites_cultivars where site_id in (select id from sites where sitename like '%Field Plot%Season 2')
Good news David. Thanks.
Description
We want to ensure that the plot-level means we generate for Terra MAC UAV flights are made using polygon coordinates and plot/entry attribute information that correspond to the equivalent used in the batch extractors under development. Is it possible for your team to generate shp file sets for seasons 1 and 2?
Completion Criteria