Categories
Analytics Programming Spatial stuff

How to display a Choropleth map in Jupyter Notebook

Here is the code: %matplotlib inline import geopandas as gpd import matplotlib as mpl # make rcParams available (optional) mpl.rcParams[’figure.dpi’]= 144 # increase dpi (optional)   world = gpd.read_file(gpd.datasets.get_path("naturalearth_lowres")) world = world[world.name != ‘Antarctica’] # remove Antarctica (optional) world[’gdp_per_person’] = world.gdp_md_est / world.pop_est g = world.plot(column=’gdp_per_person’, cmap=’OrRd’, scheme=’quantiles’) g.set_facecolor(’#A8C5DD’) # make the ocean blue (optional)%matplotlib […]

Categories
Programming Spatial stuff

Python script for geocoding a text file

Assume that you have a file with some locations as text with one location per line. For example, here are some school names in Copenhagen, Denmark, stored in schools.csv: Hyltebjerg Skole Heibergskolen Ellebjerg Skole Katrinedals Skole Peder Lykke Skolen Amager Fælled Skole Tingbjerg Heldagsskole Øster Farimagsgades Skole Sankt Annæ Gymnasiums Grundskole Lykkebo Skole Randersgades Skole […]

Categories
Databases Spatial stuff

How to work with spatial data in Amazon Redshift

While Redshift does not offer native support for spatial data, indexes and functions, there exists a partial workaround. Redshift supports Python UDFs and can also load custom Python libraries. Out of the box, Redshift has numpy, scipy, pandas and many other useful Python libraries. For spatial functionality, one saving grace is the high quality spatial […]

Categories
Programming Spatial stuff Systems

Geocoding Python function for PostgreSQL

Gratefully making use of what others have provided, i.e. geopy, Google and plpythonu. Type to hold result of geocoding: CREATE TYPE geocoding AS ( place text, latitude DOUBLE PRECISION, longitude DOUBLE PRECISION );CREATE TYPE geocoding AS ( place text, latitude double precision, longitude double precision ); Function that does the actual geocoding (to be extended […]

Categories
Spatial stuff

The new Google Maps: Explorers delight!

Being interested in maps in general, and specifically vector data, of course I had to take the new Google Maps for a spin. Vector data aside, what fascinated me most was the option to display photos of the current location in the bottom of the screen. Seeing actual photos is incredibly more useful than being […]

Categories
Spatial stuff

List of cloud GIS platforms

This is work in progress… http://geocommons.com/ http://www.giscloud.com/ http://cartodb.com/ http://www.google.com/drive/start/apps.html#fusiontables http://tables.googlelabs.com/ Home http://mapbox.com/ http://mapquest.com http://maps.google.com

Categories
Spatial stuff

Downloading environment data for Denmark

This post is very Denmark-specific. I was annoyed that downloading environmental data from the ministry of the environment was so cumbersome. Long story made short, here are download URLs for environmental data: Dataset URL Kirkebyggelinjer KIRKEBYGGELINJER_SHAPE.zip Skovbyggelinjer SKOVBYGGELINJER_SHAPE.zip Åbeskyttelseslinjer AA_BES_LINJER_SHAPE.zip Søbeskyttelseslinjer SOE_BES_LINJER_SHAPE.zip EF Fuglebeskyttelsesområder EF_FUGLE_BES_OMR_SHAPE.zip EF Habitatområder EF_HABITAT_OMR_SHAPE.zip RAMSAR-områder RAMSAR_OMR_SHAPE.zip Naturvildtreservat NATUR_VILDT_RESERVAT_SHAPE.zip There are more. […]

Categories
Algorithms Spatial stuff Systems

Trying a Python R-tree implementation

Rtree is a ctypes Python wrapper of libspatialindex that provides a number of advanced spatial indexing features for the spatially curious Python user.

Categories
Algorithms Spatial stuff Systems

A presentation on spatial indexing

A friend of mine, who is the CEO of a company that develops an embedded database, asked me to do a presentation on spatial indexing. This was an opportunity for me to brush up on R-trees and similar datastructures. Download the slides The presentation introduces R-trees and spatial indexing to a technical audience, who are […]

Categories
Spatial stuff Systems

Having a look at Spacebase

Spacebase is a spatial datastore that began life as military-grade software, which at least sounds kind of cool. It’s an in-memory database, really, so switch off the cluster and the data is gone. Apparently the same thing was (unknown to the SpaceBase people?) invented in the 90’s by some americans also having the military as […]