{"id":102,"date":"2011-06-23T13:44:03","date_gmt":"2011-06-23T13:44:03","guid":{"rendered":"http:\/\/blog.soton.ac.uk\/data\/?p=102"},"modified":"2011-06-23T13:44:03","modified_gmt":"2011-06-23T13:44:03","slug":"generating-open-geographic-data","status":"publish","type":"post","link":"https:\/\/blog.soton.ac.uk\/data\/2011\/06\/23\/generating-open-geographic-data\/","title":{"rendered":"Generating Open Geographic Data"},"content":{"rendered":"<div style=\"float: right; margin-left: 10px;\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-count=\"vertical\" data-url=\"https:\/\/blog.soton.ac.uk\/data\/2011\/06\/23\/generating-open-geographic-data\/\">Tweet<\/a><\/div>\n<p>Let me introduce Colin Williams, a postgraduate student who has been doing lots of interesting stuff to help the Open Data service. I&#8217;ve asked him to contribute to this blog. Over to you Colin&#8230;<\/p>\n<p style=\"text-align: center;\">*****<\/p>\n<p>Recently, I have been assisting the data.southampton.ac.uk team in  gathering geographic data for their site. By geographic data, I am  referring to the latitude and longitude of campus buildings and  services.<\/p>\n<p>This can be a simple point reference, as in:<\/p>\n<blockquote><p><span style=\"color: #008000;\">&lt;http:\/\/id.southampton.ac.uk\/point-of-service\/sculpture-hepworth-1968&gt;<\/span> <span style=\"color: #00ff00;\">geo:lat<\/span> 50.935436<\/p>\n<p><span style=\"color: #008000;\">&lt;http:\/\/id.southampton.ac.uk\/point-of-service\/sculpture-hepworth-1968&gt;<\/span> <span style=\"color: #00ff00;\">geo:long<\/span> -1.398055<\/p><\/blockquote>\n<p>or it could be an outline of a building (or site) footprint, as in:<\/p>\n<blockquote><p><span style=\"color: #008000;\">&lt;http:\/\/id.southampton.ac.uk\/building\/32&gt;<\/span> <span style=\"color: #00ff00;\">dct:spatial<\/span> <span style=\"color: #993300;\">&#8220;POLYGON((-1.3960952 50.9368069,-1.3958352 50.9368250,-1.3956962  50.9360329,-1.3959562 50.9360148,-1.3960952 50.9368069))&#8221;<\/span><\/p><\/blockquote>\n<p>One of the surprising discoveries made by the data.southampton.ac.uk  team during their data gathering was the lack of any geographic data  held by Estates and Facilities. So, I set out to gather this data&#8230; [Editors Note: Our Estates &amp; Facilities service do have all the geo data <em>they<\/em> need, but it&#8217;s not very useful to the open data project as they just don&#8217;t need a reference lat\/long point.]<\/p>\n<h2>Google Maps<\/h2>\n<p>First stop, <a href=\"http:\/\/maps.google.com\/\">Google Maps<\/a>. Google  allows users to create their own maps, by overlaying points and polygons  on their maps (or their satellite imagery). Their tool is easy to use,  using a web interface to add points (and polygons) to the map. This data  can then be exported, as a .kml file, which we can easily convert to a  form that can be imported into data.southampton.ac.uk.<\/p>\n<p>This started off fine, until I started to think more about the  licencing of the data. I had read in the past that, due to the copyright  held by Google (or their mapping providers) over their map data,  contributors to <a href=\"http:\/\/www.openstreetmap.org\/\">OpenStreetMap<\/a> aren&#8217;t allowed to use Google&#8217;s data to determine the location of entities.<\/p>\n<p>Time to check the <a href=\"http:\/\/www.google.com\/intl\/en_ALL\/help\/terms_maps.html\">Google Maps Terms of Use<\/a>. Specifically, term 2.(e) states that:<\/p>\n<blockquote><p>2. Restrictions on Use. Unless you have received prior written  authorization from Google (or, as applicable, from the provider of  particular Content), you must not:<\/p>\n<p>&#8230;<\/p>\n<p>(e) use the Products in a manner that gives you or any other person  access to mass downloads or bulk feeds of any Content, including but not  limited to numerical latitude or longitude coordinates, imagery, and  visible map data;<\/p><\/blockquote>\n<p>So, that rules out the use of Google as a data source.<\/p>\n<h2>OpenStreetMap<\/h2>\n<p>As its name suggests, <a href=\"http:\/\/www.openstreetmap.org\/\">OpenStreetMap<\/a> is an open data street map, with its data being available under the <a href=\"http:\/\/creativecommons.org\/licenses\/by-sa\/2.0\/\">CC BY-SA<\/a> licence. OpenStreetMap is a great example of a collaborative,  wiki-style geographic application. We could re-use their data, however,  we wanted to generate authorative data, without making huge, possibly  unnecessary changes to the OpenStreetMap data simply in order to achieve  our goal. So, let&#8217;s look somewhere else. (I should probably contribute  some of our building outlines back to OpenStreetMap when I find some  time.)<\/p>\n<h2>Ordnance Survey<\/h2>\n<p>The <a href=\"http:\/\/www.ordnancesurvey.co.uk\/\">Ordnance Survey<\/a> is  Great Britain&#8217;s national mapping agency, which, in recent years, has  released some open products. Confusingly, they seem to have two &#8216;Open&#8217;  products which could be relevant to our task.<\/p>\n<h3>OS OpenSpace<\/h3>\n<p>The <a href=\"http:\/\/openspace.ordnancesurvey.co.uk\/openspace\/\">OS OpenSpace<\/a> API, according to their website, is &#8220;free to access and lets developers  create amazing web applications and online projects with Ordnance  Survey maps&#8221;. Sounds good so far. Their <a href=\"http:\/\/openspace.ordnancesurvey.co.uk\/openspace\/webmapbuilder.html\">web-mab builder<\/a> allows the user to add markers and routes, and then to export a html  page (with javascript) that can be put on a web site. Not exactly what  we&#8217;re after, but we could probably extract the data from it. Are we  allowed to?<\/p>\n<p>Well, it seems that this the data used on OS OpenSpace is licensed under the &#8216;OS OpenData terms&#8217;, which &#8216;include&#8217; the <a href=\"http:\/\/www.ordnancesurvey.co.uk\/oswebsite\/products\/os-opendata.html\">Open Government Licence<\/a>.<\/p>\n<p>However, the <a href=\"http:\/\/openspace.ordnancesurvey.co.uk\/openspace\/faq.html\">OpenSpace FAQs<\/a> include this entry:<\/p>\n<blockquote><p>2.1 I am using OS OpenSpace to create a database of location based information. Does Ordnance Survey own this?<br \/>\nYes.<\/p>\n<p>When you use OS OpenSpace to geocode data by adding locations or  attributes to it that have been directly accessed from and\/or made  available by Ordnance Survey mapping data, then the resulting data is  &#8216;derived data&#8217;, because it is derived from Ordnance Survey data.<\/p>\n<p>Ordnance Survey would own such &#8216;derived data&#8217;, but we grant you a  non-exclusive, personal licence to use it within your web application.  Please refer to the definition of &#8216;Derived Data&#8217; and Clause 5.4 of the  OS OpenSpace Developer Agreement.<\/p><\/blockquote>\n<p>Well that&#8217;s not what we want. But, how about the data, that is under the Open Government Licence?<\/p>\n<h3>OS OpenData<\/h3>\n<p>The <a href=\"http:\/\/www.ordnancesurvey.co.uk\/oswebsite\/products\/os-opendata.html\">OS OpenData<\/a> site holds a variety of geographical datasets. For example, <a href=\"http:\/\/www.ordnancesurvey.co.uk\/oswebsite\/products\/code-point-open\/index.html\">Code-Point Open<\/a> is a dataset containing the latitude and longitude of 1.7 million postcodes, whilst <a href=\"http:\/\/www.ordnancesurvey.co.uk\/oswebsite\/products\/os-vectormap-district\/index.html\">OS VectorMap District<\/a> is a vector based map of Great Britain. Unfortunately it&#8217;s not quite  detailed enough to show individual buildings, which is what we&#8217;re really  after.<\/p>\n<p>So, the product we&#8217;re after is <a href=\"http:\/\/www.ordnancesurvey.co.uk\/oswebsite\/products\/os-streetview\/index.html\">OS Street View<\/a> (not to be confused by a similarly named, but completely different product offered by Google).<\/p>\n<p>Can we use this data? The <a href=\"http:\/\/www.ordnancesurvey.co.uk\/oswebsite\/opendata\/docs\/faq.pdf\">FAQ<\/a> (which is in PDF format) has this to say:<\/p>\n<blockquote><p>11 Am I able to reuse &#8220;derived data&#8221; created from the OS OpenData products?<br \/>\nYes.<\/p>\n<p>The licence allows the reuse of the derived data created from any OS  OpenData products for commercial and non-commercial use. For more  information on terms and conditions, read the OS OpenData Licence at  <a href=\"http:\/\/www.ordnancesurvey.co.uk\/opendata\/licence\">www.ordnancesurvey.co.uk\/opendata\/licence<\/a>.<\/p><\/blockquote>\n<p>OK, so we have found some mapping data that we are allowed to use. Is  it in an easy-to-use form? Of course not, its in raster format. In  other words, it&#8217;s a bitmap image (or rather, a series of images, each  covering a 5km by 5km patch of Great Britain). \u00a0How can we easily extract the information we need from these images?<\/p>\n<h2>Merkaartor<\/h2>\n<p><a href=\"http:\/\/merkaartor.be\/\">Merkaartor<\/a> describes itself as an  OpenStreetMap editor for Unix, Windows and Mac OS X. It turns out that  we can use it to export data rather than uploading that data to  OpenStreetMap.<\/p>\n<p>By default, Merkaartor has a number of data sources installed. In order to use the OS OpenData maps, we add <a href=\"http:\/\/os.openstreetmap.org\/\">http:\/\/os.openstreetmap.org\/<\/a> as a data source, which uses the OS Street View data mentioned earlier.<\/p>\n<p>All that remains to be done is to trace the shapes on the map and  then export the data, as KML, which we then convert into a simple CSV file to  be imported into <a href=\"http:\/\/data.southampton.ac.uk\">data.southampton.ac.uk.<\/a><\/p>\n<p><a href=\"http:\/\/data.southampton.ac.uk\"> <\/a><\/p>\n<p><a href=\"http:\/\/data.southampton.ac.uk\">The data that has been generated as part of this process is available in the <\/a><a href=\"http:\/\/id.southampton.ac.uk\/dataset\/places\">buildings and places<\/a> dataset, and you can see it in use on the University&#8217;s <a href=\"http:\/\/opendatamap.ecs.soton.ac.uk\">open data map<\/a> (which I have also been developing).<\/p>\n<p style=\"text-align: center;\">****<\/p>\n<p style=\"text-align: left;\">Thanks, Colin. I&#8217;ll just wrap this up by saying that University of Southampton Buildings &amp; Estates will one day probably take over curation of this data, and they are aware of this work. They are happy to let us worry about it for the time being. This is fine with me as buildings don&#8217;t move much. Colin has done all of this for fun in his own time. I hope the other data.xxx.ac.uk projects are lucky enough to get some helpers like this. Be ready with a plan of how to let people help if they offer!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tweet Let me introduce Colin Williams, a postgraduate student who has been doing lots of interesting stuff to help the Open Data service. I&#8217;ve asked him to contribute to this blog. Over to you Colin&#8230; ***** Recently, I have been assisting the data.southampton.ac.uk team in gathering geographic data for their site. By geographic data, I [&hellip;]<\/p>\n","protected":false},"author":185,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8217,393,14173],"tags":[],"class_list":["post-102","post","type-post","status-publish","format-standard","hentry","category-datasets","category-geo","category-licenses"],"_links":{"self":[{"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/posts\/102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/users\/185"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/comments?post=102"}],"version-history":[{"count":8,"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/posts\/102\/revisions"}],"predecessor-version":[{"id":111,"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/posts\/102\/revisions\/111"}],"wp:attachment":[{"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/media?parent=102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/categories?post=102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/data\/wp-json\/wp\/v2\/tags?post=102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}