Posts Tagged ‘St. Petersburg’

“Wow!” – I said to myself after reading R Helps With Employee Churn post – “I can create interactive plots in R?!!! I have to try it out!”


I quickly came up with an idea of creating interactive plot for my simple model for assessment of the profitable ratio between the volume waste that could be illegally disposed and costs of illegal disposal [Ryabov Y. (2013) Rationale of mechanisms for the land protection from illegal dumping (an example from the St.-Petersburg and Leningrad region). Regional Researches. №1 (39), p. 49-56]. The conditions for profitable illegal dumping can be describes as follows:


Here: k – the probability of being fined for illegal disposal of waste;

P – maximum fine for illegal disposal of waste (illegal dumping);

V – volume of waste to be [illegally] disposed by the waste owner;

E – costs of illegal disposal of waste per unit;

T – official tax for waste disposal per unit.The conditions for the profitable landfilling can be described as follows:

Here: V1 – total volume of waste that is supposed to be disposed at illegal landfill;

Tc – tax for disposal of waste at illegal landfill per unit;

P1 – maximum fine for illegal landfilling;

E1 – expenditures of the illegal landfill owner for disposal of waste per unit.

Lets plot the graphs (with some random numbers (except for fines) for a nice looking representation) to have a clue how it looks like.


Note that there is a footnote (this post provides nice examples on how to do it) with the values used for plotting – it is important to have to have this kind of indication if we want to create a series of plots.

Now I will show you the result and then will provide the code and some tips.

Playing with the plot

Tips and Tricks

Before I will show you code I want to share my hardly earned knowledge about nuances of the manipulate library. There are several ways to get static plot like that using ggplot, but some of them will fail to be interactive with manipulate.

  1. All the data for the plot must be stored in one dataframe.
  2. All data for plots must be derived from the dataframe (avoid passing single variables to ggplot).
  3. Do not use geom_hline() for the horizontal line – generate values for this line and store them inside dataframe and draw as a regular graph.
  4. To create a footnote (to know exactly which parameters were used for the current graph) use arrangeGrob() function from the gridExtra library.
  5. Always use $ inside aes() settings to address columns of your dataframe if you want plots to be interactive

The Code

<pre class="brush: r; title: ; notranslate" title="">library(ggplot2)

## Ta --- official tax for waste utilisation per tonne or cubic metre.
## k --- probability of getting fined for illegal dumping the waste owner (0


Today I decided to play with TimeManager plugin for QGIS that was introduced by underdark some time ago. After some search across my spatial storage I found only one dataset that contained timestamps: FIRMS fire data that I used for creation of a methodology for burn-out probability calculation (for illegal dumping environmental risk assessment) and for assessment of human influence on fire starting.
Seems that TimeManager is not quite stable after the certain number of features in layer. At least on my machine it crushed several times (during slider manipulation) on the whole dataset of about 7000 points but worked just fine with its one-year subset of about 2700 points. But anyway overall impression is very good.
The main issue was to create a video from the generated .png files. I used console ffmpeg utils. Simple command:

:~>  ffmpeg -r 1/1 -i frame%03d.PNG -vcodec yuv420p -video_size 1126x560 output.flv

produced a 3-minute video above. One second corresponds to 1 day of the most  flammable year for the Leninngrad region in a decade. Video covers period from April to November 2006. I was too lazy to create custom undercover and just loaded OSM via OpenLayers plugin)))

There was a press conference on Tuesday the 19-th about illegal dumping in Leningrad region (Russia). I was asked to be the main speaker there and to present to the press my recent study on illegal dumping prevention. I’ve already had two presentations on this subject recently at the international scientific conference in St. Petersburg State University and at the round tablefor the discussion of the upcoming “Let’s do it. Russia” clean up event.Some video from the press conference:

The main conclusion that I made by investigating possible impacts on illegal dumping prevention (such as penalty increase, chance of being caught increase and waste disposal fare decrease) is that decrease of the waste disposal fare for population is the most efficient way. And I managed to find two other publications that came to the exact conclusion (for example, there is an evidence that 1% waste fare increase leads to 3% increase of illegal dumping cases).

By the way I was able to assess probability of being caught for illegal dumping in Russia. It is about 10-5 (you can die while playing soccer with such probability).

The only way to reduce waste fares is to use waste as a resource. That means that the only way to prevent illegal dumping is to create waste management system that would be able to complete the zero waste goal.

And here is an abstract from my article:

Mechanisms of the land protection were discussed in this article. An algorithm of decision making whether to dump illegally or not was explained. Formulas for determination of profitable ration of expenditures per unit and amount of illegally dumping waste are substantiated. Effect from different types of impacts that can be used for land protection from illegal dumping were discussed (such as fares change, penalties change, penalty application probability change). Decreasing of waste disposal fares was acknowledged as the most effective way for illegal dumping prevention, but it is possible only if «zero waste» concept is implemented.

It’s actually already two month old news, but my research “Developement of the Universal Methodology for Assessement of Environmental Risk Caused by Fires at Illegal Dumps” (download in RUSSIAN), that was made special for Fire Monitoring Challenge (by GIS-Lab, Microsoft, NEXTGIS, several universities and GIS/spatial data corporations), was  awarded the 2-nd pace. The prize consisted of the fancy diploma, Lenovo IdeaPad G560 (thanks to all the gods it became much less uglier when I’ve installed openSUSE at it and applied an OSM sticker 😉 ), a wireless mouse (my wife was happy to grab it) and a nice book on remote sensing for children.

Instead of abstract:

Developed methodology for assessment of the fire probability in dependence of spatial location and actual area of illegal dump. It is applicable for any part of the world. Software used: QGIS, R.

Spatial component of the probability of the fire at illegal dump in Leningrad region, Russia

I was lucky to present this research at two conferences and today I’ve received a printed “minor” publication of the article (it is beta-version of the paper available at the link above). So it is possible now to cite it as:

Yury V. Ryabov (2011) Razrabotka univercal’noy metodiki rascheta veroyatnosti vozniknovenia pozhara na nesankcionirovennoy svalke // Sbornik nauchnih trudov molodyh specialistov, prepodavateley i aspirantov po resultatam provedenia Tret’ego molodezрnogo ecologichescogo congressa “Severnaya palmira”, 21-22 noyabria 2011, Sankt-Peterburg. – SPb NICEB RAN – pp. 93-106.

To Do: develope formula for composition coefficient calculation; translation to English; major publication.

P.S. If you are interested in this research and do not speak Russian don’t hesitate to contact me and ask for general translation.

The rally in St. Petersburg was far not as big as in Moscow unfortunately. There were about 3,000 of people but they came and leave constantly, so the actual number of participants might be 6,000 or so.

The problem is that there is no leader amongst the opposition and actually the only thing that they have in common is a wish to get rid of Putin and his gang. Also the opposition (al least that was presented in St. Petersburg) have no stomach. The shouted: “Put Churov on trial!” and only “Putin to resighn!” when it is obvious that Churov is a Putin’s puppet! So Putin is the main criminal and he must be jailed! But I deed shouted: “Put Putin on trial”. I really hope that some day he will pay for all his crimes against Russian people.

The other day I took part in a very interesting event – an interactive round table on a separate waste collection in the city (En), that was organized by Musora.Bolshe.Net (Waste.No.More) NGO. There were representatives of the St. Petersburg city administration, waste treatment companies, hotel business, cleaning companies, NGOs, mass media and science (a humble me).

It was great that there were no presentations from the experts, etc. The main point was the direct and open discussions (of course it was moderated) about the existing issues and challenges in the field of separate waste collection and recycling and the ways to solve them.

The second part of event was a development of waste related projects in small groups. Every one took part in development 3 projects and the group members were different each time. Of course the plans itself are quite useless: what kind of plan can be developed in 15 minuets? But the shearing of knowledge and opinions with others and development of the common view at the issue helps to get new ideas.

I was lucky to work in the same teams with representatives of the city committees. Unfortunately they are not open-minded enough and I think they do not fully understand the main economical and legislation obstacles that prevents separate waste collection or not motivated enough to overcome it. But seems that they are not hopeless.

It was very interesting to discover that many people are interested in (speaking professional language) GIS-portal dedicated to shearing information about locations of relatively small amount of recyclables, that will let waste producers and recyclers find each other for the common benefit. So if you were looking for ideas for a start-up – here you are. Seems that I should develop my web-GIS skills…

