Published by breki on 01 Jul 2009

Fresh Catch For July 1st

These are my new delicious links for July 1st:

Published by breki on 28 Jun 2009

GroundTruth: Works With SRTM Again

Good news: I managed to update my Breki.DemLibrary code to be able to download SRTM data from the new NASA server. The next step was to update the source code for GroundTruth in order for it to be able to use the new code.

After some initial testing, I think GroundTruth is ready for a new release, so here it is: http://downloads.igorbrejc.net/osm/groundtruth/

If you notice any bugs regarding the new SRTM code, please report back.

Kosmos is the next one to be updated, although I expect a little bit more work on it since it uses an older code base. Hopefully it will be done in the next couple of days.

The other good news is that while making these changes to the SRTM code, I decided to overhaul the whole library. The main reason make the support for other sources of height data like CGIAR-CSI, viewfinderpanoramas.com, SRTM1 etc. much easier and transparent to users. I already started implementing support for these sources, but it will take some more time before the thing gets finished.

The main idea is for the DemLibrary to automatically find the best source of height data for a given area. So, for example, if you’re interested in generating contours for Alps, it will know that the best height data can be found on viewfinerpanoramas (presumably) and will download these instead of the plain old NASA’s SRTM3 cells (which contain a lot of “holes” with no height data). The library should even be able to combine various different sources into a single DEM dataset.

Published by breki on 23 Jun 2009

NASA’s SRTM Server Has Moved…

NASA moved the server containing SRTM data to a new location. Taken from their README file:

The SRTM dataset has moved. You have apparently been accessing it directly, rather than through the link specified at JPL (http://www2.jpl.nasa.gov/srtm/). The new location is http://dds.cr.usgs.gov/srtm/.Note that the directory levels have changed, so that the top level now contains the version directories. Lastly, we now only allow HTTP connections, not FTP. Sorry that we had no way to communicate these changes other than cutting off access at the old location.

The fact that they no longer provide FTP access is a big PITA for me, since all of my software (Kosmos, GroundTruth) uses FTP protocol to download the height data. I’ll need a few days of free time to write the new HTTP code, so unfortunately until then – I suggest you keep your SRTM caches on your disks.

As for Srtm2Osm, I’ll try to integrate this newly written code to it, but I cannot promise it will work – the code base has changed a lot since the time I published Srtm2Osm code on the OSM SVN server. Any volunteers?

Published by breki on 20 Jun 2009

Kosmos Gets Mentioned

I got this via Google Alerts, it’s a little bit old (April 2009), but still: Harry Wood gave a presentation of OSM to the British Computer Society, and one slide (109th actually ;) ) was dedicated to Kosmos. Which reminded me that I should probably update the Kosmos screenshot on the OSM Wiki page with some new and more interesting stuff.

Here’s the link to the presentation: http://www.slideshare.net/gssg/openstreetmap-open-licensed-geodata-1372080, there is also MP3 audio available. If you’re interested in OSM, I recommend listening through the whole presentation, it’s gives a good overview of the whole OSM area.

Published by breki on 19 Jun 2009

Making My Own Hiking Map With Kosmos

Pohorje Hiking Map

I finally invested some time into creating my own Kosmos rendering rules intended for hiking. I started from scratch, adding individual features either by copying them from existing rules or by writing new ones. I wanted to create a map that would suit my needs when hiking: distinguishing different types of hiking paths, forest tracks, marking paths that still need to be investigated (I use my own set of OSM tags for this), marking important hiking routes etc. It is quite difficult to get all these things right, so I needed a lot of experimenting before I got to this result.

The map of Pohorje reflects the data entered into OpenStreetMap during the last 2 years by a few mappers (no more than 4-5 from what I can remember). There is still a lot to be done, especially in the western part of Pohorje (which is farthest from where I live).

I haven’t been using Kosmos so much lately, so this exercise was useful – I discovered quite a few minor nuisances and ways to improve it. The biggest problem is defining actual rules, not just because they are written in wikitext, but also because they are not flexible enough. That got me into thinking of redesigning the whole rendering engine (GSS could be an option). I’ll spell out these ideas in some other post.

