There appeared an article, in which an attempt was made to expose questionable practices of some Slovenian enterpreneurs. The scheme is such: establish a company, perform some work, bleed it dry, then establish a new one and move all workers into it, at the same time avoiding paying benefits and a sizable portion of salaries. When the new company has server its purpose, establish a new one, and so on, as far as it goes. These companies are frequently registered at the same address.
The article says that there are as many as 120 companies registered in one residential building. But because of a weakness of the law, state inspectors can’t put an end to such practice.
I wanted to see these addresses on the map, so here’s an attempt. For every address with more than five companies, there’s a dot, with color and radius proportional with number of companies registered there. The biggest dots represent business buildings, in which a predominantly legitimate businesses reside. My data sources didn’t allow for filtering out just residential buildings.
You can see the standalone map here. (In Slovene.)
Clicking on a marker displays a popup with a list of companies, sorted by date of establishment – youngest first. There’s also a chart of predominant business categories at that address. The categories that the article mentions as most prone to scheme in question, are Construction and Retail. So even of this map can’t really show the locations with these questionable companies, it can maybe help their discovery. If there’s a big dot with predominantly these categories, there’s a certain possibility that some of these fraudulent companies are there.
Most addresses shown here of course don’t have anything to do with any illegal activity.
A few months ago, while researching business times of various categories of establishments in Slovenia, I thought it would be nice to somehow visualize a map with a graphical representation of density of open establishments. I decided on heatmap style, although I later discover that my chosen implementation had some drawbacks.
Getting the data
Data with business hours of commercial establishments is traditionally not open for many reasons, two of them being that (1) this information can be commercially exploited, and (2) the opening hours can be subject to frequent changes, which can tax the database owner with considerable effort should the database stay current and reliable.
First I toyed with the idea of crawling entire directory of odpiralnicasi.com, then I actually thought about making a version for London, Amsterdam or San Francisco with Yelp data, for which I would have to crawl an entire Yelp city directory, a task I’m not sure it would succeed. Yelp would probably block my IP before I could harvest a significant portion of what interested me.
So I decided I would use the Najdi.si maps business directory. Disclosure: I work there, so I have access to the database with various business data, which is being kept current.
For every company, I took out only the name, geo coordinates, business hours and business category, then I constructed the animated maps. Before I delve into that, a short video of economic activity in Slovenia in course of a typical Monday.
The animated chart you see on the bottom shows the number of active establishments in various economic categories, such as Restaurants and catering, Industry, Shopping, etc. The full list is:
blue: Computers and IT,
red: Restaurants and catering,
green: Home and garden,
yellow: Beauty and health,
pink: General business,
orange: Free time,
magenta: Culture and schooling
Rendering the maps and constructing the visualization
Rendering one frame in one city at a specific time is just a matter of setting appropriate latitude, longitude and zoom level on the map, selecting the desired time and plotting on the map all establishments that are open at that time. I used Processing to do that, and for the heat map part I used this excellent example by Philipp Seifried. As a finishing touch, I made maps to switch between day and night styles at appropriate times.
To do entire video, I had to write a parallel rendering queue lest the rendering of a single video took an eternity – Eclipse project available by email request.
To complicate things a bit I decided to include up to four different places on the same map, so the viewer could compare opening hours in Ljubljana in different economic categories, or see how different cities woke up and went to sleep at different times.
A typical frame looks like this:
Here’s an example for different economic activities in Ljubljana:
I mostly did this to be able to visually compare levels of business activity in Ljubljana. First of all, the heatmap technique I employed here turned out to be somewhat unreliable for video purposes, because it colors the dots relative to the highest concentration. But concentration and absolute numbers of active businesses change from frame to frame, so it seems that at night there’s more activity that during the day.
Even so it’s still clear that restaurants, bars and clubs are still pretty much open when other activity starts to die down.
This is Ljubljana at noon, again:
top left: General business
top right: Restaurants and catering
bottom left: Industry,
bottom right:Beauty and health
The big spot in the northeast is the mall region, where untold number of business operate in ten or more big malls. Business concentration there dwarfs everything else in the city, except maybe in industrial category.
Below is Ljubljana at eight o’clock in the evening. Pretty much everything has closed down except for eating and drinking, and maybe the cinema theater in the mall.
Below: Ljubljana at ten o’clock in the evening. Some businesses don’t close down at all. I double checked the primary data source and it’s true. There are cleaning services that stay open during the night, etc.
I’m relatively satisfied with results except for the heatmap issue. I may correct that if I get the data for a bigger city.
There has recently been a flurry of activity by self-made mappers on the net that major media have noticed. It seems that proliferation of tools such as the excellent TileMill does help to make custom maps a relatively painless, yet still laborious process.
In my experience, a major hurdle in this process is getting good data. Governments and corporations around the globe have made acquiring the goods easier, but the quality frequently leaves one wanting. More about this particular dataset later.
This map is my attempt to visualize real estate prices in Slovenia. Buildings are colored according to the most expensive unit they contain, except in some cases where data is bad. More below.
This dataset is provided by GURS, a government institution. I used it before, to make the map of structure ages in Ljubljana. It comes in a variety of formats, such as SHP (geometry) and text (building properties) files, which were clearly dumped from database tables.
It has some severe problems. For example, some bigger and more expensive buildings contain many units, but these units all hold the same value regardless of their useful area. To make matters more complicated, other multiunit buildings don’t hold the same value for the units they contain. They are, in other words, evidenced correctly. Then, there are building compounds, like the nuclear power plant in Krško, in which every building clearly holds the exorbitant value of entire compound. Some other buildings have price value as zero, and so on.
All of this doesn’t even start to address the quality of valuation the government inspectors performed. In the opinion of many property owners, the values are too low. There’s a new round of valuation coming, in which the values are reportedly bound to drop by further five to twenty percent, if I remember correctly. It will be interesting to make another map with the valuation differences some day.
Massaging the data
This means that the above map is my interpretation of the dataset beyond the visualization itself. In calculating values for visualization, there were several decisions I made:
For multiunit buildings, I calculated the cost of square meter for every unit, then colored the building with color value of the most expensive unit. This was necessary, because some buildings contain many communal areas, garages and parking lots, which are all independently valued. I first tried with a simple average value, but the apartment buildings with many parking boxes and garages were then valued deceivingly low. I tried to make the map more apartment-oriented, so this was a necessary decision to make it more accurately reflect the market.
For incorrectly evidenced buildings with same value (high) unit value, I took the price of one unit, divided by sum of unit areas. I could do this on one unit only, but which one? There’s no easy answer. The average seemed the way to go.
I also made a list of the most expensive buildings by their total Euro value. Individual unit values were summed, except in cases described in the second bullet point above. there I simply took the price of one unit. It’s accessible as a separate vector layer under “Most expensive buildings” menu item.
Turns out the most expensive buildings are mostly power plants, which is not surprising. In Ljubljana, two of the most expensive buildings were completed recently. Well, the Stožice stadium was not really completed. I don’t know whether it was paid for or not – this is a discourse best suited for political tabloids. See the gallery:
It’s also hardly surprising that the capital and the coast are areas with the most expensive real estate available. The state of city of Maribor is sad to see, though, at least in comparison to Ljubljana.
I suggest taking the tour in the map itself, where I go into a little more depth for some towns and cities. Also, be sure to click the “Most expensive buildings”, then hovering the mouse pointer over highlighted buildings to get an idea of their total cost and price per square meter, which in many cases diverges dramatically.
Here are two charts showing price/m2 distribution at different intervals in time.
This one is an all-time chart. Most buildings are valued low, since all ages were taken into account.
This one shows the period between year 2008 and now, in other words, since the crisis struck. Nevertheless, more expensive buildings seem to prevail. No wonder, since they are new. But that probably also means that there’s more apartment building construction relative to countryside development. I’m not really a real estate expert, so if anyone has a suggestion, comment away.
I also have to thank the kind people at GURS for providing me with data. They know it’s flawed somewhat, but all in all it’s not so bad.
As I’ve noted before, this map is a result of my interpretation of government data. I’m in no way I responsible for any misunderstandings arising from this map. If you want to see the actual valuation of your building or building unit, please consult GURS or use their web application to find out.
Such is the beauty of open data that when I saw the excellent Portland: The Age of a City by Justin Palmer, I immediately wanted to do something similar, but for my town. The people at the government office (GURS) were kind enough to provide me with the files, and after some coding, here it is.
It’s an exploration of how the city grew through the last century. Blue is old, violet younger, res still younger, bright red the youngest.
Here’s the number of structures built by years. I was able to identify causes for some spikes in building activity, but not all:
1899: four years after the big earthquake,
1919: rebuilding after WW1? I’m not sure there was much destruction here,
1929: more building – in 1929 Ljublaana became the capital of Dravska banovina,
1949: rebuilding after WW2,
1959, 1969, 1979, 1989: might be effects of Yugoslav loans, but I suspect it’s more of an effect of administrative laziness, resulting in entering new buildings into evidence at the end of each decade,
2004: the last surge of prosperity in independent Slovenia.
Generally, it’s been going downhill from 1969 on. The best spots were probably taken by then.
Here’s a animation of the whole thing. It shows city evolution between years 1500 and 2013, since there’s not much happening before that.
One Sunday I woke up to incessant and very loud tolling of nearby church bell. It was 9 o’clock in the morning. It didn’t seem fair that an institution can cause so much noise so early. As I work hard during the week, run almost every day, and write software, sometimes until late, I would very much prefer to sleep. The clergy would probably say that honest Christians are already awake at that time, so I’m no good anyway.
I then decided to research the matter. A number of facts surfaced, the most startling of which is a state decree, which states that church bells are not categorized as noise. If an inspector came to my house, measured sound levels while this was going on, and found out that they exceed proscribed levels, he would not be able to fine the aforementioned institution. He would probably bill me for the expenses of his time. But I digress.
Action was taken: city geometry was imported into computer along with church bell coordinates. Aggregate sound pressure for each building was calculated, then ranged so it could be visualized. Additionally, a point where there is least such noise was calculated. You can see results below. The point with least noise is on the green marker in the lower left corner. Lucky owner of that house.
Note: please notify me before embedding this map in your page.
I have to admit that the calculation is naive. It doesn’t take into account the elevation model, neither it accounts for building heights. Sound reflection is also ignored. But my curiosity was satisfied. I do live in the red zone.
Here are same maps on different scales. One is for entire country of Slovenia.
Edit: after this post went viral and other media (Dnevnik.si) published their own versions linking to me, I feel compelled to clarify my position about church bells. Personally, that is, as a person, and not a member of any organization, I’m bothered by long intervals of loud tolling on Sunday mornings. I’m told by other people they don’t like that either, and some other people point out that any attempt at playing music at this volume at similar hour of day would not end well.
I do somewhat like single chimes announcing hours of day, even at night. It’s a part of urban environment, and I’d probably subconsciously miss it should they quit. I’m not against Catholicism, the Church, or faith of any denomination.
When you toll so loudly next time please consider: