I was triggered by a question at this blog http://menwhostareatmaps.com/?p=48: «How can I locate all police stations in the netherlands?»
My first thought was why not check INSPIRE, they should have it and you’d have them for the whole of europe…
But why not do an experiment to see how much of that thought is true…
This is an exercise to test the theory, just to see how bumpy the road will be….

The theory

  • Locate in the registry in which data theme this object is
  • Query the catalogue to find datasets in this theme
  • Query the datasets and filter on police stations

In practice
I found a thing called ‘policeservice’ in a codelist in government utilities and services at http://inspire.ec.europa.eu/codelist/ServiceTypeValue/policeService/

At http://inspire-geoportal.ec.europa.eu/discovery I filtered on utility and governamental services (1148 results) in the Netherlands (9 results)… Unfortunately none of the 9 results seemed relevant to my search, all listed datasets where related to either roads, water or electricity. Let’s check another country (1148) filter on a keyword «police», 23 results, some in france (water police?) and some actual results in the city of Osnabruck and the state of Brandenburg… Unfortunately no resource links… mmm…

Let me check the data specification to see in which object this codelist is used at http://inspire.jrc.ec.europa.eu/documents/Data_Specifications/INSPIRE_DataSpecification_US_v3.0.pdf. The codelist value is used in the servicetype property of the object «GovernmentalService». So let’s look for that keyword, 1 result: «Demonstrationsgeoportal – Kabeltrasse Lindenberg»… mmm… Apparently no datasets with governamental services are available, or none of the organisations registered the keyword «governamentalservice» with the appropriate dataset…

So let’s check the assignment report at http://www.geonovum.nl/sites/default/files/Rapport%20Definitieve%20aanmerking%20INSPIRE%20Annex%20III%20v3.0.pdf. Dutch government has introduced a system of assigning certain datathemes to certain data providers. The report doesn’t explicitly mention police stations, but it mentions fire stations, it seems the dataset used by fire departments is acquired commercially and the fire departments seem no owner of that data… The report also mentions the chamber of commerce, and indeed there is a dataset «overheidsdiensten» http://nationaalgeoregister.nl/geonetwork/srv/dut/search?uuid=c935f2ab-9b65-4dc4-94a0-73aeb840a941, unfortunately this dataset doesn’t contain police stations and is not harvested by the european portal.

So let’s find out with some common sense, in the Netherlands we have a dataset BAG (buildings and addresses) which has all buildings, when looking at the dataset it seems there is a property called «purpose of use», which happens to contain a value «celfunctie» (prison). But then what happens to police offices that don’t have a prison and prisons that are not a police station? Apparently there is no purpose «police». In the blog post it was suggested to look at the dataset «top10nl» (topography). I couldn’t find this dataset in the European portal, but it was available in the national portal at http://nationaalgeoregister.nl/geonetwork/srv/dut/search?uuid=29d5310f-dd0d-45ba-abad-b4ffc6b8785f. Unfortunately this dataset doesn’t provide a WFS endpoint yet. In stead there is an ATOM document listing links to chunks of zipped gml-data. I have to agree with the blog post that this is quit hard to access. But, as suggested in the blog post, the gml’s indeed do have a property «typegebouw» which could be used to filter a WFS on police stations.

Back to BAG, just for the exercise, this dataset has a WFS link http://geodata.nationaalgeoregister.nl/bag/wfs which can be opened in QGIS. When adding a layer in QGIS you can add a query gebruiksdoel=celfunctie. Unfortunately the WFS service is quite unresponsive when using a filter, so you probably run into timeouts. Try this request (with low maxFeatures): http://geodata.nationaalgeoregister.nl/bag/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=bag:pand&SRSNAME=EPSG:28992&FILTER=%3Cogc:Filter%20xmlns:ogc=%22http://www.opengis.net/ogc%22%3E%3Cogc:PropertyIsEqualTo%3E%3Cogc:PropertyName%3Egebruiksdoel%3C/ogc:PropertyName%3E%3Cogc:Literal%3Ecelfunctie%3C/ogc:Literal%3E%3C/ogc:PropertyIsEqualTo%3E%3C/ogc:Filter%3E&maxFeatures=5

When starting this experiment off course I was quite sure I wouldn’t instantly locate all police stations in Europe. However I had expected to find at least some… This blog post gives a small overview of some reasons a dataset is not published, discoverable or accessible. I think it is important to gather actual questions like this and challenge the INSPIRE infrastructure with them. Organisations are putting a lot of effort in setting up services on their data, but apparently they’re missing steps that make the process work. In some cases the required changes are minimal, which can improve discoverability and accessibility drastically.

Update 14/10/2015

Nice to see so many references to this blog from tweets and newsletters. About time to correct/optimize some of the findings. The dataset «overheidsdiensten» as mentioned above  happens to contain police stations, however when I wrote the story I only checked the wms service and only in my town and apparently the dataset does not contain the police station of Wageningen. That’s why I came to the conclusion the dataset didn’t contain any police stations, but it did. The procedure to download the dataset has its own typical challenges. INSPIRE defines the concept of a download service, which is either an OGC service like WFS, WCS or SOS, but it can also be an Atom file which has a number of links to files that can be downloaded. The idea is that dataproviders can expose the same dataset in a number of languages, formats and/or projections from such an Atom file (http://geodata.nationaalgeoregister.nl/overheidsdiensten/atom/overheidsdiensten.xml). When you open the Atom document, you’ll notice a link to a zip file. It is a zipped GML file. It doesn’t use the INSPIRE governmental services schema, it uses a custom schema, however the schema location throws a 404 not found. When you load the GML in QGIS it fails to display any points. QGIS was not able to detect the geometrytype. QGIS creates a .gfs file next to the gml file, open that and change the geometrytype to «1». Then try to open the file again. Add a filter: «activiteitOmschrijving»=»politie» and there they are, 448 police stations in NL. Unfortunately it doesn’t show the opening hours yet…