You can see my hiking rules at http://wiki.openstreetmap.org/wiki/User:Breki/Kosmos_Hiking_Rules, feel free to copy them (just don’t edit anything on the original page). Here are some screenshots taken from Kosmos:

Kosmos: Pohorje Hiking Map

Kosmos: Pohorje Hiking Map, detail

 

Published by breki on 18 Jun 2009

Fresh Catch For June 18th

These are my new delicious links for June 18th:

Published by breki on 17 Jun 2009

Fresh Catch For June 17th

These are my new delicious links for June 17th:

Published by breki on 16 Jun 2009

Gallio: Starting And Stopping Selenium Server Automatically During Testing Using AssemblyFixture

UPDATE (June 17th): I’ve updated the code, see the reasons for it at the end of the post.

In previous projects I worked on we made sure the Selenium Java server was running by manually starting it on our machines (both developers’ and build ones). This was cumbersome: restarting the build server meant we had to log on to the server after the reboot and run the Selenium server again. Of course, a lot of times we forgot to do this, which caused the build to fail.

This got me into thinking: is there a way in Gallio to specify some initialization (and cleanup) actions on the test assembly level? And of course, the answer is yes: using the AssemblyFixture attribute. This is what I like about Gallio/MbUnit: most of the time the feature requests I come up with are actually already implemented.

So anyway, you can specify this attribute on a class and then add FixtureSetUp and FixtureTearDown attributes on its methods. These will be executed on the test assembly-level: setup methods will be executed before any test fixtures have been run and teardown methods will be executed before the test assembly has been unloaded by the test runner.

I then used this nice feature to start the Selenium server and then dispose of it after tests:

[AssemblyFixture]
public class SeleniumTestingSetup : IDisposable
{
    [FixtureSetUp]
    public void Setup()
    {
        seleniumServerProcess = new Process();
        seleniumServerProcess.StartInfo.FileName = "java";
        seleniumServerProcess.StartInfo.Arguments =
            "-jar ../../../lib/Selenium/selenium-server/selenium-server.jar -port 6371";
        seleniumServerProcess.Start();
    }

    /// <summary>
    /// Performs application-defined tasks associated with freeing, releasing, or
    /// resetting unmanaged resources.
    /// </summary>
    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    /// <summary>
    /// Disposes the object.
    /// </summary>
    /// <param name="disposing">If <code>false</code>, cleans up native resources. 
    /// If <code>true</code> cleans up both managed and native resources</param>
    protected virtual void Dispose(bool disposing)
    {
        if (false == disposed)
        {
            if (disposing)
                DisposeOfSeleniumServer();

            disposed = true;
        }
    }

    private void DisposeOfSeleniumServer()
    {
        if (seleniumServerProcess != null)
        {
            try
            {
                seleniumServerProcess.Kill();
                bool result = seleniumServerProcess.WaitForExit(10000);
            }
            finally
            {
                seleniumServerProcess.Dispose();
                seleniumServerProcess = null;
            }
        }
    }

    private bool disposed;
    private Process seleniumServerProcess;
}

Note that the class is disposable – this ensures the Selenium server is stopped even if you run tests in the debugger and then force the debugger to stop before finishing the work. The Dispose method calls DisposeOfSeleniumServer, which does the actual work of killing the process and disposing of the evidence.

NOTE: This is a second version of the code. I needed to update the old one because I noticed that when running the tests in CruiseControl.NET, the Selenium server java process was not stopped properly. The only way I could stop it is by killing it, which in general isn’t a good practice. The unfortunate side effect of this “killing” is that the CruiseContol.NET service cannot be stopped normally – it also has to be killed when you need to restart it. I’ll try to solve this problem in the future.

Published by breki on 10 Jun 2009

ASP.NET MVC: Use Integrated Managed Pipeline Mode

A note to myself: the IIS application under which an ASP.NET MVC application runs has to be set up to use Integrated Managed Pipeline Mode (Advanced Settings…), otherwise you’ll end up with the

HTTP Error 404.0 – Not Found

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

error for any virtual URL (other than the default one).

This of course applies to IIS 6 and above.

Published by breki on 09 Jun 2009

Fresh Catch For June 9th

These are my new delicious links for June 9th:

Next »