Skip to content

Instantly share code, notes, and snippets.

@sigon426
sigon426 / README.md
Last active August 29, 2015 14:05
esri-leaflet, dynamic layer with custom popup
@sigon426
sigon426 / README.md
Last active August 29, 2015 14:12
Using Turf to find gas station within a route

Gas stations within route

Show the gas stations within a route using TurfJS

http://turfjs.org/

@sigon426
sigon426 / README.md
Last active August 29, 2015 14:16
Gas stations price heatmap

Spain gas station price heatmap

Use heatmap.js to see the Spanish gas stations that serve gasolina95 over 1.3€/litre.

Gas station price list last updated on 7-mars 2015.

Data from geoportalgasolineras.es.

@sigon426
sigon426 / CuencaDuero
Created March 22, 2013 20:54
Mapa de la cuenca del Duero realizado con OpenGeo y Openlayers, con Google Maps como mapa base y dos capas ríos y embalses.
<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;
}
__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]
function creaChart(cartoData,barrio){
$('#highchart').highcharts({
chart: {
type: 'line',
marginRight: 50,
marginBottom: 50,
marginTop:100
},
title: {
text: 'Distribución Renta BCN | Indice RFD',
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);
layer.on('featureClick', function(e, pos, latlng, data) {
charts(data.cartodb_id);
});
@sigon426
sigon426 / gist:6306589
Last active December 21, 2015 12:38
GeoJson on Github <embed map>
<script src="https://embed.github.com/view/geojson/mappingCo/BCN/master/MurallaRomana.geojson"></script
> 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] ]] }})