New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
string limitation for very large geojson #64
Labels
Comments
Indeed - the solution may be to implement FileReadStream rather than, or as well as the buffer - to - StringVector implementation |
SymbolixAU
pushed a commit
that referenced
this issue
Sep 26, 2019
SymbolixAU
pushed a commit
that referenced
this issue
Sep 26, 2019
working prototype sf <- geojsonsf:::rcpp_read_sf_file_stream(normalizePath("~/Downloads/Texas.geojson"), FALSE)
sf
# Simple feature collection with 9891540 features and 0 fields
# geometry type: POLYGON
# dimension: XY
# bbox: xmin: -106.646 ymin: 25.85305 xmax: -93.52176 ymax: 36.50031
# epsg (SRID): 4326
# proj4string: +proj=longlat +datum=WGS84 +no_defs
# First 10 features:
# geometry
# 1 POLYGON ((-95.61533 30.7471...
# 2 POLYGON ((-95.59383 30.7382...
# 3 POLYGON ((-95.56662 30.7327...
# 4 POLYGON ((-95.55648 30.7391...
# 5 POLYGON ((-95.57037 30.7253...
# 6 POLYGON ((-95.57031 30.7267...
# 7 POLYGON ((-95.57383 30.7276...
# 8 POLYGON ((-95.5707 30.72964...
# 9 POLYGON ((-95.57335 30.7297...
# 10 POLYGON ((-95.569 30.72455,... |
timings system.time({
sf <- geojsonsf::geojson_sf("~/Downloads/Texas.geojson", buffer_size = 1024) ## default
})
# user system elapsed
# 126.185 16.056 189.778
system.time({
sf <- geojsonsf::geojson_sf("~/Downloads/Texas.geojson", buffer_size = 2048)
})
rm(list=ls());gc()
# user system elapsed
# 91.989 20.256 127.668
system.time({
sf <- geojsonsf::geojson_sf("~/Downloads/Texas.geojson", buffer_size = 65536)
})
rm(list=ls());gc()
# user system elapsed
# 132.908 13.697 191.704
|
sessionInfo
|
The |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to load the Microsoft building footprint data for Texas (https://github.com/Microsoft/USBuildingFootprints) which is 2.1 GB. However, when i run the code:
footprint_data = "(path to folder containing data)./Texas.geojson"
texas_buildings = geojson_sf(footprint_data)
I get the following error
The same code works for smaller files in the Microsoft data, so it seems like the error is due to the size of the file. Any suggestions would be greatly appreciated :-)
TODO
buffer_string
to userapidjson::FileReadStream
directlyfopen()
for windowschar writeBuffer[65536];
?The text was updated successfully, but these errors were encountered: