Tagged: tilemill

Slovenian real estate prices mapped

Share Button

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.

See the map!

A map of real estate prices in Slovenia.

A map of real estate prices in Slovenia.

About the dataset

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.

Findings

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.
realestate-chart-m2

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.

realestate-chart-m2-2008

Credits

Inspiration for the tour was this excellent visualization by the Pulitzer center.

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.

Disclaimer

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.

See also

Structure ages map in Ljubljana.

Building ages in Ljubljana, Slovenia

Share Button

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.

Launch the interactive map showing structure ages in Ljubljana

ljubljana-ages

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.

ages-chart

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.

City of Ljubljana – growth between years 1500 – 2013 from Marko O’Hara on Vimeo.

Map was made with TileMill, animation in Processing.

See also the real estate prices map.

 

Corruption visualized: Global Corruption Barometer 2013 on world map

Share Button

Interactive map of data from Global Corruption Barometer 2013 (Transparency report), showing corruption levels per country for political parties, educational sector, private companies, media, civil servants, judicial and medical institutions, military, NGOs, parliament, police and religious institutions.

Launch interactive map

Global Corruption Barometer 2013 on interactive world map
Global Corruption Barometer 2013 on interactive world map

Made with TileMill, data: Transparency International.

Visualizing drug talk on bluelight.ru

Share Button

In mainstream media, there’s not a lot to be found about recreational drugs except horror stories and arguments for prohibition. From time to time we also hear that Steve Jobs liked to drop acid when he was young, that countless Vietnam vets easily kicked heroin habit upon coming home, and, as US-fed-sponsored study found out, that psychedelic mushrooms can bring a lasting and positive personality change in more than half of those who take them.

Where to find good information? There exist internet communities, so-called harm-reduction forums, where one can spend a few hours to discover that the truth is not black and white. Surely junkies exist, and using meth daily is not a life strategy anyone could recommend, but not all drugs were created equal. There are many classes of recreational drugs, each acting on specific chemical pathways in body – uppers on dopamine, hallucinogens on serotonin, downers on GABA, etc.

Mapping drugs

I thought it would be nice to visualize these drug groups based on what users of harm-reduction forums say, so I analyzed around 1.2 million posts on bluelight.ru and constructed a simple diagram that tells a lot. It was constructed in such a way that drugs that are frequently mentioned together, appear together. Circle radii are proportional with frequency of appearance of the same drugs in the posts. Methodology is explained at the bottom of the post.

Here’s the diagram, pan and zoom at will:

Click here to peruse a clickable, searchable version of the same diagram (give it a second to load). To download a high-resolution image (8000 x 6000), click here (black) or here (white).

The drug groups are color coded for better readability. Starting from the top:

  • light blue group: mostly antidepressives – SSRIs such as Prozac (fluoxetine), Zoloft and such.
  • violet group:  mainly contains benzodiazepines such as Xanax, Valium, and Lorazepam, which are commonly abused, but there are a lot of other downers there.
  • orange group: opiates and opioids, soch as heroin, oxycontin and the like. There were so many mentions of “opiates” without referring to a specific chemical that I considered it would be a pity to leave the word out.
  • dark yellow group on the right: mostly dissociatives such as ketamine and DXM, but there’s also a subgroup on the right side. It forms a larger group, mixed with differently colored drugs, that could be called “shamanic corner”, as it mostly contains so-called entheogens and natural concoctions such as ayahuasca.
  • light orange group: mainly nootropics such as Piracetam. Some use them to enhance a psychedelic or MDMA experience, but they have a more general use as memory, intelligence and sensory enhancers.
  • red group: I don’t know what to call this, but these are “working man’s drugs”. The common drugs that we hear about in the media. Some of these drugs are not considered drugs at all, for example alcohol and tobacco, but the Bluelight discussions show that they are very common. Thinking about it, one must have something to drink while one insufflates synthetic powders, and a cigarette is also a good thing to have while waiting for something stronger to take hold.
  • green group: psychedelic drugs such as shrooms, LSD, DMT and mescaline, along with many newer variations and analogs, such as 2C-X family, the DMT analogs and the whole Tihkal inventory.
  • blue group: Ecstasy (MDMA) and newer stimulants and entactogens, such as methylone, mephedrone, etc. “Plant foods” and “bath salts” are in this category.

