Serval Maps Utils - OSM PBF Bounding Box Split

The rationale behind the development of the OSM PBF Bounding Box Split applicant is to split the bounding box defined in an OpenStreetMap data file in the PBF format into 4 equal quadrants.

Optionally the application can take a script that is designed to invoke the Osmosis application and modify it with the correct values for splitting the input file into four separate files using the four bounding boxes derived from the input file.

The application can process a single file, or alternatively the application will recursively search through a directory looking for data files. If the directory search option is used it is possible to specify a minimum file size that the file must exceed before the bounding box split calculations is undertaken.

Using the Application

This application is written in Java and uses a command-line interface. The application supports the following command line options.

Option Description Allowed Values Required
-ignore path to a file containing a list of files to ignore a file system path no
-input path to the file to process, or to the top level directory of a tree to search a file system path yes
-minsize the minimum file size a file must exceed in order to be processed an integer representing file size in MB no (default is 10MB)
-output path to the output directory for the osmosis scripts a file system path no
-template path to the osmosis script template a file system path no

The application will recursively look for data files, those ending with an extension of .osm.pbf, starting at the directory specified by the -input parameter.

Alternatively the path to a single file to check can also be provided using the -input option.

Osmosis Script Template

This application can optionally create a script to invoke Osmosis to split the input file into four smaller files using the calculated bounding boxes. A sample script template is provided.

Ignore File List

This application can optionally use an ignore list to identify files which must not be processed. A sample ignore file is provided.