Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pgiraud
pgiraud / .gitignore
Last active December 22, 2015 13:46
Data to import for ThinkHazard project
g2015*
pierre@ip-10-196-3-47:/tmp$ virtualenv venv
New python executable in venv/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.
pierre@ip-10-196-3-47:/tmp$ venv/bin/pip install flake8==2.2.2
Downloading/unpacking flake8==2.2.2
Downloading flake8-2.2.2.tar.gz
Running setup.py egg_info for package flake8
Downloading/unpacking pyflakes>=0.8.1 (from flake8==2.2.2)
@pgiraud
pgiraud / index.html
Last active May 27, 2016 11:49
Mobile application - Performance comparison
<!DOCTYPE html>
<html ng-app="app">
<head>
<title>Select features example</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.10.1/ol.css" type="text/css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.11.1/ol.js"></script>
@pgiraud
pgiraud / README.md
Last active November 25, 2022 05:29
Polygon intersection with JSTS

This example shows the usage of JSTS to compute the intersection of polygons.

Once the vector layer shows up, you can draw a polygon on the map. Within a small amount of time, you should see the result of intersection highlighted in blue.

Link to demo

@pgiraud
pgiraud / README.md
Last active November 24, 2016 06:31
Polygon intersection with Turf.js

This example shows the usage of Turf.js to compute the intersection of polygons.

Once the vector layer shows up, you can draw a polygon on the map. Within a small amount of time, you should see the result of intersection highlighted in blue.

Link to demo

@pgiraud
pgiraud / index.html
Last active October 5, 2015 13:15
OpenLayers 2 Refresh Vector Layer
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers: Vector Features</title>
<link rel="stylesheet" href="http://dev.openlayers.org/theme/default/style.css" type="text/css">
<link rel="stylesheet" href="http://dev.openlayers.org/examples/style.css" type="text/css">
<script src="http://dev.openlayers.org/OpenLayers.js" type="text/javascript"></script>
@pgiraud
pgiraud / eq_global.py
Created October 1, 2015 08:01
ThinkHazard - EarthQuake Processing
import logging
import sys
import numpy
import rasterio
import fiona
from rasterio import features
from shapely.geometry import shape
from shapely.ops import transform
from functools import partial
import pyproj
@pgiraud
pgiraud / index.html
Last active August 29, 2015 14:26
OL3 interaction select 3.7.0
<!DOCTYPE html>
<html>
<head>
<title>Select features example</title>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.7.0/ol.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.7.0/ol.js"></script>
<style>
@pgiraud
pgiraud / index.html
Last active August 29, 2015 14:25
OpenLayers WMS - Points not showing
<!DOCTYPE html>
<html>
<head>
<title>Tiled WMS example</title>
<script src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.7.0/ol.css" type="text/css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/3.7.0/ol.js"></script>