Thursday, 10 September 2015

arcgis desktop - Converting Esri ASCII raster to Shapefile for CartoDB?


I have an ArcGIS grid ascii file (Ramankutty Cropland at 5 minute resolution) that begins as follows:


ncols         4320 
nrows 2160
xllcorner -180

yllcorner -90
cellsize 0.08332825
NODATA_value -9999
-9999 -9999 -9999 -9999 -9999 -9999 -9999
...

Someone gave me this file but did not provide a projection and could not recall what it was. However, I have some reason to believe the projection is WGS1984:


GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]


I would like to be able to convert this to a format that CartoDB could use--an ESRI shapefile. Another person who did manage this, but who also could not recall the procedure, created a polygonal coverage of grid squares (closed oriented loops). The values at the row and column numbers were assigned to the polygonal squares (somehow--I do not know the data structures involved).


Is there a way to create some kind of polygonal grid square coverage without using ArcGIS (I'm guessing this was used, but no details were provided to me)? Open source tools would be nice, but if ArcGIS is necessary, so be it.



As an alternative, I tried gdal_translate -of GTIFF -a_srs WGS1984.prj ... and uploaded the result to CartoDB, but CartoDB complained that the result was not georeferenced (the_geom lat/lon GeoJSON was empty).


(I'm not sure how to apologize for asking such vague and uninformed questions.)


Some more info: here's part of a row from the ESRI shapefile of this data that was imported into CartoDB


**id**  1
**the_geom** {"type":"MultiPolygon","coordinates":[[[[-8.7649,37.34027], [-8.87019,37.36377],[-8.79447,37.42393],[-8.7649,37.34027]]]]}
**shape_area** 63274611.152
**shape_leng** 36270.0549322

Another row:


**id**  2

**the_geom** {"type":"MultiPolygon","coordinates":[[[[-8.59219,37.34027],[-8.67854,37.34027],[-8.67854,37.40889],[-8.59219,37.40889],[-8.59219,37.34027]]]]}
**shape_area** 92417860.2
**shape_leng** 38453.683350300001621


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...