For now, support geojson file as that is what mongolite package tries to support. Shape and others later which would also mean, keeping the package deps minimal. For details see data-raw example of this package how geojson objects are imported.

gc_import(url, collection = "geocoder", local = TRUE,
  index = "2dsphere", mongo_url = "mongodb://localhost:27017",
  silent = FALSE)

Arguments

url

geojson file to read or remote, flick local param.

collection

set collection from parameter default geocode.

local

assume url being local file.

index

a MongoDB compatible index: either 2d or 2dsphere.

mongo_url

custom mongourl to use with collection, default value is 'mongodb://localhost:27017' used with gc_setup.

silent

show messages, default is FALSE

Value

number of rows inserted