So how much does Greek Local Government really spend? Find out on an interactive map

diavgeia_maps_enAnd where else would a better place be, you may ask. If you head over to Diavgeia Spending Maps and after you hit the “It’s all Greek to me” button (Aren’t I a clever boy – get the pun?) you should be able to query spending data for every municipality in Greece for a time period of your choosing. Make sure to check the FAQ first.

Data is coming from the Greek Government’s “Transparency  Portal” (“Diavgeia” stands for transparency in Greek)

This has been my toy project for a bit now trying to work on it on my spare time. This is the first release. Do have a play and let me know what you think. If you want more details on how it was done, read on.

The background

Under the Greek Transparency Program initiative, beginning October 1st, 2010, all government institutions are obliged to upload their acts and decisions on the “Transparency Portal”. In fact, NO administrative act or decision is valid unless published on this portal. More info here.

challenge_accepted_barneyThe good folks at the Ministry of Administrative Reform and e-Governance who run this portal, have also provided an API so external apps can use their data. Now, although there were some external sites utilizing the API, none of them had any maps. So I raised to the challenge. In a nutshell, the app makes subsequent calls to the API, one for each municipality, for decisions and acts relating to spending data and simply adds them together. The result is the total amount spent and its the value used to color the map.

There are two -or three very important caveats here – at least in this first version:

The API will only return a maximum of 500 results per query. This means that if -for the date range you selected- the municipality has issued more than 500 decisions relating to spending, the total amount shown for this municipality will be incorrect. However, one can get around it by selecting shorter time periods. In any case the application will report on the number of results returned as well as the number of actual results for each query so you should be able to know if all data was included.

The second is more serious, and in all probability due to my ignorance of the inner workings and processes within the municipalities and their interaction with the Transparency Portal.

To begin with, some of the decisions have a zero amount next to them. And that’s despite the fact that in some cases, even the title of the particular decision states the amount (which of course is not zero). At first I thought it was some sort of bug in my code, but no, it WAS the data stupid. I haven’t got the foggiest why this is.

On the other hand, I noticed that some decisions are duplicated. Exact same title and amount but different decision id. Again, not a clue.

I do intend to try and contact the Diavgeia people to find out but till then -and its plastered all over the site- do use the results with EXTREME caution. Results and total amounts are indicative and should be used for informational purposes only!

The technical bits

Diavgeia Spending Maps was developed using Leaflet (based on the Interactive Choropleth Map example) and jQuery. Controls were based on the JQuery UI tools. Data was returned in Json format. Administrative boundaries were downloaded from as a single shapefile and converted to GeoJson after some generalization to reduce in size.

Greek Version


GET SDI Portal v.3.0 – the new(-ish) kid on the block

getsdilogoI wrote about this a few years back and now Geospatial Enabling Technologies (GET) has annouced the release of its latest version of GET SDI Portal. The 3.0 version includes several new tools including:

  • Advanced search tools using descriptive and spatial criteria
  • Saving features in several differen formats (Shapefile, GML, CSV, KML etc.)
  • Adding selected features to a list for further use
  • Ability to see your data in 3D  via Google Earth

The GET SDI portal is an open-source web mapping framework initially developed to fullfill the the European INSPIRE directive. It has moved a bit since then, now offering tools not only for the INSPIRE Discovery, View and Download Services but also for data editing, advanced search, and even for document uploading.

I never tried to install it before, but I am currently in the process of researching web mapping platforms for a project I am working on so this time I did. I must say that I was pretty impressed with the software. Surely enough, there is functionality there that you can find in other applications but this one is quite comprehensive. However, the main reason I am quite keen on it is its ease of installation. Working mainly on windows platforms, some of the other open-source products I tried were quite-lets say-“challenging” to get them installed. I got GET SDI running on IIS and looking at my first map in less than 2hrs. That to me says something!

If you want to give it a go, head over to Github to download it, have a look at how it was implemented in Greece’s Regulatory Authority for Energy (RAE) or look at its user base through a story map.

Creating custom forms in QGIS – Part 2

Better late than never they say…

Anyway, on the previous post I explained how to customize the QGIS edit form using the available widgets depending on your attribute data types. In this post I will continue on how to further customize your form using the Drag and Drop Designer in QGIS (form layouts may look slightly different from the previous post as I now use QGIS 2.2 version).

Open the Layer properties form, click on the Field properties and select [Drag and Drop Designer] from the [Attribute editor Layout] drop down:


To create your custom dialog, you first need to create a ‘category’ i.e. a tab. So  click on the green ‘+’ button and add the label that will appear on your tab.


