Skip to content

Instantly share code, notes, and snippets.

.node {
font: 300 11px "Helvetica Neue", Helvetica, Arial, sans-serif;
fill: #bbb;
}
.node:hover {
fill: #000;
}
@migtorres
migtorres / gist:2b25b6e5d13b52136285
Created July 8, 2014 13:03
Geometries for countries
CREATE Table countries_geometries as
SELECT ST_UNION(ST_MakeValid(wkb_geometry)) as the_geom,
unnest(string_to_array(iso3, '/')) as iso_3, type from wvc_ts_eez_abnj_2011 group by iso3, type;
-- Global
CREATE index pa_geom_idx ON protected_areas USING gist(the_geom);
ALTER Table protected_areas add column the_geog geography;
Update protected_areas set the_geog = the_geom::geography;
CREATE index pa_geog_idx ON protected_areas USING gist(the_geog);
-- Total PA's