{ | |
"version": 8, | |
"name": "Positron", | |
"metadata": { | |
"mapbox:autocomposite": false, | |
"mapbox:type": "template", | |
"mapbox:groups": { | |
"b6371a3f2f5a9932464fa3867530a2e5": { | |
"name": "Transportation", | |
"collapsed": false |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Save SVG - Leaflet</title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> | |
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js"></script> | |
<script src="https://unpkg.com/leaflet-image@latest/leaflet-image.js"></script> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title></title> | |
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | |
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.js'></script> | |
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v2.6.0/mapbox-gl.css' rel='stylesheet' /> | |
<link href='https://www.mapbox.com/base/latest/base.css' rel='stylesheet' /> |
This example shows how to convert from a Mapbox-gl map projection to a d3.geo Mercator projection. This allows you to take full advantage of all the d3.geo based functions and examples while also leveraging the power and ease-of-use of mapbox-gl
Much credit goes to @vicapow who developed viewport-mercator-project where he figured out the necessary calculations to make this work.
Built with blockbuilder.org
(this writeup supplements a computational journalism assignment)
Jeremy Singer-Vine has been working on a new PDF-to-text/spreadsheet library native to Python: pdfplumber
The California WARN Act PDFs can be found at:
#Python 2.7.6 | |
#DemergePDF.py | |
#Gets raw_inputs of 1 PDF file names from user and demerge into 2 | |
import PyPDF2 | |
import os | |
def getFileNameFromUser (file, path): | |
pdf_file_name = raw_input("Enter {0} name: ".format(file)) | |
if pdf_file_name in os.listdir(path): |
// Post a BASE64 Encoded PNG Image to facebook | |
function PostImageToFacebook(authToken) { | |
var canvas = document.getElementById("c"); | |
var imageData = canvas.toDataURL("image/png"); | |
try { | |
blob = dataURItoBlob(imageData); | |
} catch (e) { | |
console.log(e); | |
} | |
var fd = new FormData(); |
First put all the shapefiles you want merged in one directory than I run this bash script in the folder
#!/bin/bash
file="./final/merge.shp"
for i in $(ls *.shp)
do
This is an extension of DJ Adams' excellent SheetAsJSON Google Apps Script, which provides a way to GET a published Google Spreadsheet as a JSON feed. This version allows generic filtering for terms, more specific control over which rows to parse, and correct MIME type for JSONP output.
The following parameters are required for the script to work.
https://script.google.com/macros/s/AKfycbzGvKKUIaqsMuCj7-A2YRhR-f7GZjl4kSxSN1YyLkS01_CfiyE/exec?
+ id=<spreadsheet key>
+ sheet=<sheet name on spreadsheet>