Now you can start adding fields inside this tab using the right blue arrow. Make sure you highligted the attributes you want to add AS WELL AS the tab name in the right panel for the arrow to get enabled.


You can add more tabs and fields repeating the steps above, as shown in the following screenshot:


And the completed form should now look like this:

The Streets attributes and Photo tabs…


…and the Website tab


Pretty simple- right?


Online vector and raster converter

Just came across this :

Its free and it seems to convert to and from a quite large number of vector and raster formats.

According to the statement on their site:

MyGeodata Converter allows you to read and write from/to a huge number of CAD and GIS formats – both vector and raster. MyGeodata Converter is more than only simply data converter! In contrast to common format convertion MyGeodata Converter allows sofisticated data processing during conversion. MyGeodata Converter also can be used as a powerful tool for collective data and attributes processing.

Haven’t tried it yet but it sure worths a try.

STOP PRESS: Someone discovered how to “display a map on a computing device”

No really. They did. Unbelievable right? For years we were trying to do this without success apparently. Otherwise how could you explain why Apple filed a patent request for just that? The “inventors” (honestly, they are called that) in Claim 1 are stating:

A method for displaying a map on a computing device, Comprising: storing information to be displayed on the map in a memory of the computing device, the stored information comprising a plurality of different layers of information, wherein each layer contains a respective type of information; displaying a map on a display of the computing device, the map comprising a plurality of the layers of information superimposed upon one another; in response to a user selection of a display mode corresponding to a topic of interest, displaying at least one layer containing information that is associated with the selected mode; and enhancing the value of at least one display parameter for map features of each displayed layer that are associated with the selected mode, relative to a default value for the display parameter.

Sounds familiar maybe? Anyway, there is an effort in asking for “Prior Art” – which basically means any documentation dating before June 5, 2012 (the date of Apple’s patent request), available in the public domain so as to determine whether a patent application describes a new and nonobvious invention. Blindigly obvious you may think. Apart from anything else its really interesting to see the answers as they contains lots of historical facts about GIS including the 1987 video where William Shatner presents GRASS GIS

Creating custom forms in QGIS – Part 1

One of the things I love about QGIS is its ability to easily create custom forms. Usually without writing a single line of code. The QGIS manual in my opinion doesn’t do it justice, as it only describes this functionality very briefly, so I decided to write a couple of posts explaining the process with examples.

I will be using a shapefile containing a road network. The attributes in the shapefile are as below and there are pretty self-explanatory:


Now, note the [Edit Widget] field. Its default value for each attribute is “Line Edit” which basically means it will display a simple text box for the user to enter a value when in Edit Mode. Obviously, this is not ideal as we got values like number of Lanes (LANES attribute) which should be numeric values or dates (DATE_OPEN attribute). QGIS won’t validate the form values till after we press the save button.

So first thing we need to do is change the widget (control) that will display in the Edit form for the DATE_OPEN attribute. Press the [Line Edit] button for this attribute and the attribute edit dialog will open. Select [Calendar] from the left panel:


You can edit the date format to control how the date will be displayed. When finished click the OK button.

Next, I wanted the ROAD_CLASS attribute to be selected from a drop-down list. To do this, follow the previous steps for the ROAD_CLASS attribute and this time select [Unique Values] as the widget. The Unique values widget will display all unique values that already exist in the shapefile in a drop-down list. And as we also need to be able to enter new values, check the [Editable] check box (the second one- the first is checked by default and it controls whether the field would be editable or not in edit mode).


Similary the Road environment (ROAD_ENVIR attribute) should be displayed as a drop-down list but this time we will use our own values. To do this select the [Value Map] widget and enter your values in the displayed grid as shown below:


Then, for the LANES attribute we would use the [Edit Range] widget. Number of lanes can range theoretically between 1 and 6, so put these values as min, max and define a step of 1:


But we can also display images or web pages in our form. Not surprisingly the photo widget is called [Photo] and you can defined the width and height of the image to display…


…whereas to display a web page of specific width and height you select the [Webview] widget:



You can also display a color ramp in your form. To do this, use the [SYMBOL] field in this example and select the [Color] widget:


If you followed this far, congratulations! Now close the properties window and start editing. Click on the identify button and click on any of the features in your shapefile. In the identify window right-click on one of the features and select the [Edit Feature Form] option:



Have a look at the form and note how the different fields display different widgets/controls based on wh

at we set them at, in the previous steps


As some of you may have noticed by now, this is not all the widgets that are available in QGIS but hopefully we covered quite a few of them and you got the general idea.

But this is not all. With QGIS, you can further customize your forms, adding tabs and grouping your controls. That’ll be next, in Part 2