import arcpy, os, tempfile
import is used to bring in another library, here we bring in:
- arcpy which is the esri library and
- os which for Operating system things
- tempfile is for making temperary files
-- Functions to create and draw histograms with PostgreSQL. | |
-- | |
-- psql# WITH email_lengths AS ( | |
-- -# SELECT length(email) AS length | |
-- -# FROM auth_user | |
-- -# LIMIT 100 | |
-- -# ) | |
-- -# SELECT * FROM show_histogram((SELECT histogram(length, 0, 32, 6) FROM email_lengths)) | |
-- bucket | range | count | bar | cumbar | cumsum | cumpct | |
-- --------+-------------------------------------+-------+--------------------------------+--------------------------------+--------+------------------------ |
# This is a simplified version of what we're using in production for drinksoma.com | |
namespace :mosql do | |
task :run => :environment do | |
conf_path = Rails.root.join('config', 'collections.yml') | |
cmd = "mosql -c #{conf_path} --sql #{ENV['MOSQL_POSTGRES_URI']} --mongo #{ENV['MOSQL_MONGO_URI']}" | |
IO.popen(cmd) do |child| | |
trap('TERM') { Process.kill 'INT', child.pid } | |
$stdout.sync = true |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title></title> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> | |
<style type='text/css'> | |
body { | |
background:#000; | |
color:#fff; |
<script src="https://rawgit.com/Esri/Terraformer/master/terraformer.js"></script> | |
<script src="https://rawgit.com/Esri/terraformer-arcgis-parser/master/terraformer-arcgis-parser.js"></script> | |
<!-- CDN or locally hosted is ideal but I'm using raw github so that we get error reporting within the unminified source | |
<script src="http://cdn-geoweb.s3.amazonaws.com/terraformer/1.0.4/terraformer.min.js"></script> | |
<script src="http://cdn-geoweb.s3.amazonaws.com/terraformer-arcgis-parser/1.0.4/terraformer-arcgis-parser.min.js"></script> | |
--> | |
<script> | |
var input = { | |
"x": -66.796875, | |
"y": 20.0390625, |
# This is kind of long. It should be a lot simpler in the future, once these steps are done. | |
# Clone repo: | |
git clone https://github.com/CityOfMesaAZ/MuniciPal.git mesa-municipal | |
# get into repo | |
cd mesa-municipal | |
# Add the upstream repository: | |
git remote add upstream https://github.com/codeforamerica/MuniciPal.git |
The Leaflet JS mapping library has lots of plugins available. The Leaflet package for R provides direct support for some, but far from all, of these plugins, by providing R functions for invoking the plugins.
If you as an R user find yourself wanting to use a Leaflet plugin that isn't directly supported in the R package, you can use the technique shown here to load the plugin yourself and invoke it using JS code.