Closed rotsee closed 11 months ago
That makes sense. Did you try reading a csv? I think it should work out of the box, with the exception of setting the CRS.
Oh, sorry, I might be doing something wrong then. Is it documented somewhere how I tell it what columns to use for coordinates?
This can be better documented, but for now:
fn = "latlon.csv" # csv file with Latitude, Longitude headers (=points)
df = GeoDataFrames.read(fn, options=GeoDataFrames.stringlist(Dict("X_POSSIBLE_NAMES"=>"Longitude", "Y_POSSIBLE_NAMES"=>"Latitude")))
fn = "geometry.csv" # csv file with Geometry column with quoted WKT strings
df = GeoDataFrames.read(fn, options=GeoDataFrames.stringlist(Dict("GEOM_POSSIBLE_NAMES"=>"Geometry", "KEEP_GEOM_COLUMNS"=>"NO")))
Essentially, all kwargs to read
are passed to ArchGDAL (like options, documented here), which in turns pass it to GDAL itself (csv driver details here.
Let me know if this works for you.
Thank you, I'll try that! Sorry for making this into a support thread
Reading point data from columns in a csv file is a very common task, and it would be nice to have a shortcut here, something like
GeoDataFrames.open(fn, crs="espg:3006", geom_columns=(...))