improve split algorithm: Try harder to find split that gives
equally sized tiles.

This will typically result in fewer tiles which are closer to
the max-nodes value.

git-svn-id: http://svn.mkgmap.org.uk/splitter/trunk@322 838fabe5-b1a8-4b81-9896-7a84386980e9
apply num-tiles-v1.patch

This implements the new num-tiles option:
--num-tiles       A target value that is used when no split-file is given.
                  Splitting is done so that the given number of tiles is
                  produced. The max-nodes value is ignored if this 
                  option is given.

git-svn-id: http://svn.mkgmap.org.uk/splitter/trunk@323 838fabe5-b1a8-4b81-9896-7a84386980e9
code spring clean, no change in output expected

- add static where appropriate
- improve type safety

git-svn-id: http://svn.mkgmap.org.uk/splitter/trunk@324 838fabe5-b1a8-4b81-9896-7a84386980e9
improve split algorithm: First try to find a small improvement.

Up to now splitter tried to find a much better solution
after the first valid split was found. If this much better
solution didn't exist, the initial solution was used.
Now, splitter tries to find any better solution first and
continues with smaller steps.

git-svn-id: http://svn.mkgmap.org.uk/splitter/trunk@325 838fabe5-b1a8-4b81-9896-7a84386980e9