- addr:city=State College
- addr:country=US
- addr:housenumber=208
- addr:postcode=16801
- addr:state=PA
- addr:street=West College Avenue
- amenity=restaurant
- contact:facebook=https://www.facebook.com/Tadashi-Japanese-Restaurant-1474891926063036/timeline/?ref=br_rs
- cuisine=japanese
SELECT avg(mindist) AS avgNND | |
FROM | |
( SELECT aname, min(dist) AS mindist | |
FROM | |
( SELECT a.geometry, ST_Distance(a.geometry, b.geometry)*0.00062 AS dist, | |
a.name AS aname, b.name AS bname | |
FROM parks AS a, parks AS b | |
WHERE a.name <> b.name | |
ORDER BY aname, dist ASC ) AS distances |
SELECT name FROM upstate ORDER BY name; | |
SELECT * FROM | |
Crosstab('SELECT row.name::text, col.name::text, (ST_Distance(row.geometry, col.geometry, true)*0.00062)::text AS dist | |
FROM upstate AS row, upstate AS col | |
ORDER BY 1, 2;' | |
) AS | |
ct(row_name text, Auburn text, Binghamton text, Elmira text, Ithaca text, Rochester text, Syracuse text); |
DROP TABLE qlayer; | |
SELECT distances.dist, parcels.parcel_id, parcels.geometry INTO qlayer FROM | |
( SELECT min(ST_Distance(parcels.geometry,firm.geometry)::integer) AS dist, parcels.parcel_id | |
FROM parcels,firm | |
WHERE firm.zone = 'X500' | |
GROUP BY parcels.parcel_id | |
ORDER BY dist DESC | |
) AS distances, |
https://www.codementor.io/devops/tutorial/getting-started-postgresql-server-mac-osx
Use Homebrew to install Postgres and PostGIS. If Homebrew is not installed, run:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Zoom | Tile size at equator (km) | Resolution at equator (m) |
---|---|---|
0 | 22568 | 88155 |
1 | 11284 | 44078 |
2 | 7656 | 29904 |
3 | 4577 | 17881 |
4 | 2443 | 9544 |
5 | 1244 | 4861 |
6 | 625 | 2442 |
7 | 313 | 1223 |
Every ten years, after the decennial census and as mandated by the U.S. Constitution, states are subdivided into sets of congressional districts for representation in the U.S. House of Representatives. GovTrack provides maps of these congressional boundaries for your reference and makes the maps available for embedding on other sites. Beyond looking up the district for a specific address, maps introduce a geographic context that tells us about the demographics and rural/urban nature of a district, as well as whether that district's boundaries show signs of gerrymandering.
Recently, we redesigned GovTrack's map of congressional districts to be more responsive, more legible, and easier to reproduce. To create these maps, we used data from the U.S. Census Bureau, a few cartographic tricks and tools, and web map hosting from Mapbox. I'll explain the process here, and you can reference the exact workflow [on GitHub](https://github.com/aaron
HTML: | |
<link rel="stylesheet" type="text/css" href="//fonts.googleapis.com/css?family=Open+Sans" />CSS: | |
h1 { | |
font-family: 'Open Sans'; | |
font-size: 36px; | |
font-style: normal; | |
font-variant: normal; | |
font-weight: bold; | |
line-height: 54px; | |
} |