Skip to content
Commits on Source (10)
mkgmap-splitter (0.0.0+svn583-1) UNRELEASED; urgency=medium
mkgmap-splitter (0.0.0+svn591-1) unstable; urgency=medium
* New upstream SVN snapshot.
* Bump Standards-Version to 4.1.3, no changes.
......@@ -6,8 +6,13 @@ mkgmap-splitter (0.0.0+svn583-1) UNRELEASED; urgency=medium
* Use pkg-info.mk variables instead of dpkg-parsechangelog output.
* Update copyright-format URL to use HTTPS.
* Update Vcs-* URLs for Salsa.
* Update watch file to use HTTPS.
* Add openjdk-9 to JAVA_CMDS list.
* Add junit4 to build dependencies.
* Add junit4.jar to test classpath.
* Add ant-optional to build dependencies.
-- Bas Couwenberg <sebastic@debian.org> Sat, 01 Jul 2017 13:58:57 +0200
-- Bas Couwenberg <sebastic@debian.org> Sun, 01 Apr 2018 11:53:04 +0200
mkgmap-splitter (0.0.0+svn548-1) unstable; urgency=medium
......
......@@ -6,6 +6,7 @@ Priority: optional
Build-Depends: debhelper (>= 9),
javahelper,
ant,
ant-optional,
default-jdk-headless (>= 2:1.8) | java8-sdk-headless,
libbsh-java,
libfastutil-java,
......@@ -13,6 +14,7 @@ Build-Depends: debhelper (>= 9),
libprotobuf-java,
libosmpbf-java,
libxpp3-java,
junit4,
testng (>= 6.8.8),
docbook2x,
docbook-xsl,
......
......@@ -25,15 +25,15 @@ Files: src/uk/me/parabola/splitter/DataStorer.java
src/uk/me/parabola/splitter/solver/PrecompSeaReader.java
src/uk/me/parabola/splitter/solver/Solution.java
src/uk/me/parabola/splitter/solver/TileMetaInfo.java
src/uk/me/parabola/splitter/tools/BitReader.java
src/uk/me/parabola/splitter/tools/BitWriter.java
src/uk/me/parabola/splitter/tools/Long2IntClosedMap.java
src/uk/me/parabola/splitter/tools/Long2IntClosedMapFunction.java
src/uk/me/parabola/splitter/tools/OSMId2ObjectMap.java
src/uk/me/parabola/splitter/tools/SparseBitSet.java
src/uk/me/parabola/splitter/writer/O5mMapWriter.java
src/uk/me/parabola/splitter/writer/PseudoOSMWriter.java
test/uk/me/parabola/splitter/TestAreaSet.java
test/uk/me/parabola/splitter/tools/TestSparseBitSet.java
Copyright: 2012-2014, Gerd Petermann <gpetermann_muenchen@hotmail.com>
Copyright: 2012-2014, 2017, Gerd Petermann <gpetermann_muenchen@hotmail.com>
License: GPL-2 or GPL-3
Files: src/org/openstreetmap/osmosis/core/*
......
......@@ -9,6 +9,7 @@ ALTERNATIVE_JDK="`readlink -n -f /etc/alternatives/java`"
ARCH="`dpkg --print-architecture`"
JAVA_CMDS="$JAVA_HOME/bin/java"
JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-9-openjdk-$ARCH/bin/java"
JAVA_CMDS="${JAVA_CMDS} /usr/lib/jvm/java-8-openjdk-$ARCH/bin/java"
JAVA_CMDS="${JAVA_CMDS} /usr/bin/java"
......
......@@ -22,7 +22,7 @@ Forwarded: not-needed
<!-- the project's build timestamp -->
<tstamp>
@@ -63,13 +65,22 @@
@@ -71,13 +73,23 @@
<!-- Classpaths -->
<path id="classpath">
<pathelement location="${build.classes}"/>
......@@ -43,11 +43,12 @@ Forwarded: not-needed
+ <include name="testng.jar"/>
+ <include name="bsh.jar"/>
+ <include name="jcommander.jar"/>
+ <include name="junit4.jar"/>
+ </fileset>
</path>
<!-- targets for downloading and registering ivy -->
@@ -204,14 +215,14 @@
@@ -212,14 +224,14 @@
</propertyfile>
</target>
......@@ -64,7 +65,7 @@ Forwarded: not-needed
<javac srcdir="${test}" destdir="${build.test-classes}" debug="yes" includeantruntime="false">
<include name="**/*.java"/>
<classpath refid="test.classpath"/>
@@ -247,7 +258,7 @@
@@ -271,7 +283,7 @@
</copy>
<copy todir="${dist}/lib">
......
......@@ -3,5 +3,5 @@ opts=\
uversionmangle=s/(\d+)/0.0.0+svn$1/,\
downloadurlmangle=s/\.zip/-src.tar.gz/,\
filenamemangle=s/\/download\/splitter-r([\d]+)\.zip/splitter-r$1-src.tar.gz/ \
http://www.mkgmap.org.uk/download/splitter.html \
https://www.mkgmap.org.uk/download/splitter.html \
(?:.*)/download/splitter-r([\d]+).zip
......@@ -36,20 +36,15 @@ Tiles join exactly with no overlap or gaps.
You will need a lot of memory on your computer if you intend to split a
large area.
A few options allow configuring how much memory you need.
With the default parameters, you need about 4-5 bytes for every node and
With the default parameters, you need about 2 bytes for every node and
way.
This doesn't sound a lot but there are about 1700 million nodes in the
whole planet file and so you cannot process the whole planet in one pass
file on a 32 bit machine using this utility as the maximum java heap
This doesn't sound a lot but there are about 4300 million nodes in the
whole planet file (Jan 2018) and so you cannot process the whole planet in one
pass on a 32 bit machine using this utility, as the maximum java heap
space is 2G.
It is possible with 64 bit java and about 7GB of heap or with multiple
It is possible with 64 bit java and about 10GB of heap or with multiple
passes.
.PP
The Europe extract from Cloudmade or Geofabrik can be processed within
the 2G limit if you have sufficient memory.
With the default options europe is split into about 750 tiles.
The Europe extract is about half of the size of the complete planet file.
.PP
On the other hand a single country, even a well mapped one such as
Germany or the UK, will be possible on a modest machine, even a netbook.
.SH USAGE
......@@ -79,14 +74,13 @@ There are also other files produced:
The \*(T<\fItemplate.args\fR\*(T> file is a file that can
be used with the \*(T<\fB\-c\fR\*(T> option of
\fBmkgmap\fR that will compile all the files.
You can use it as is or you can copy it and edit it to include
your own options.
You can use it as is or you can edit it to include your own options.
For example instead of each description being "OSM Map" it could
be "NW Scotland" as appropriate.
.PP
The \*(T<\fIareas.list\fR\*(T> file is the list of bounding
boxes that were calculated.
If you want you can use this on a subsequent call the the
If you want, you can use this on subsequent calls of
splitter using the \*(T<\fB\-\-split\-file\fR\*(T> option to use
exactly the same areas as last time.
This might be useful if you produce a map regularly and want to
......@@ -94,8 +88,8 @@ keep the tile areas the same from month to month.
It is also useful to avoid the time it takes to regenerate the
file each time (currently about a third of the overall time
taken to perform the split).
Of course if the map grows enough that one of the tiles overflows
you will have to re-calculate the areas again.
Of course if the map grows enough that one of the tiles overflows, you
will have to re-calculate the areas again.
.PP
The \*(T<\fIareas.poly\fR\*(T> file contains the bounding
polygon of the calculated areas.
......@@ -265,9 +259,9 @@ If the input file contains a bounding box, this is applied to the
grid so that nodes outside of the bounding box are ignored.
Next, if specified, the bounding polygon is used to zero those
grid elements outside of the bounding polygon area.
If the polygon area(s) describe(s) a rectilinear area with no more
If the polygon file describes one or more rectilinear areas with no more
than 40 vertices, \fBmkgmap-splitter\fR will try to
create output files that fit exactly into the area, otherwise it
create output files that fit exactly into each area, otherwise it
will approximate the polygon area with rectangles.
.TP
\*(T<\fB\-\-precomp\-sea=\fR\*(T>\fIpath\fR
......
......@@ -47,21 +47,15 @@
You will need a lot of memory on your computer if you intend to split a
large area.
A few options allow configuring how much memory you need.
With the default parameters, you need about 4-5 bytes for every node and
With the default parameters, you need about 2 bytes for every node and
way.
This doesn't sound a lot but there are about 1700 million nodes in the
whole planet file and so you cannot process the whole planet in one pass
file on a 32 bit machine using this utility as the maximum java heap
This doesn't sound a lot but there are about 4300 million nodes in the
whole planet file (Jan 2018) and so you cannot process the whole planet in
one pass on a 32 bit machine using this utility as the maximum java heap
space is 2G.
It is possible with 64 bit java and about 7GB of heap or with multiple
It is possible with 64 bit java and about 10GB of heap or with multiple
passes.
</para>
<para>
The Europe extract from Cloudmade or Geofabrik can be processed within
the 2G limit if you have sufficient memory.
With the default options europe is split into about 750 tiles.
The Europe extract is about half of the size of the complete planet file.
</para>
<para>
On the other hand a single country, even a well mapped one such as
Germany or the UK, will be possible on a modest machine, even a netbook.
......@@ -97,7 +91,7 @@ JAVA_OPTS="<replaceable>-Xmx512m</replaceable>" <command>mkgmap-splitter</comman
The <filename>template.args</filename> file is a file that can
be used with the <option>-c</option> option of
<command>mkgmap</command> that will compile all the files.
You can use it as is or you can copy it and edit it to include
You can use it as is or you can edit it to include
your own options.
For example instead of each description being "OSM Map" it could
be "NW Scotland" as appropriate.
......@@ -105,7 +99,7 @@ JAVA_OPTS="<replaceable>-Xmx512m</replaceable>" <command>mkgmap-splitter</comman
<para>
The <filename>areas.list</filename> file is the list of bounding
boxes that were calculated.
If you want you can use this on a subsequent call the the
If you want, you can use this on subsequent calls of
splitter using the <option>--split-file</option> option to use
exactly the same areas as last time.
This might be useful if you produce a map regularly and want to
......@@ -113,7 +107,7 @@ JAVA_OPTS="<replaceable>-Xmx512m</replaceable>" <command>mkgmap-splitter</comman
It is also useful to avoid the time it takes to regenerate the
file each time (currently about a third of the overall time
taken to perform the split).
Of course if the map grows enough that one of the tiles overflows
Of course if the map grows enough that one of the tiles overflows,
you will have to re-calculate the areas again.
</para>
<para>
......@@ -400,9 +394,9 @@ JAVA_OPTS="<replaceable>-Xmx512m</replaceable>" <command>mkgmap-splitter</comman
grid so that nodes outside of the bounding box are ignored.
Next, if specified, the bounding polygon is used to zero those
grid elements outside of the bounding polygon area.
If the polygon area(s) describe(s) a rectilinear area with no more
If the polygon-file describes one or more rectilinear areas with no more
than 40 vertices, <command>mkgmap-splitter</command> will try to
create output files that fit exactly into the area, otherwise it
create output files that fit exactly into each area, otherwise it
will approximate the polygon area with rectangles.
</para>
</listitem>
......
......@@ -19,16 +19,11 @@ The two most important features are:
You will need a lot of memory on your computer if you intend to split a large
area. A few options allow configuring how much memory you need. With the
default parameters, you need about 4-5 bytes for every node and way. This
doesn't sound a lot but there are about 1700 million nodes in the whole planet
file and so you cannot process the whole planet in one pass file on a 32 bit
machine using this utility as the maximum java heap space is 2G. It is
possible with 64 bit java and about 7GB of heap or with multiple passes.
The Europe extract from Cloudmade or Geofabrik can be processed within the 2G
limit if you have sufficient memory. With the default options europe is split
into about 750 tiles. The Europe extract is about half of the size of the
complete planet file.
default parameters, you need about 2 bytes for every node and way. This
doesn't sound a lot but there are about 4300 million nodes in the whole planet
file (Jan 2018) and so you cannot process the whole planet in one pass on
a 32 bit machine using this utility, as the maximum java heap space is 2G. It is
possible with 64 bit java and about 10GB of heap or with multiple passes.
On the other hand a single country, even a well mapped one such as Germany or
the UK, will be possible on a modest machine, even a netbook.
......@@ -50,21 +45,20 @@ This will produce a number of .osm.pbf files that can be read by mkgmap.
There are also other files produced:
The ''template.args'' file is a file that can be used with the -c option of
mkgmap that will compile all the files. You can use it as is or you can copy
it and edit it to include your own options. For example instead of each
mkgmap that will compile all the files. You can use it as is or you can
edit it to include your own options. For example instead of each
description being "OSM Map" it could be "NW Scotland" as appropriate.
The ''areas.list'' file is the list of bounding boxes that were calculated. If
you want you can use this on a subsequent call the the splitter using the
you want, you can use this on subsequent calls of splitter using the
--split-file option to use exactly the same areas as last time. This might be
useful if you produce a map regularly and want to keep the tile areas the same
from month to month. It is also useful to avoid the time it takes to
regenerate the file each time (currently about a third of the overall time
taken to perform the split). Of course if the map grows enough that one of the
tiles overflows you will have to re-calculate the areas again.
tiles overflows, you will have to re-calculate the areas again.
The ''areas.poly'' file contains the bounding polygon of the calculated areas.
See option --polygon-file how this can be used.
The ''densities-out.txt'' file is written when no split-file is given and
contains debugging information only.
......@@ -167,14 +161,14 @@ will be printed because this combination rarely makes sense.
;--polygon-file
: The name of a file containing a bounding polygon in the
[http://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format osmosis polygon file format].
Splitter uses this fie when calculating the areas. It first calculates a grid
Splitter uses this file when calculating the areas. It first calculates a grid
using the given --resolution. The input file is read and for each node, a
counter is increased for the related grid area. If the input file contains a
bounding box, this is applied to the grid so that nodes outside of the
bounding box are ignored. Next, if specified, the bounding polygon is used to
zero those grid elements outside of the bounding polygon area. If the polygon
area(s) describe(s) a rectilinear area with no more than 40 vertices, splitter
will try to create output files that fit exactly into the area, otherwise it
zero those grid elements outside of the bounding polygon area. If the polygon-file
describes one or more rectilinear areas with no more than 40 vertices, splitter
will try to create output files that fit exactly into each area, otherwise it
will approximate the polygon area with rectangles.
;--precomp-sea
......
svn.version: 583
build.timestamp: 2017-04-01T15:52:04+0100
svn.version: 591
build.timestamp: 2018-03-09T14:31:20+0000
......@@ -15,6 +15,8 @@ package uk.me.parabola.splitter;
import java.io.File;
import java.io.IOException;
import java.time.Duration;
import java.time.Instant;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
......@@ -101,7 +103,7 @@ public class Main {
healthMonitor.start();
}
long start = System.currentTimeMillis();
Instant start = Instant.now();
System.out.println("Time started: " + new Date());
try {
// configure the input file handler
......@@ -149,7 +151,20 @@ public class Main {
return 1;
}
System.out.println("Time finished: " + new Date());
System.out.println("Total time taken: " + (System.currentTimeMillis() - start) / 1000 + 's');
Duration duration = Duration.between(start, Instant.now());
long seconds = duration.getSeconds();
if (seconds > 0) {
long hours = seconds / 3600;
seconds -= hours * 3600;
long minutes = seconds / 60;
seconds -= minutes * 60;
System.out.println("Total time taken: " +
(hours > 0 ? hours + (hours > 1 ? " hours " : " hour ") : "") +
(minutes > 0 ? minutes + (minutes > 1 ? " minutes " : " minute ") : "") +
(seconds > 0 ? seconds + (seconds > 1 ? " seconds" : " second") : ""));
}
else
System.out.println("Total time taken: " + duration.getNano() / 1000000 + " ms");
return rc;
}
......
......@@ -69,7 +69,7 @@ public class Utils {
* @return An integer value in map units.
*/
public static int toMapUnit(double l) {
double DELTA = 0.000001; // TODO check if we really mean this
double DELTA = 360.0D / (1 << 24) / 2; //Correct rounding
if (l > 0)
return (int) ((l + DELTA) * (1 << 24)/360);
return (int) ((l - DELTA) * (1 << 24)/360);
......
/*
* Copyright (C) 2008 Steve Ratcliffe
* Copyright (C) 2017, Gerd Petermann
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* it under the terms of the GNU General Public License version 3 or
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* Author: Steve Ratcliffe
* Create date: 29-Aug-2008
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
package uk.me.parabola.splitter.tools;
/**
* Read an array as a bit stream.
* Read an array as a bit stream. Based on code in mkgmap.
*
* @author Steve Ratcliffe
* @author Gerd Petermann
......
/*
* Copyright (C) 2006 Steve Ratcliffe
* Copyright (C) 2017, Gerd Petermann
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
* it under the terms of the GNU General Public License version 3 or
* version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* Author: Steve Ratcliffe
* Create date: 14-Dec-2006
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*/
package uk.me.parabola.splitter.tools;
import java.util.Arrays;
/**
* A class to write the bitstream.
* A class to write the bitstream. Based on code in mkgmap.
*
* @author Steve Ratcliffe
* @author Gerd Petermann
*/
public class BitWriter {
// Choose so that chunks will not fill it.
......