The document discusses how to analyze OpenStreetMap (OSM) data using CartoDB. It explains that CartoDB makes it easy to import OSM data by directly importing files or from a URL. The imported OSM data is automatically organized into four tables representing points, polygons, roads, and linestrings. It then describes how users can perform analysis on the imported OSM data using SQL and APIs to combine, filter, and visualize the geospatial data in creative ways. Visualizations can be embedded or built using client-side technologies like Leaflet, Google Maps, and D3.
70. WITH
hgrid
AS
(SELECT
Cdb_rectanglegrid(Cdb_xyz_extent(8,
12,
5),
Cdb_xyz_resolution(5)
*
4,
Cdb_xyz_resolution(5)
*
4)
AS
cell)
SELECT
x,
y,
Array_agg(c)
vals,
Array_agg(d)
dates
FROM
(SELECT
St_xmax(hgrid.cell)
x,
St_ymax(hgrid.cell)
y,
Count(i.cartodb_id)
c,
Floor((
Date_part('epoch',
built)
-‐
-‐10418716800
)
/
32837875)
d
FROM
hgrid,
us_po_offices
i
WHERE
St_intersects(i.the_geom_webmercator,
hgrid.cell)
GROUP
BY
hgrid.cell,
Floor((
Date_part('epoch',
built)
-‐
-‐10418716800
)
/
32837875)
)
f
GROUP
BY
x,
y
Sunday, October 14, 12