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 …

How to display a Choropleth map in Jupyter Notebook Read More »

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 …

Python script for geocoding a text file Read More »

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 …

How to work with spatial data in Amazon Redshift Read More »

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 …

Geocoding Python function for PostgreSQL Read More »

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

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. …

Downloading environment data for Denmark Read More »