Commit b438ba56 authored by Roelofsen, Hans's avatar Roelofsen, Hans
Browse files

Plant validatie data

parent 876036f6
""""
Script om de De Vegetatie van Nederland (DVN) gegevens geschikt te maken voor gebruik in autom. MNP validatie
Input formatering:
vegNED2020_header.csv (plot header data)
vegNED2020_species.csv (plot species inventory)
Gewenste formatering
Species_Code, Uurhok_ID, COUNT
Sxxxxx, xxxx_yyyy, q
door: Hans Roelofsen, november 2020
"""
import pandas as pd
from sample.mnp import helpers as hlp
headers_src = r'\\wur\dfs-root\PROJECTS\QMAR\MNP-SNL-Validation2019\TUrboveg data\vegNED2020_header.csv'
species_src = r'\\wur\dfs-root\PROJECTS\QMAR\MNP-SNL-Validation2019\TUrboveg data\vegNED2020_species.csv'
# read dvn headers and add uurhok identification
headers = pd.read_csv(headers_src, sep='\t',
usecols=['PlotObservationID', 'PlotID', 'Datum opname', 'X-Coordinaat (m)', 'Y-Coordinaat (m)'])
headers.set_index(keys='PlotObservationID', drop=False, verify_integrity=True)
headers.rename(mapper={'X-Coordinaat (m)': 'x', 'Y-Coordinaat (m)': 'y'}, inplace=True, axis=1)
headers.dropna(subset=['x', 'y'], inplace=True)
headers['coord'] = list(zip(headers.x, headers.y))
headers['uh_id'] = headers.coord.apply(hlp.pnt2square_id, size=5000, of='brief')
# read plot inventories
species = pd.read_csv(species_src, sep='\t', usecols=['PlotObservationID', 'Species name'])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment