[OSM-dev] osm2pgsql Windows build

Kai Krueger kakrueger at gmail.com
Sat Dec 15 18:17:00 GMT 2012


On 12/14/2012 01:08 PM, Dominik Perpeet wrote:
>
>> The idea behind the same location was so that any documentation or
>> links that still point to that location would automatically be
>> up-to-date again. That would probably be easier than finding any and
>> all documentation for windows and update them. Although perhaps it
>> would be good anyway to check if the rest still works.
> Since my version isn't feature complete, it shouldn't be in the same
> location.
>
>>
>> Sounds like the same reason I gave up on it too. But if it were of
>> help, I could finish it off fairly quickly.
>>
>> How much work would it be to move things to C++? Any disadvantages for
>> it?
>
> As Frederik stated, refactoring is always a lot easier if there are
> tests for the most important use cases. I would change the code in
> several steps:
> 1. refactor without changing functionality: move to C++ classes, keep fork()
> 2. switch to some kind of threading (away from fork)
> 3. look at the build system (linux, osx, windows)
>
> If someone else can take care of the test cases,

There already are some tests in osm2pgsql. (tests/regression_test.sh)

Currently they are only self referential though, testing that all of the 
options that should give the same results do give the same results. For 
the moment, the tests also only validate that the number of lines / 
nodes / roads / polygons are the same, not however that the tags and 
geometries are identical. It shouldn't be too hard to extend those tests 
to a few more summery statistics though. E.g. that the total length of 
all ways or the sum area of all polygons match to test the geometries too.

Furthermore, if one would decide on a standard input dataset, one could 
pretty easily make the tests absolute and not relative, to catch errors 
that change output for all parameter settings.

Unfortunately the tests currently fail.

osm2pgsql -S default.style -l -C 100 liechtenstein.osm.pbf
and
osm2pgsql -S default.style -C 100 liechtenstein.osm.pbf

produce slightly different results with the number of lines and roads 
differing by one each.

Are there any other easy to run tests that can be added?

Would it make sense to try and add those tests to ci.openstreetmap.org?


Kai


I could write a
> proposal for the refactored C++ structure. Having those tests would
> probably reduce the refactoring to a couple of evenings (and make
> everyone feel better).
>
>




More information about the dev mailing list