Hi,
The CartoDB interface indicates that GEOTiff is supported. I can upload a georeferenced
GeoTiff file to CartoDB, but the interface reports that the uploaded table isn't georeferenced.
Here are the details:
The GeoTiff file was obtained with gdal_translate:
$cat fwd.sh
#!/bin/bash
gdal_translate -of GTiff \
-a_srs EPSG:4326 \
-a_nodata -9999 \
ramankutty_cropland2000_frac_5m.asc africa_cropland.tif
gdalinfo shows that the correct WSG1984 projection was used:
$ gdalinfo africa_cropland.tif
Driver: GTiff/GeoTIFF
Files: africa_cropland.tif
Size is 4320, 2160
Coordinate System is:
GEOGCS["WGS 84",
DATUM["WGS_1984",
SPHEROID["WGS 84",6378137,298.257223563,
AUTHORITY["EPSG","7030"]],
AUTHORITY["EPSG","6326"]],
PRIMEM["Greenwich",0],
UNIT["degree",0.0174532925199433],
AUTHORITY["EPSG","4326"]]
Origin = (-180.000000000000000,89.989020000000011)
Pixel Size = (0.083328250000000,-0.083328250000000)
Metadata:
AREA_OR_POINT=Area
Image Structure Metadata:
INTERLEAVE=BAND
Corner Coordinates:
Upper Left (-180.0000000, 89.9890200) (180d 0' 0.00"W, 89d59'20.47"N)
Lower Left (-180.0000000, -90.0000000) (180d 0' 0.00"W, 90d 0' 0.00"S)
Upper Right ( 179.9780400, 89.9890200) (179d58'40.94"E, 89d59'20.47"N)
Lower Right ( 179.9780400, -90.0000000) (179d58'40.94"E, 90d 0' 0.00"S)
Center ( -0.0109800, -0.0054900) ( 0d 0'39.53"W, 0d 0'19.76"S)
Band 1 Block=4320x1 Type=Float32, ColorInterp=Gray
Min=0.000 Max=1.000
Minimum=0.000, Maximum=1.000, Mean=0.109, StdDev=0.215
NoData Value=-9999
Metadata:
STATISTICS_MAXIMUM=1
STATISTICS_MEAN=0.10855641062885
STATISTICS_MINIMUM=0
STATISTICS_STDDEV=0.21470044269803
Florians-iMac:gdal-asc2gtiff flengyel$
To ensure that nothing was lost, the reverse translation was done (values were converted to Float64,
but otherwise the contents were the same:
$cat rev.sh
#!/bin/bash
gdal_translate -of AAIGrid \
-a_srs EPSG:4326 \
-a_nodata -9999 \
africa_cropland.tif africa_cropland.asc
This also produced an xml metadata file:
$ more africa_cropland.asc.aux.xml
<PAMDataset>
<PAMRasterBand band="1">
<ColorInterp>Gray</ColorInterp>
<Metadata>
<MDI key="STATISTICS_MAXIMUM">1</MDI>
<MDI key="STATISTICS_MEAN">0.10855641062885</MDI>
<MDI key="STATISTICS_MINIMUM">0</MDI>
<MDI key="STATISTICS_STDDEV">0.21470044269803</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Question: is there a way to get raster data into CartoDB in some form?
I've tried loading the .asc files in QGIS, which worked, and converting those
to ESRI shapefiles in QGIS, but this produces polygons with none of the
raster data. Does someone have an explicit procedure for producing a
vector coverage that might work? Maybe I should write a python program...
Thanks,
FL