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
# https://stackoverflow.com/questions/23629592/how-can-i-select-the-top-2-values-in-a-column-per-column-and-report-this-with-bo | |
t <- structure(c(0.333333333333333, 0.333333333333333, 0.333333333333333, | |
0.333333333333333, 0.333333333333333, 0.333333333333333, 0.166666666666667, | |
0.166666666666667, 0.166666666666667, 0.166666666666667, 0.166666666666667, | |
0.166666666666667, 0.166666666666667, 0.166666666666667, 0.166666666666667, | |
0.166666666666667, 0.166666666666667, 0.166666666666667, 0.333333333333333, | |
0.333333333333333, 0.333333333333333, 0.333333333333333, 0.333333333333333, | |
0.333333333333333), .Dim = c(6L, 4L), .Dimnames = list(c("1", | |
"2", "3", "4", "5", "6"), c("123", "124", "125", "126"))) |
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
# Docs | |
# https://rapidapi.com/skyscanner/api/skyscanner-flight-search?endpoint=5a9b572de4b06ec3937b1296 | |
# | |
# Using the skyscanner API | |
# install unirest into virtual env "flight" | |
# | |
# activate virtualenv | |
# |
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
from django.contrib.gis.geos import GEOSGeometry | |
# sample data | |
geom_1 = GEOSGeometry('POLYGON((-71.8 42.1,-70.6 42.1,-70.5 41.2,-71.8 41.2,-71.8 42.1))') | |
geom_2 = GEOSGeometry('POLYGON((-71.12 42.23,-71.48 42.34,-71.52 42.55,-71.12 42.23))') | |
geom_3 = GEOSGeometry('POLYGON((-73.12 42.23,-71.48 42.34,-71.52 42.55,-73.12 42.23))') | |
polygons = [geom_1, geom_2, geom_3] | |
# get first polygon | |
polygon_union = polygons[0] |
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
/* | |
Feb 5, 2013 | |
Original source from here: http://punkish.org/Voronoi-Diagrams-In-PostGIS | |
Updated old PostGIS function names to work with PostGIS2.0 (buffer, intersect, intersection and srid) | |
-djq | |
This function uses the deldir library in R to generate voronoi polygons for | |
an input set of points in a PostGIS table. | |
Original function by Mike Leahy mgleahy at alumni.uwaterloo.ca |
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
#!/bin/bash | |
# | |
# Install Postgres 9.1, PostGIS 2.0 and pgRouting on a clean Ubuntu 12.04 install (64 bit) | |
# updated to PostGIS 2.0.1 | |
# basics | |
apt-get install python-software-properties | |
apt-add-repository ppa:sharpie/for-science # To get GEOS 3.3.3 | |
# install the following pacakages |
OlderNewer