Skip to content

Instantly share code, notes, and snippets.

@fawcett
fawcett / foss4g_on_github.txt
Created January 16, 2013 04:47
People and projects related to Open Source geospatial that are hosted on GitHub.
Two people in the top 11 active users on GitHub
(https://gist.github.com/2657075)
#5 Dane Springmeyer
#11 Tom MacWright
Repositories
https://github.com/OSGeo
@fawcett
fawcett / basic_point_poly.py
Created March 27, 2013 02:58
This is the first in a series of tests using fiona and shapely to read features from shapefiles and do intersect operations on them. The features represent station points in counties. There are 7142 stations and 87 counties with mildly overlapping bboxes. This example uses the most basic operations with no optimizations. On the test machine, it …
import fiona, time
from shapely.geometry import shape
from shapely.geometry import Point
searchTime = time.time()
stationPath = "C:/stations.shp"
countyPath = "C:/counties.shp"
stationCollect = fiona.open(stationPath,'r')
@fawcett
fawcett / prepped_point_poly.py
Created March 27, 2013 03:06
This is the second in a series of tests using fiona and shapely to read features from shapefiles and do intersect operations on them. The features represent station points in counties. There are 7142 stations and 87 counties with mildly overlapping bboxes. This example adds the speedups and prepared geometries options. On the test machine, it to…
import fiona, time
from shapely.geometry import shape
from shapely.geometry import Point
from shapely.prepared import prep
from shapely import speedups
import sys
searchTime = time.time()
stationPath = "C:/stations.shp"
@fawcett
fawcett / rtree_point_poly.py
Created March 27, 2013 03:19
This is the third in a series of tests using fiona and shapely to read features from shapefiles and do intersect operations on them. The features represent station points in counties. There are 7142 stations and 87 counties with mildly overlapping bboxes. This example adds an RTree index based on the rtree module. The county features are extract…
import fiona, time
from shapely.geometry import shape
from shapely import speedups
from rtree import index
searchTime = time.time()
stationPath = "C:/stations.shp"
countyPath = "C:/counties.shp"
@fawcett
fawcett / rtree_objects_point_poly.py
Last active December 15, 2015 11:09
This is the fourth in a series of tests using fiona and shapely to read features from shapefiles and do intersect operations on them. The features represent station points in counties. There are 7142 stations and 87 counties with mildly overlapping bboxes. This example adds an RTree index based on the rtree module. In this example, the strategy …
import fiona, time
from shapely.geometry import shape
from shapely import speedups
from rtree import index
searchTime = time.time()
stationPath = "C:/stations.shp"
countyPath = "C:/counties.shp"
@fawcett
fawcett / rtree_objects_brute_point_poly.py
Created March 27, 2013 03:37
This is the fifth in a series of tests using fiona and shapely to read features from shapefiles and do intersect operations on them. The features represent station points in counties. There are 7142 stations and 87 counties with mildly overlapping bboxes. This example adds an RTree index based on the rtree module. In this example, the strategy i…
import fiona, time
from shapely.geometry import shape
from shapely import speedups
from rtree import index
searchTime = time.time()
stationPath = "C:/stations.shp"
countyPath = "C:/counties.shp"
@fawcett
fawcett / point_in_poly.py
Last active December 15, 2015 11:39
A more generic function for point polygon intersects when all that you want are the ID pairs from each intersection. (I am sure that the code could be cleaner or written in a functional style. I am very open to any critiques or improvements, how else am I supposed to learn this stuff....)
import fiona
from shapely.geometry import shape
from rtree import index
def pointInPolyIntersect(pointPath, polyPath, pointIdCol, polyIdCol):
"""
This function runs intersect operations on a pair of point and polygon data sets. No
geometries are returned, just a pair of IDs for each intersection. The ID columns are
specified in the args.
@fawcett
fawcett / ckan_examples
Last active September 19, 2017 17:10
Good examples of CKAN use
Some examples of governments or other organizations using CKAN, particularly with spatial data
Official CKAN List of Sites
http://ckan.org/instances/
http://data.gov.uk/dataset/land-cover-map-1990-1km-percentage-subclass-web-map-service-wms
Non-spatial dataset demo with map to show spatial extent
http://demo.ckan.org/dataset/afghanistan-election-data
@fawcett
fawcett / Pondering Portals
Last active December 16, 2015 15:09
A collection of the revisit of the geo portal
Brian Timoney
http://mapbrief.com/2013/02/05/why-map-portals-dont-work-part-i/
http://mapbrief.com/2013/02/07/paralysis-of-choice-why-map-portals-dont-work-part-ii/
http://mapbrief.com/2013/02/11/the-tyranny-of-requirements-why-map-portals-dont-work-part-iii/
http://mapbrief.com/2013/02/19/an-iconography-of-confusion-why-map-portals-dont-work-part-iv/
http://mapbrief.com/2013/02/21/the-waiting-is-the-hardest-part-why-map-portals-dont-work-part-v/
http://mapbrief.com/2012/08/01/how-the-public-actually-uses-local-government-web-maps-metrics-from-denver/
http://mapbrief.com/2013/03/15/your-online-map-is-missing-half-its-audience-more-revealing-web-analytics-from-the-field/