Skip to content

Instantly share code, notes, and snippets.

View jsanz's full-sized avatar
🗺️
Mapping

Jorge Sanz jsanz

🗺️
Mapping
View GitHub Profile
@jsanz
jsanz / ogr2ogr.sh
Last active August 29, 2015 14:02
ogr2ogr 23030->25830
# Command to use the NTV2 grid file correctly to convert
# from 23030 (ED50) to 25830 (ETRS89), both in UTM30N
# hint: define all the f$cking SRS params
ogr2ogr \
-t_srs "+proj=utm +zone=30 +ellps=GRS80 +units=m +nadgrids=/path/to/sped2et.gsb" \
-s_srs "epsg:23030" \
-a_srs "epsg:25830" \
-f "ESRI Shapefile" output_shp_25830.shp input.shp
@jsanz
jsanz / README.md
Last active August 29, 2015 14:02
Charla sobre perspectivas profesionales para TIG 2014
@jsanz
jsanz / README.md
Last active August 29, 2015 14:03
HTML example
@jsanz
jsanz / map-styling.html
Created July 8, 2014 21:04
Styling on the Open Layers workshop
<!DOCTYPE html>
<html>
<head>
<title>My Map</title>
<link rel="stylesheet" href="openlayers/theme/default/style.css" type="text/css">
<style>
#map-id {
width: 512px;
height: 256px;
}
@jsanz
jsanz / README.md
Last active November 11, 2019 13:20
OSGeo Charter Members

OSGeo Charter Members data

Check the viz.

What is this repository for?

This is a simple exercise to learn D3 basics using a data set I have at hand, the charter members of the Open Source Geospatial Foundation OSGeo.

@jsanz
jsanz / charter-members-scrapping.py
Created August 1, 2014 18:49
Scrap Charter Members lines for electronic voting
# Simple script to take from the OSGeo wiki the data to
# print on the console the lines to be used on the
# electronic voting system to produce meaninful
# questions with links and info.
from BeautifulSoup import BeautifulSoup
import urllib
nominations_url = 'http://wiki.osgeo.org/wiki/New_Member_Nominations_2014'
response = urllib.urlopen(nominations_url)
@jsanz
jsanz / index.html
Last active August 29, 2015 14:04
Minimal CartoDB visualization with the CartoDB.js library
<!DOCTYPE html>
<html>
<head>
<title>Trying to hide the layers| CartoDB.js</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<link rel="shortcut icon" href="http://cartodb.com/assets/favicon.ico" />
<style>
html, body, #map {
height: 100%;
@jsanz
jsanz / README.md
Last active January 9, 2017 13:07
OL3 map from Google Doc forms

This is an example of extending the OL3 [TextFeature] format class to parse the data coming from a Google [Form] backed by a public Google [Spreadsheet].

Add an event (name, web and coordinates) and check the [demo].

The magic comes from calling the [JSON] version of the spreadsheet. The weirdest part is the owz14uv string that I had to guess thanks to this [blog post].

@jsanz
jsanz / README.md
Last active August 29, 2015 14:21
Fill empty space between two polygons

Click on the space between any of the pairs of polygons to update the map.

@jsanz
jsanz / README.md
Last active August 18, 2016 21:45
Fill the space between two polygons given two points

This is a demo for an SQL function defined in CartoDB. The function takes two adjacent polygons and two points near their borders and return a polygon that fills the space between those polygons up to those points.

To execute the geoprocess draw to adjacent polygons and two points on their borders. Draw a new point or a new polygon to execute again the process.

The SQL called then is:

SELECT ST_AsGeoJSON(
  fillempty(
 polygon1, polygon2,