This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --data '{"type":"Point","coordinates":[1,2]}' http://geojsonlint.com/validate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bike Types | |
Mountain, Road, BMX, Frame | |
Pictures | |
Yes, No | |
No Wal-mart bikes | |
-next -mongoose -huffy -roadmaster -schwinn -landrider -magna -disney | |
No women's bikes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scraperwiki | |
import lxml.html | |
html = scraperwiki.scrape("http://www.greatamericanbeerfestival.com/at-the-festival/breweries-at-the-2012-festival") | |
root = lxml.html.fromstring(html) | |
i = 1 | |
for tr in root.cssselect("#brewery_table tbody tr"): | |
tds = tr.cssselect("td") | |
data = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var qs = function () { | |
var query_string = {}; | |
var query = window.location.search.substring(1); | |
var vars = query.split("&"); | |
for (var i=0;i<vars.length;i++) { | |
var pair = vars[i].split("="); | |
// If first entry with this name | |
if (typeof query_string[pair[0]] === "undefined") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var geojson = L.geoJson(data, { | |
// style for all vector layers (color, opacity, etc.) (optional) | |
getStyle: function (feature) { | |
return feature.properties && feature.properties.style; | |
}, | |
// function for creating layers for GeoJSON point features (optional) | |
pointToLayer: function (feature, latlng) { | |
return L.marker(latlng, { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// parseInt usually works just fine | |
parseInt("8") // outputs 8 | |
// until you are padded left with zeros | |
parseInt("08") // outputs 0 | |
// easy to fix with radix parameter | |
parseInt("08", 10) // outputs 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"currentVersion": 10.01, | |
"id": 1, | |
"name": "Intersections", | |
"type": "Feature Layer", | |
"description": "", | |
"definitionExpression": "", | |
"geometryType": "esriGeometryPoint", | |
"copyrightText": "", | |
"parentLayer": null, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (C) 2009 Camptocamp | |
# | |
# This file is part of MapFish Server | |
# | |
# MapFish Server is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright (C) 2009 Camptocamp | |
# | |
# This file is part of MapFish Server | |
# | |
# MapFish Server is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Lesser General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@geojsonify | |
def geojson(self, z=False, x=False, y=False): | |
"""GET /{z}/{x}/{y} return features within tile bounds.""" | |
return self.protocol.geojson(request, response, z=z, x=x, y=y) |