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 OSMBuildings=function(){function La(a,c){var b=a.x-c.x,e=a.y-c.y;return b*b+e*e}function rb(a){for(var c=0,b=0,e=0,d=a.length-3;e<d;e+=2)c+=a[e],b+=a[e+1];a=(a.length-2)/2;return{x:c/a<<0,y:b/a<<0}}function ta(a,c){var b={};a/=U;c/=U;b[sb]=0>=c?90:1<=c?-90:Ma*(2*tb(ub(I*(1-2*c)))-M);b[vb]=360*(1===a?1:(a%1+1)%1)-180;return b}function Na(a,c,b){function e(a){if("XDomainRequest"in fa&&a!==d.readyState&&(d.readyState=a,d.onreadystatechange))d.onreadystatechange()}a=a.replace(/\{ *([\w_]+) *\}/g, | |
function(a,b){return c[b]||a});var d="XDomainRequest"in fa?new XDomainRequest:new XMLHttpRequest;d.onerror=function(){d.status=500;d.statusText="Error";e(4)};d.ontimeout=function(){d.status=408;d.statusText="Timeout";e(4)};d.onprogress=function(){e(3)};d.onload=function(){d.status=200;d.statusText="Ok";e(4)};d.onreadystatechange=function(){4===d.readyState&&d.status&&!(200>d.status||299<d.status)&&b&&d.responseText&&b(JSON.parse(d.responseText))};e(0);d.open("GET",a);e(1);d.send(null);e(2);return d} | |
function V(){W.re |
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
L.AnimatedMarker = L.Marker.extend({ | |
options: { | |
// meters | |
distance: 200, | |
// ms | |
interval: 1000, | |
// animate on add? | |
autoStart: true, | |
// callback onend | |
onEnd: function(){}, |
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
> db.geospacial.find( { geo :{ $geoIntersects :{ $geometry : { type : "Point" , coordinates : [2.188854217529297,41.38875469223532] } } } }, {_id:1} ) | |
{ "_id" : ObjectId("526bec2067dfe0c38d8b2ffe") } | |
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
> mongo | |
> use geospatial | |
switched to db geospatial | |
> db.geometrias.find() | |
> db.geometrias.insert({geo: {type: "Polygon",coordinates: [[ [2.1849489212036133, 41.38680675397411], [2.1849489212036133, 41.39039671055913], [2.1898841857910156, 41.39039671055913], [2.1898841857910156, 41.38680675397411],[2.1849489212036133, 41.38680675397411] ]] }}) | |
> db.geometrias.insert({geo: {type: "Polygon",coordinates: [[ [2.186858654022217, 41.389913768298356], [2.186858654022217, 41.392392833843616], [2.194089889526367, 41.392392833843616], [2.194089889526367, 41.389913768298356], [2.186858654022217, 41.389913768298356] ]] }}) |
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
<script src="https://embed.github.com/view/geojson/mappingCo/BCN/master/MurallaRomana.geojson"></script |
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
layer.on('featureClick', function(e, pos, latlng, data) { | |
charts(data.cartodb_id); | |
}); |
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 charts(data_id) { | |
var campo = data_id; | |
var url ="http://{username}.cartodb.com/api/v1/sql?q=SELECT nbarri,rfd_2008,rfd_2009,rfd_2010, rfd_2011 FROM {tablename} WHERE cartodb_id="+campo+"" | |
console.log(url); | |
var cartoItems = []; | |
$.getJSON(url, function(data) { | |
$.each(data.rows, function(key, val) { | |
cartoItems.push(val.rfd_2008); | |
cartoItems.push(val.rfd_2009); | |
cartoItems.push(val.rfd_2010); |
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 creaChart(cartoData,barrio){ | |
$('#highchart').highcharts({ | |
chart: { | |
type: 'line', | |
marginRight: 50, | |
marginBottom: 50, | |
marginTop:100 | |
}, | |
title: { | |
text: 'Distribución Renta BCN | Indice RFD', |
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
__author__ = 'avbcmati' | |
# -*- coding: utf-8 -*- | |
import csv | |
#creo un fichero con los datos | |
datos = [ | |
['Teclado', 10, 56.5], | |
['Torre', 9, 99.5], | |
['Pantalla', 100, 56.5] |
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
<html> | |
<head> | |
<title>Duero</title> | |
<script src="http://openlayers.org/api/OpenLayers.js"></script> | |
<link rel="stylesheet" href="openlayers/theme/default/style.css" type="text/css"> | |
<style> | |
#map-id { | |
width: 1024px; | |
height: 512px; | |
} |
NewerOlder