Skip to content

Instantly share code, notes, and snippets.

View Rub21's full-sized avatar
🐕

Ruben L. Mendoza Rub21

🐕
View GitHub Profile

Mapbox in Mapgive's Workshop in Cusco-Peru

Last week Ruben and I took part in a workshop in Cuzco with Mikel and Erika from MapGive. This Workshop was part of the Cusco Secondary Cities Project. There were four learning processes involved in the workshop;

  • Data collection using OpenMapkit, Fieldpaper and Mapillary.
  • Addition of the data collected to OpenStreetMap.
  • teaching the process of extracting data from OpenstreetMap
  • using extracted data in Cuscogeonode and Mapbox.com.
# First, clear out any old mapnik or node.js installs that might conflict
sudo apt-get purge libmapnik libmapnik-dev mapnik-utils nodejs
# Also clear out any old ppa's that might conflict
sudo rm /etc/apt/sources.list.d/*mapnik*
sudo rm /etc/apt/sources.list.d/*developmentseed*
sudo rm /etc/apt/sources.list.d/*chris-lea*
# add new ppa's
echo 'yes' | sudo apt-add-repository ppa:chris-lea/node.js
@Rub21
Rub21 / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@Rub21
Rub21 / scale.md
Last active August 29, 2015 14:15 — forked from ian29/scale.md

scale, and selecting specific zoom levels

Mapnik is very smart about converting map scale to zoom level. As a secret/power user feature, Mapnik exposes a !scale_denominator! variable that changes according to the zoom level and + latitude of the vector tile being rendered. Read about the Mapnik's !scale_denominator! variable here.

With some postgres magic, the !scale_denominator lets us control which features appear and disappear, within a layer.

Concretely this is a two-part process. First you will need to load the following z() function into your PostGIS database:

CREATE OR REPLACE FUNCTION public.z(scaledenominator numeric)

Getting Started with NPM (as a developer)- Segir si funciona

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "you@example.com"
npm set init.author.url "http://yourblog.com"

npm adduser

@Rub21
Rub21 / client.html
Last active August 29, 2015 14:17 — forked from diorahman/client.html
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');
@Rub21
Rub21 / README.md
Last active August 29, 2015 14:17 — forked from tmcw/README.md
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
@Rub21
Rub21 / README.md
Last active August 29, 2015 14:24 — forked from joyrexus/README.md

Demo of multipart form/file uploading with hapi.js.

Usage

npm install
npm run setup
npm run server

Then ...