Skip to content

Instantly share code, notes, and snippets.

@caseycesari
caseycesari / webmap_as_json.json
Created September 18, 2019 12:57
Sample "Web Map As JSON"
{"mapOptions":{"extent":{"xmin":2722939.17518007,"ymin":294359.45275287,"xmax":2723337.1027269,"ymax":294781.177369428,"spatialReference":{"wkid":2272}}},"operationalLayers":[],"baseMap":{"title":"Ortho Layer","baseMapLayers":[{"urlTemplate":"https://tiles.arcgis.com/tiles/fLeGjb7u4uXqeF9q/arcgis/rest/services/CityImagery_2019_3in/MapServer/tile/{level}/{row}/{col}","type":"WebTiledLayer","tileInfo":{"rows":256,"cols":256,"dpi":96,"format":"JPEG","compressionQuality":75,"storageFormat":"esriMapCacheStorageModeCompact","origin":{"x":-20037508.342787,"y":20037508.342787},"spatialReference":{"wkid":102100,"latestWkid":3857,"wkt":"PROJCS['WGS_1984_Web_Mercator_Auxiliary_Sphere',GEOGCS['GCS_WGS_1984',DATUM['D_WGS_1984',SPHEROID['WGS_1984',6378137.0,298.257223563]],PRIMEM['Greenwich',0.0],UNIT['Degree',0.0174532925199433]],PROJECTION['Mercator_Auxiliary_Sphere'],PARAMETER['False_Easting',0.0],PARAMETER['False_Northing',0.0],PARAMETER['Central_Meridian',0.0],PARAMETER['Standard_Parallel_1',0.0],PARAMETER['Auxiliary_
@caseycesari
caseycesari / dummy-web-server.py
Last active May 10, 2017 20:35 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
Send a HEAD request::
curl -I http://localhost
Send a POST request::
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[-76.65763863756668,40.78288610675234],[-76.56576519352502,40.926703681283904],[-76.23368436877388,41.10270945538174],[-76.02039987304963,41.41077361773745],[-75.79513641664575,41.542990010308046],[-75.74156424622451,41.63244773308856],[-75.74858885056851,41.81832105419328],[-75.84706276885875,41.971320985808696],[-75.86057772198644,42.092126244647204],[-75.68602101371745,42.401617508754654],[-75.54060375817696,42.488160627320845],[-75.1573737523487,42.57720550841206],[-74.96525070603018,42.68971761440865],[-74.62602604330955,42.75102435696016],[-74.42468601579316,42.69092751348241],[-74.14868337354655,42.304959025622715],[-74.07017869303017,41.94345790550482],[-74.17109756599318,41.75697770172915],[-74.13473392392123,41.63645296571696],[-74.1641626470146,41.478517189449946],[-74.36116474240607,41.23488664938731],[-74.26383293291428,41.092492144883714],[-74.27778743989961,40.880635149000646],[-74.38492369405988,40.743058754980815],[-74.59710789289
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@caseycesari
caseycesari / avi.js
Created April 27, 2013 18:41
old avi map
if (typeof ppiin === "undefined" || !ppiin) {
var ppiin = {};
ppiin.avi = {}
}
ppiin.avi.Point = Backbone.Model.extend({
initialize: function () {
this.convertFromDollars();
this.checkLocation();
this.dispatcher = ppiin.avi.dispatcher
},
@caseycesari
caseycesari / neighborhoods.mak
Last active December 15, 2015 06:19
Get the latest version of the Azavea Neighborhoods shapefile and convert it to topojson.
Neighborhoods_Philadelphia.shp:
git clone git@github.com:azavea/geo-data.git
touch geo-data/Neighborhoods_Philadelphia/Neighborhoods_Philadelphia.shp
neighborhoods.json: Neighborhoods_Philadelphia.shp
ogr2ogr -f "GeoJSON" -t_srs "EPSG:4326" neighborhoods.json geo-data/Neighborhoods_Philadelphia/Neighborhoods_Philadelphia.shp
neighborhoods-topo.json: neighborhoods.json
topojson -o neighborhoods-topo.json --id-property NAME neighborhoods.json
@caseycesari
caseycesari / avi-map-sql.md
Last active December 14, 2015 14:29
The SQL for creating a parcel layer simliar to the one that powers http://apps.axisphilly.org/avi-map

These commands are all run within the psql command line tool.

Create table for tax year 2013 data

CREATE TABLE tx_2013 (
  Acct_Num varchar(9),
  Address text,
  Unit text,
  Homestd_Ex text,

Prop_Cat text,

@caseycesari
caseycesari / avi-map-carto.scss
Created March 6, 2013 17:41
Carto styled used to style the parcel layer on http://apps.axisphilly.org/avi-map.
#parcelswtax {
polygon-opacity: 0.8;
[tax_change > 4] { polygon-fill: #7F0000 }
[tax_change > 2][tax_change <= 4] { polygon-fill: #B2182B }
[tax_change > 1][tax_change <= 2] { polygon-fill: #D6604D }
[tax_change > .5][tax_change <= 1] { polygon-fill: #F4A582 }
[tax_change > .1] [tax_change <= .5] { polygon-fill: #FDDBC7 }
[tax_change >= -.1][tax_change <= .1] { polygon-fill: #777 }
[tax_change < -.1] [tax_change > -.5] { polygon-fill: #bedef0 }
axis.Views.ArticleContainer = Backbone.View.extend({
tagName: 'div',
className: 'row article-container view',
initialize: function() {
this.template = _.template($('#single-article-container-template').html());
this.article = new axis.Views.Article({model: this.model});
this.sidebar = new axis.Views.ArticleSidebar({model: this.model});
},