maptastik
11/16/2017 - 8:27 PM

Troubleshooting converting a CARTO table to GeoJSON using ogr2ogr

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