Digital Globe published all research papers that was submitted to 8-Brand Challenge. And you can find mine there 😉

Yes, this research on Illegal Dumping Monitoring With Implementation of WorldView-2 Imagery isn’t brilliant (my skills in remote sensing and English could be better), but if you are interested in illegal dumping monitoring it may provide you with some insights. And don’t hesitate to contact me if you would like to cooperate in illegal dumping researches.

One of the most interesting finding of the research is that it is hard to distinguish illegal landfill from the construction site (which is crucial for St. Petersburg). So it is necessary to use cadastral data to determinate type of the land use of the land parcel (cadastre contains information if there are construction works at the given parcel).

Mean values of digital numbers for Illegal Landfill,Construction Site and Constructions (buildings) at WV-2 imagery.

Also I wasn’t able to test Change Detection method (using Non-Homogeneous Future Difference index calculation method developed for WV-2) properly, because I haven’t ordered multi-temporal imagery in the first place… But seems that it can provide some advantages. See the paper for more information.

There was a fire at the landfill for hazardous waste “Krasny Bor”. First of all it is not a big secret that hazardous waste is being “incinerated” (of course it isn’t proper incineration, it is just an activity to free some space for a new waste) there, so specialists were not surprised that a fire occurred.
It is interesting and revealing that

“specialists of Rosprirodnadzor became aware about the fire at the “Krasny Bor” landfiil via mass-media”

LOL… but actually it isn’t fun at all…

Current situation map (click to enlarge)

I decided to acquire a diploma of The Baltic University in Sustainable Town Planning master course. We had a practical task to study a district of St. Petersburg of our choice. Spatial planning is inconceivable without maps. But for every map you need a source and if the information in this source is incomplete you have to complete it yourself.


A noise pollution map (click to enlarge)

The plan was borne quickly. I already had a GPS (because if you are a geographer it isn’t cool not to have one); I was aware of the OpenStreetMap existence and already used its data provided by as a complete project for QGIS. All I needed is to take look at the district at OSM, add needed information to OSM and simply download ready to use base map from


Of course it wasn’t that simple (there were tagging issues in OSM, missing objects in ready to use projects, and the project had to be significantly customised), but in the end chosen district became one of the most detailed in St. Petersburg and I was able to create cool maps 😉


As a conclusion I would suggest for the spatial planning lecturers to use this practice of OSM utilisation through contribution for the student’s practical tasks: they will improve their GPS skills, their work will be useful for other people (OSM will became more comlete), also students will learn something about Creative Commons licenses and will learn how to attribute their maps properly.




Map for development (click to enlarge)


Excursion on the roof (prof. Berg is in the centre)

This time broadcast was mainly about the possibilities of the gardening on roofs of the city.  There were an excursion for Russian and Swedish students to the unique roof garden in St. Petersburg situated at Pulkovskaya st., 9 k.2, near Zvezdnaya metro station. Swedish students were led by prof. Berg from University Uppsala, who is the founder of Sustainable Town Planning master course for The Baltic University A Regional Network.

a green house

I supposed to take an interview with prof. Berg, but due to issues with TV-team and professor’s hour late arrival the plan was ruined. But still we were able to visit this garden on the roof. By the way, the professor was in the cowboy hat – I’ve never seen any professor in a cowboy hat before)))

There are some clickable pictures here, they will demonstrate how this garden looks like.

a random view


another random view


a random view again 😉


Back to the broadcast. The guest of the studio was an expert in land management related legislation and a director of something))) Unfortunately I don’t remember his name, but I wish I wrote it down. This guy will be the head of the Committee for Environmental Safety and Natural Resources in two or three month (of course he will – he is a member of talent pool and has a sighed recommendation from Gryzlov himself).

The committee “suffer” a loss of its top management due to corruption scandals (one was caught by the hand violating the law and another wasn’t able to explain how it is possible that his expenditures are far above his incomes). I’m glad that corruptionists were banished, because this committee was the worst place to visit. I know it for sure: they’ve emptied a shit tank on me… twice. The last time I was there, Delarov (the one who wasn’t able to explain expenditures) tried to extort money from me for the information on illegal dumping in Leningrad region.

Hope the committee will have a brighter future now.