Skip to content
Back to formatted view

Raw Message

Message-ID: <CAKBoCbEK2rQhRcddUNNNc3KsgTJqVTyEC6vjasPNf2E-5oaU=g@mail.gmail.com>
Date: 2020-06-20T10:28:36Z
From: Lom Navanyo
Subject: Error when saving an sf (data) object to file as a shapefile
In-Reply-To: <9442a78e-e67f-601d-a545-8a08fb9e4ff0@gmail.com>

Dear Bede-Fazekas,

Thank you for the swift response.
I confirm that all key values in y (balance5) are in x (parcel1). I used
all.y=TRUE because y the IDs (key values in y) are actually a subset of x.
However, what I cannot confirm is if the key variables combination
c('PARCEL_ID','CAL_YEAR') match perfectly from the two data sets.
I therefore changed the merging as:
mergedparcel2 <- merge(parcel1, balance5, by=c('PARCEL_ID','CAL_YEAR'))

I still get the following error:
> st_write(mergedparcel2,"mergedparcel2.shp")
Writing layer `mergedparcel2' to data source `mergedparcel2.shp' using
driver `ESRI Shapefile'
Writing 4682 features with 204 fields and geometry type Multi Polygon.
Unknown field name `Act_Depthtwtr': updating a layer with improper field
name(s)?
Error in CPL_write_ogr(obj, dsn, layer, driver,
as.character(dataset_options),  :
  Write error
In addition: There were 21 warnings (use warnings() to see them)

-----------------
Lom

	[[alternative HTML version deleted]]