2012-01-19

Top 10 gasoline prices in Riga, FINAL

Fully functional top10 gas price map.


Autocentered on all markers.
InfoWindow added.

Source code with some comments (mostly javascript google api) can be found here php highlighted and here javascript highlighted.

2012-01-17

2012-01-14

grass gis batch interpolation and statistics

This post continues the previous one. Using two loops I created a raster files for each month and made a text file with basic statistics about these raster files in it.

here`s the code - http://pastebin.com/RtXuaQKS

I was using "boolean" switches because if the script grows larger, sometimes it is unnecessary to do things multiple times. Such switches eliminates running unwanted code (yeah, commenting also works, but.. i hate commenting blocks).

In this example the challenge was to correctly make heading-monthName when statistics were generated. Using awk the month name was passed as a command line argument and written in the appending file before statistics were written.

grass gis batch rename

Usually I dont like to do similar things multiple times. Like file or any object renaming.
Current problem involves Grass GIS database binded to vector layer. multiple columns has name as ID which doesn`t give much sense what exactly is stored in the column. Yet I know, that I have 14 columns with name dbl_1, dbl_2 and so on till dbl_14. The first two represents coordinates, and other 12 - monthly values. I would like to rename existing ID representing names to month names.
For such manipulation I need an array with month names. Then it is possible to iterate through the loop and in each iteration rename exact column.
Example is here - http://pastebin.com/52fMqL9j

Firstly the month names are passed as a simple string delimited with semicol ";"
Secondly, the string is splitted creating an array echoing and pipelining created string to bash tr comand (translate)
And then comes a loop over an created array. Counter "i" starts from value=3 because in my case the first id which represents the first monthly value is dbl_3 and it represents an october
In the loop the iterator increments through pipeline to bc

2012-01-11

chart series isExists

Here are multiple approaches how to check if chart series exists in Visual Basic 2010 (.NET)
For me the best approach is to use error exception and try&catch method.
http://forums.asp.net/p/1609665/4778480.aspx/1?p=True&t=634619304634512242