Skip to content

Instantly share code, notes, and snippets.

@maptastik
Last active November 26, 2018 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maptastik/1e1ea2ee42f13e17f52c77d2f2235d2c to your computer and use it in GitHub Desktop.
Save maptastik/1e1ea2ee42f13e17f52c77d2f2235d2c to your computer and use it in GitHub Desktop.
Troubleshooting converting a CARTO table to GeoJSON using ogr2ogr. Ultimately it does not seem I figured this out.

What has worked?

ogrinfo --config CARTO_HTTPS NO -ro "Carto:<username>" <some_public_table>

This streams all sorts of info including geometries and attributes for each feature in the dataset. This isn't what I want ultimately, but it tells me that ogr is able to suck in that Carto data table.

What hasn't worked

I've been reading the documentation for the ogr's Carto driver and using that to inform how to set up this conversion:

ogr2ogr --config CARTO_HTTPS NO -f GeoJSON "Carto:<username>" <some_public_table>

This returns:

FAILURE: Unable to open datasource '<some_public_table>' with the following drivers

...followed by a long list of drivers including Carto and GeoJSON

I've also tried

ogr2ogr --config CARTO_HTTPS NO -f GeoJSON "Carto:<username>" tables=<some_public_table>

This returns:

FAULURE: Unable to open datasource 'tables=<some_public_table>' with the following drivers

...followed by a long list of drivers.

And also

ogr2ogr --config CARTO_HTTPS NO -f GeoJSON "Carto:<username> tables=<some_public_table>"

...which returns:

FAILURE: no source datasource provided

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment