This set of instructions goes with this presentation deck.
- Tobler's First Law of Geography
- 2016 Precinct Level Presidential Election Results
- Canada Geographic Information System
- Learn about early GIS by watching "Data for Decision"
- geojson.io
This set of instructions goes with this presentation deck.
Create a database, enable PostGIS and load the polling divisions.
createdb parallel
psql -c 'create extension postgis' -d parallel
wget http://ftp.geogratis.gc.ca/pub/nrcan_rncan/vector/electoral/2015/pd338.2015.zip
unzip pd338.2015.zip
shp2pgsql -s 3347 -I -D -W latin1 PD_A.shp pd | psql parallel
This set of instructions goes with this presentation deck.
yum install postgis24_10
<?xml version="1.0"?> | |
<OGRVRTDataSource> | |
<OGRVRTWarpedLayer> | |
<OGRVRTLayer name="cartogeom"> | |
<SrcDataSource>cartogeom.csv</SrcDataSource> | |
<GeometryField name="the_geom" encoding="PointFromColumns" x="longitude" y="latitude"> | |
<GeometryType>wkbPoint</GeometryType> | |
<SRS>EPSG:4326</SRS> | |
</GeometryField> | |
<GeometryField name="the_geom_webmercator" encoding="PointFromColumns" x="longitude" y="latitude"> |
import sys | |
import os | |
import gzip | |
import random | |
import md5 | |
from carto.auth import APIKeyAuthClient | |
from carto.sql import SQLClient | |
import requests | |
import hashlib |
So, it looks like COPY support will have to be divided into two parts, /copyfrom
and /copyto
, which is fine.
They are both interesting, in that since the idea is to support scaling, the implementations absolutely must stream, rather than taking files or holding data in memory.
The parts needed are
The parts do in fact all fit together and work, as can been seen in this small proof-of-concept:
-- Large primary geometry | |
select st_distance(e.geom, v.geom) | |
from ed_2017 e, va_ply_17 v | |
where e.ed_abbrev = 'KLA' and v.ed_abbrev != 'KLA'; | |
-- 25s | |
select _ST_DistanceRectTree(e.geom, v.geom) | |
from ed_2017 e, va_ply_17 v | |
where e.ed_abbrev = 'KLA' and v.ed_abbrev != 'KLA'; |
A simple browser-based terminal for running SQL against Carto using the SQL API
git clone git@github.com:CartoDB/cdb-manager.git
./httpserv.py
http://locahost:8000
The REL_10_CARTO PostgreSQL branch and svn-2.4-cartodb branch of PostGIS carry patches to improve performance around our core use cases (generating resolution-appropriate data for rendering in Mapnik and creating vector tiles). They also include patches that make the PostgreSQL planner more likely to pick parallel plans, in particular when using PostGIS functions.
2.4 Aug | 2.4cdb Oct | 2.4cdb Dec | |||||
---|---|---|---|---|---|---|---|
# features | ms | μs | ms | μs |