Mapping effects

Simply mapping out the drugs is nice, but additional step seemed in order: mapping coincidence of various effects the drugs have on users. Again, posts were analyzed, but in addition to drugs, some (not all!) common effects were extracted and mapped in a network. Result is in the diagram below. Darker dots are effects, lighter are drugs. Size is again proportional to number of mentions in all posts.

Click here to peruse a clickable, searchable version of the same diagram. To download a high-resolution image, click here (black) or here (white).

Note that above diagram does not indicate semantic relationships between drugs and their effects. For example, why is “marijuana” close to “death”? Maybe there was a lot of talk about fear of death that the marijuana experience helps to resolve, or maybe people like to describe how they are dying of laughter while smoking weed. I honestly don’t know. I suspect it’s because of close relationship between mentions (not necessarily use!) of marijuana and those of alcohol, cocaine and methamphetamine, which could have a more significant relation with death or dying.
What’s really notable is heavy clustering of adverse effects around opiates, and relative absence of same around psychedelics. Based on Bluelight data, I can safely conclude that psychedelic drugs do not cause users to complain a lot, except maybe mentioning hallucinations and visuals, but, well …

Drug use over the years

My whole database contains posts from 2010 until March 2013. Here’s an analytical tool to better understand what’s going on in the recreational drug market community. Time is on horizontal axis, while the proportion of posts mentioning specific drug relative to all posts in that month is on the vertical axis.

Play around with interactive chart to discover emerging trends, or simply to behold the wax and wane of specific chemicals as they compete for users’ neurological apparatuses, while their manufacturers are temporarily evading ever stricter analog laws:

Commentary: Bluelight is a harm reduction forum, historically established for the users to be able to tell a good Ecstasy pill from the bad, so MDMA is the most mentioned drug. Use of “classic” drugs doesn’t change much, but it’s interesting to note the rise of new “research chemicals” such as NBOME family, new cathinones (3-MMC), new synthetic canabinoids (STS-135) and different amphetamines, prevalently methamphetamine. You can also see how the newly banned drugs, for example mephedrone, go out of use, and their analogs, in this case 3-MMC, replace them.

Methodology and tools

First, all the Bluelight forums were crawled and contents, dates and other metadata of all posts put into a SOLR index. That took approximately two days of not too aggressive load on their server (thanks Bluelight for not banning my IP).
To make first two network diagrams, undirected graphs were constructed with JGraphT library so that all extracted entities – drugs and effects – in every post were connected as nodes. Mentions of all extracted entities were counted to make the dots size show frequencies, not network degrees. That yielded complete graphs to be visualized with Gephi. Gephi files were exported to a TileMill-friendly format to render map tiles. Tiles are displayed on the site using Leaflet.
To make the interactive chart, SOLR was used to produce time series. Data was then packed into suitable format for the Flot library to be able to display.
To extract entities, two dictionaries were used – one for drugs, one for effects. You can download them here: drugs / effects.
If anyone is interested in the SOLR core, I can put it on Dropbox. Send me a note, my email is on the About page.

What is not here, but could be

  • analysis of effects that specific drugs have over time
  • a chart of effects only
  • some different visualization that could help to establish relationships between specific drugs and effects they have. For example, it’s been known for some time that mephedrone and various dragonflies have vasoconstrictive effects. Maybe some other relationship could be inferred that way.
  • first map should be clickable to search on Wikipedia, I’ll add that as soon as I figure out the Wax lib.

I may revisit this theme in the future.

Some pics:
drug_effects_diagram

Drug talk visualizations

Noise pollution caused by church towers in Ljubljana

Share Button

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:

  • do unto others as you would have them do to you,
  • would Christ approve of that?

Thanks.