Trouble converting shapefile to DataFrame in Julia using ArchGDAL

75 views Asked by At

I'm new to Julia and having some trouble working with geospatial data here. I'm working with a relatively large shapefile (BasinATLAS data here: https://www.hydrosheds.org/hydroatlas) where the layer of interest is about 1.3GB. I'm want to subset the data iteratively, and it seems easier to covert to a dataframe to do so.

I'm reading in the data fine:

myData = ArchGDAL.read("/shapefile.shp")
myLayer = ArchGDAL.getlayer(myData, 2)

And I can convert one of the small layers to a dataframe fine, too:

myDF = DataFrames.DataFrame(myLayer)

But when I try to read one of the chunkier layers (> 1GB) I get this error:

GDALError (CE_Failure, code 1): Error in fread() reading object of size 1256 at offset 85982596 from .shp file

Is there a size limit on DataFrames.DataFrame()? And if so, is there an alternative way to manipulating the shapefile (removing rows, adding columns, calculations, etc.)?

*edit: and for clarity, the underlying data are fine. I regularly work with this database in R using the sf package. I'm just struggling to recreate that work in Julia using ArchGDAL.

0

There are 0 answers