You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to create a BigQuery table with geoJSON files, despite the geoJSON is an accepted format in BQ and sourceFormat specification is coercible to (NEWLINE_DELIMITED_JSON) in the function bqr_upload_data() of the bigQueryR package doesn't work. In my example below the output, error is: Error in UseMethod("bqr_do_upload", upload_data) :
library(sf)
library(geojsonsf)
library(bigQueryR)
# get AOI in shapefile
download.file(
"https://github.com/Leprechault/trash/raw/main/sel_stands_CMPC.zip",
zip_path <- tempfile(fileext = ".zip")
)
unzip(zip_path, exdir = tempdir())
# Open the file
setwd(tempdir())
stands_sel <- st_read("sel_stands_CMPC.shp")
# Reading layer `sel_stands_CMPC' from data source `C:\Users\fores\AppData\Local\Temp\Rtmp6l1bGx\sel_stands_CMPC.shp' using driver `ESRI Shapefile'
# Simple feature collection with 2 features and 16 fields
# Geometry type: MULTIPOLYGON
# Dimension: XY
# Bounding box: xmin: -52.3284 ymin: -30.43305 xmax: -51.21323 ymax: -30.35118
# Geodetic CRS: GCS_unknown
# Open as geoJSON
geo <- sf_geojson(stands_sel)
str(geo)
# 'geojson' chr "{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"CD_USO_SOL\":2433.0,\"ID_"| __truncated__
projectid <-'[my-project]'
datasetid <-'stands_ROI_2021'
tableid <- 'CF_2021'
bqr_upload_data(projectId = projectid,
datasetId = datasetid,
tableId = tableid,
geo,
#writeDisposition = c("WRITE_TRUNCATE", "WRITE_APPEND", "WRITE_EMPTY"),
sourceFormat = c("NEWLINE_DELIMITED_JSON"))
Error in UseMethod("bqr_do_upload", upload_data) :
method not applicable for 'upload_bqr' applied to an object of class "c('geojson', 'json')"
Please, any help for fix it?
The text was updated successfully, but these errors were encountered:
Thanks @MarkEdmondson1234 my file is like a JSON ({\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"properties\":{\"CD_USO_SOL) and I considering as list.
I'd like to create a BigQuery table with geoJSON files, despite the geoJSON is an accepted format in BQ and
sourceFormat
specification is coercible to (NEWLINE_DELIMITED_JSON
) in the functionbqr_upload_data()
of thebigQueryR
package doesn't work. In my example below the output, error is:Error in UseMethod("bqr_do_upload", upload_data) :
Please, any help for fix it?
The text was updated successfully, but these errors were encountered: