Archive for the ‘geojson’ tag
Visualising GeoJSON in 15 Minutes
The objective of this post is to save a GeoJSON feature collected from the web to an image file, and was inspired by the Shapely manual. This will be done using Windows, Python 2.5 (although 2.6 should be almost exactly the same steps), and some additional Python packages. This example uses GeoJSON data from a CloudMade geocoding service.

The greatest difficulty when trying to do things in Python is getting the right packages to match your Python version, and making sure all the package dependencies are in place.
Read the rest of this entry »
GeoJSON Where are You?
I was looking around the web to try and find some services that returned GeoJSON to try out Shapely. It was surprisingly hard to find servers or web services given the amount of tools that have already been built to use GeoJSON.
Eventually I found the CloudMade’s geocoding developer samples. CloudMade is a company that builds tools and services on top of OpenStreetMap. Even though many of the people involved in both CloudMade and OSM are the same, using the two brands interchangeably has not been without controversy.
Once you’ve signed up for a free account, you can then register for an API key that allows you to call their web services. See here for differences between free and paid accounts. The service I was interested in testing was the geocoding service that returns GeoJSON.
Depending on the type of feature you are looking for you can get different geometry types – the standard point, lines, and polygons, all as GeoJSON objects.
The API uses URLs and GET requests to return data. Calls can be made to either a find.html page which returns the GeoJSON object displayed on a map, as shown in the query for “england” on the left. Alternatively the query can be made to find.geojs to return just the GeoJSON itself. There is also a find.js which can be used to return geometry as JSON, although this seems a little confusing – even more so as the coordinate order is reversed from the standard GeoJSON [lon,lat].