[gdal-dev] python - convert CSV of point coordinates to geopackage

Emily Soth esoth at stanford.edu
Thu Jun 16 16:51:20 PDT 2022


Hi,

I am trying to create a geopackage from a CSV of point coordinates making
use of the X_POSSIBLE_NAMES and Y_POSSIBLE_NAMES open options on the CSV
driver.

I have tried a few things (details are in a gist
<https://gist.github.com/emlys/60db94cb4017a78219a1aa1dadc0914d>). To
summarize, I can only set the open options when opening as a gdal.Dataset,
but then I cannot copy that back into a vector format.

In the source code it looks like open options can be passed to the CSV
driver's Open function (source
<https://github.com/OSGeo/gdal/blob/35c07b18316b4b6d238f6d60b82c31e25662ad27/ogr/ogrsf_frmts/csv/ogrcsvdriver.cpp#L142-L167>)
but I don't know how to use this from the python API since the python
ogr.Driver.Open function doesn't accept open options unlike gdal.OpenEx.

Thank you!
- Emily
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220616/a4dac125/attachment.htm>


More information about the gdal-dev mailing list