Skip to content
Snippets Groups Projects
Commit 4309ff23 authored by rsharp's avatar rsharp
Browse files

tracking script used to create aggregate value table

git-svn-id: svn://scm.naturalcapitalproject.org/svn/invest-test-data@9 a1e471e8-3ae1-4eeb-aa86-f41caf2650e8
parent 1488917d
No related branches found
No related tags found
Loading
...@@ -4,4 +4,6 @@ B.tif - default arguments only ...@@ -4,4 +4,6 @@ B.tif - default arguments only
L.tif - default arguments only L.tif - default arguments only
B_cz.tif - suffix == 'cz' and "Climate Zones" selected B_cz.tif - suffix == 'cz' and "Climate Zones" selected
file_list_base.txt - list of files that should be in the workspace if defaults are selected file_list_base.txt - list of files that should be in the workspace if defaults are selected
file_list_cz.txt - list of files that should be in the workspace if it is run with "climate zones" selected and suffix of "cz" file_list_cz.txt - list of files that should be in the workspace if it is run with "climate zones" selected and suffix of "cz"
\ No newline at end of file agg_results_base.csv - the aggregate results from the specified shapefile; created with the `create_aggregate_values.py` script in this directory
agg_results_cz.csv - the aggregate results from the specified shapefile; created with the `create_aggregate_values.py` script in this directory
\ No newline at end of file
import ogr
path=r"C:\Users\Rich\Documents\seasonal_water_yield_workspace\aggregated_results_cz.shp"
v=ogr.Open(path)
l=v.GetLayer()
with open('agg_results_cz.csv', 'wb') as out_csv:
for feature in l:
line = str(feature.GetFID())
line += ','+str(feature.GetField('vri_sum'))
line += ','+str(feature.GetField('qb'))+'\n'
out_csv.write(line)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment