Closed stPhena closed 6 years ago
Thanks. Could you maybe provide a smaller example to reproduce this issue?
Here are 10 data points, with their longitude and latitude fields (format is CSV): EXAMPLE
Can you include the code please to reproduce the problem?
This works fine for me:
mydata <- readr::read_csv('https://github.com/jeroen/mongolite/files/2283061/extract.txt')
m <- mongolite::mongo()
m$insert(mydata)
It does, but MongoDB does not recognize the uploaded data as coordinates. Nevermind, I have since abandoned MongoDB and I have transitioned to other DB technologies. It is now difficult for me to reproduce the code that I had used to create the S3 geopoint class.
I have a dataset of approximately 18 million rows that I am trying to insert into a MongoDB collection. The important part of the dataset looks like this:
I have created the coords column with
geojson::point()
, with the intention of having MongoDB natively treat it as a geospatial object. Seen from the other side, it looks like this:When I try to send data to the Mongo collection, I get this error:
Among the
toJSON()
parameters I could not find anything to manage these objects. Is mongolite able to insert data frames with a geospatial feature? Edit: In other words, can we specify two columns to be treated as (lon, lat) and thus be parsed as such into the JSON? Thanks in advance.