Skip to content

Instantly share code, notes, and snippets.

@danbjoseph
danbjoseph / README.md
Created April 15, 2019 19:39 — forked from Sumbera/README.md
Many points with d3 and leaflet

Testing SVG limits of plotting points on map using D3, Leaflet following this base sample: http://bost.ocks.org/mike/leaflet. However instead of scaling SVG in deep zooms, I am using Enter/Update/Exit pattern from D3 to dynamically update points on map. This has been prototyped also here http://bl.ocks.org/sumbera/9972460 with brushing of 100T points.

For zooming out (causing all points to be displayed), I am filtering out points that can't be effectively visible, thus reducing number of points in SVG. (check console for log output).

This sample is using real data of 24T coordinates, with this points are clustered around cities, rather than artifically randomized. Real number of rendered points / removed points can be seen in console.log

@danbjoseph
danbjoseph / .block
Last active June 27, 2019 18:13
Calendar heat map (horizontal)
license: gpl-3.0
@danbjoseph
danbjoseph / posm-deployment-alternative.md
Created August 14, 2017 14:38
Loading OSM data to a POSM when the POSM doesn't have a direct connection to the internet
  1. Connect to the internet and download area from export.posm.io
  • For Select Export Formats: choose OSMAnd OBF and OSM PBF
  • File will be name-of-bundle.tar.gz
  1. Place file on desktop
  2. Connect to POSM wifi
  3. In terminal:
  • Navigate to desktop directory in terminal
  • Command to use: scp name-of-bundle.tar.gz root@posm.io:/opt//posm-www
  • Password is posm
  • If you get this error: WARNING: REMOTE HOST IDENTIFACTION HAS CHANGED!
@danbjoseph
danbjoseph / mac_setup.md
Last active June 24, 2018 09:40
Mac OS X setup

OSX preferences

#show status bar in finder
defaults write com.apple.finder ShowStatusBar -bool true

#show path bar in finder
defaults write com.apple.finder ShowPathbar -bool true

#avoid creating .DS_Store files on network volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
@danbjoseph
danbjoseph / mapillary_setup.md
Last active April 7, 2019 19:02 — forked from dalekunce/mapillary_setup.md
Mapillary Setup and Tools and image importants

#merge gpx files

gpsbabel -i gpx -f file1.gpx -f file2.gpx -o gpx -F merged.gpx

#attach GPX to photo get needed libs first

pip install gpxpy
brew install pyexiv2 exiftool
git clone https://github.com/mapillary/mapillary_tools.git
/*
This has been generated by the overpass-turbo wizard.
The original search was:
“newer:"2016-07-14T19:01:00Z" and building=*”
*/
[out:json][timeout:25];
// gather results
(
// query part for: “newer:"2016-07-14T19:01:00Z" and building=*”
node(newer:"2016-07-14T19:01:00Z")["building"]({{bbox}});
[out:json][timeout:25];
// gather results
(
// query part for: “newer:"2015-10-09T19:01:00Z"”
node._(changed:"2016-06-28T10:01:00Z","2016-06-28T13:01:00Z")({{bbox}});
way._(changed:"2016-06-28T10:01:00Z","2016-06-28T12:01:00Z")({{bbox}});
area._(changed:"2016-06-28T10:01:00Z","2016-06-28T12:01:00Z")({{bbox}});
relation._(changed:"2016-06-28T10:01:00Z","2016-06-28T12:01:00Z")({{bbox}});
);
// print results
@danbjoseph
danbjoseph / .block
Last active July 9, 2016 21:00
Metro warp
We couldn’t find that file to show.
@danbjoseph
danbjoseph / .block
Last active January 25, 2019 21:11
Calendar heat map (vertical)
license: gpl-3.0
@danbjoseph
danbjoseph / lesson3.md
Last active June 7, 2016 20:19
psu geog585 lesson 3

to batch process the shapefiles save the following

#!/bin/bash
cd /Users/danbjoseph/Documents/PSU/psu_geog585/lesson3/PhiladelphiaBaseLayers/
for f in *.shp
  do ogr2ogr -skipfailures -clipsrc /Users/.../PhiladelphiaBaseLayers/clipFeature/city_limits.shp /Users/.../PhiladelphiaBaseLayers/clipped/$f /Users/.../PhiladelphiaBaseLayers/$f
  ogr2ogr -s_srs EPSG:4326 -t_srs EPSG:3857 /Users/.../PhiladelphiaBaseLayers/clippedAndProjected/$f /Users/.../PhiladelphiaBaseLayers/clipped/$f
  touch /Users/.../PhiladelphiaBaseLayers/clippedAndProjected/${f%.*}.qpj
  echo 'PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUT