pax_global_header 0000666 0000000 0000000 00000000064 13162451514 0014514 g ustar 00root root 0000000 0000000 52 comment=ed08243cfdfb92ad24aac286724d5a591bc9d49b
osmosis-0.46/ 0000775 0000000 0000000 00000000000 13162451514 0013141 5 ustar 00root root 0000000 0000000 osmosis-0.46/.gitignore 0000664 0000000 0000000 00000000065 13162451514 0015132 0 ustar 00root root 0000000 0000000 .gradle
.idea
*.javaEe
*.javae
*.iml
*.ipr
*.iws
out
osmosis-0.46/.travis.yml 0000664 0000000 0000000 00000000076 13162451514 0015255 0 ustar 00root root 0000000 0000000 services:
- docker
script:
- ./docker.sh ./gradlew build
osmosis-0.46/README.md 0000664 0000000 0000000 00000005754 13162451514 0014433 0 ustar 00root root 0000000 0000000 # Osmosis
[](https://travis-ci.org/openstreetmap/osmosis)
## Overview
Osmosis is a command line Java application for processing Open Street Map
(http://www.openstreetmap.org) data.
The tool consists of a series of pluggable components that can be chained
together to perform a larger operation. For example, it has components for
reading from database and from file, components for writing to database and to
file, components for deriving and applying change sets to data sources,
components for sorting data, etc. It has been written so that it is easy to add
new features without re-writing common tasks such as file or database handling.
Some brief build, running and installation notes are provided below, however
most documentation may be found on the project wiki page.
http://wiki.openstreetmap.org/wiki/Osmosis
## Installation
It is recommended to use a pre-built distribution archive rather than compile
from source. The location of the latest builds are specified on the project
wiki. These archives may be extracted to a location of your choice. The bin
sub-directory should either be added to your PATH, or in the case of UNIX-like
environments the "osmosis" script may be symlinked into an existing directory
already on the PATH.
## Development
The easiest way to perform a full Osmosis build is to use the docker-based
development environment. If you have docker and docker-compose installed,
simply run the following command to build and launch a shell with everything
required to run the full build and test suite.
./docker.sh
Osmosis is built using the Gradle (http://gradle.org) built tool. Gradle itself
does not need to be installed because the gradlew script will install Gradle on
first usage. The only requirements are a 1.7 JDK, and an Internet connection.
Note that in the docker environment all downloads will still occur and be cached
in your home directory.
Below are several commands useful to build the software. All commands must be
run from the root of the source tree.
Perform a complete build including unit tests:
./gradlew build
Build the software without running unit tests:
./gradlew assemble
Clean the build tree:
./gradlew clean
Generate project files to allow the project to be imported into IntelliJ.
./gradlew idea
Generate project files to allow the project to be imported into Eclipse.
./gradlew eclipse
Verify checkstyle compliance:
./gradlew checkstyleMain checkstyleTest
After completing the build process, a working Osmosis installation is contained
in the package sub-directory. The Osmosis launcher scripts reside in the bin
sub-directory of package. On a UNIX-like environment use the "osmosis" script,
on a Windows environment use the "osmosis.bat" script.
Distribution archives in zip and tar gzipped formats are contained in the
package/build/distribution directory.
## Issue Tracking
See https://trac.openstreetmap.org/query?status=!closed&component=osmosis
osmosis-0.46/build-support/ 0000775 0000000 0000000 00000000000 13162451514 0015752 5 ustar 00root root 0000000 0000000 osmosis-0.46/build-support/.gitignore 0000664 0000000 0000000 00000000017 13162451514 0017740 0 ustar 00root root 0000000 0000000 .project
/ivy
osmosis-0.46/build-support/checkstyle.xml 0000664 0000000 0000000 00000014505 13162451514 0020637 0 ustar 00root root 0000000 0000000
osmosis-0.46/build-support/docker/ 0000775 0000000 0000000 00000000000 13162451514 0017221 5 ustar 00root root 0000000 0000000 osmosis-0.46/build-support/docker/build.sh 0000775 0000000 0000000 00000000520 13162451514 0020654 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
set -e
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${scriptDir}"
. ./env.sh
# Build the docker image used for the interactive gradle enabled build environment.
./build/build.sh
# Build the docker image for the database server used for running database task integration tests.
./db/build.sh
osmosis-0.46/build-support/docker/build/ 0000775 0000000 0000000 00000000000 13162451514 0020320 5 ustar 00root root 0000000 0000000 osmosis-0.46/build-support/docker/build/Dockerfile 0000664 0000000 0000000 00000000646 13162451514 0022320 0 ustar 00root root 0000000 0000000 FROM java:8
ARG CURRENT_USER_ID
ARG CURRENT_GROUP_ID
RUN mkdir /gradle
RUN chown "${CURRENT_USER_ID}":"${CURRENT_GROUP_ID}" /gradle
ENV GRADLE_USER_HOME /gradle
# Fix the broken PS1 prompt caused by the runtime UID not existing in the container.
RUN echo "PS1=\"[osmosis-dev \\w]\\$ \"" >> /etc/bash.bashrc
USER "${CURRENT_USER_ID}":"${CURRENT_GROUP_ID}"
WORKDIR /project
VOLUME /project
VOLUME /home/builder/.gradle
osmosis-0.46/build-support/docker/build/build.sh 0000775 0000000 0000000 00000000424 13162451514 0021756 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
set -e
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${scriptDir}"
# Build the docker image.
docker build -t="openstreetmap.org/osmosis-build-${userId}" --build-arg CURRENT_USER_ID=${userId} --build-arg CURRENT_GROUP_ID=${groupId} .
osmosis-0.46/build-support/docker/db/ 0000775 0000000 0000000 00000000000 13162451514 0017606 5 ustar 00root root 0000000 0000000 osmosis-0.46/build-support/docker/db/.gitignore 0000664 0000000 0000000 00000000037 13162451514 0021576 0 ustar 00root root 0000000 0000000 .classpath
.project
.settings
osmosis-0.46/build-support/docker/db/Dockerfile 0000664 0000000 0000000 00000000455 13162451514 0021604 0 ustar 00root root 0000000 0000000 FROM fedora:24
# Install UTF8 locale support
RUN dnf install -y langpacks-en.noarch
# Install PostgreSQL
RUN dnf install -y postgresql-server postgresql-contrib
# Install PostGIS
RUN dnf install -y postgis
EXPOSE 5432
COPY docker-start.sh /start.sh
COPY script /install/script
CMD ["/start.sh"]
osmosis-0.46/build-support/docker/db/build.sh 0000775 0000000 0000000 00000000602 13162451514 0021242 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
set -e
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${scriptDir}"
# Build the docker image.
# The use of tar is a workaround for the docker restriction of not following symlinks. This
# tar command dereferences symlinks and then passes the resultant archive to the docker build.
tar -czh . | docker build -t="openstreetmap.org/osmosis-db" -
osmosis-0.46/build-support/docker/db/docker-start.sh 0000775 0000000 0000000 00000006047 13162451514 0022556 0 ustar 00root root 0000000 0000000 #!/bin/bash
DATADIR="/var/lib/pgsql/data"
# test if DATADIR has content
if [ ! "$(ls -A $DATADIR)" ]; then
echo "Initializing Postgres Database at $DATADIR"
su postgres sh -lc "initdb --encoding=UTF-8 --locale=en_US.UTF-8"
su postgres sh -lc "postgres --single -jE" <<-EOSQL
CREATE USER osm WITH SUPERUSER PASSWORD 'password';
EOSQL
# Allow the osm user to connect remotely with a password.
echo "listen_addresses = '*'" >> "${DATADIR}/postgresql.conf"
echo "host all osm 0.0.0.0/0 md5" >> "${DATADIR}/pg_hba.conf"
# Create the pgsimple database owned by osm.
su postgres sh -lc "postgres --single -jE" <<-EOSQL
CREATE DATABASE pgosmsimp06_test OWNER osm;
EOSQL
# Create the pgsnapshot database owned by osm.
su postgres sh -lc "postgres --single -jE" <<-EOSQL
CREATE DATABASE pgosmsnap06_test OWNER osm;
EOSQL
su postgres sh -lc "postgres --single -jE" <<-EOSQL
CREATE DATABASE pgosmsnap06_test_with_schema OWNER osm;
EOSQL
# Create the apidb database owned by osm.
su postgres sh -lc "postgres --single -jE" <<-EOSQL
CREATE DATABASE api06_test OWNER osm;
EOSQL
# Start the database server temporarily while we configure the databases.
su postgres sh -lc "pg_ctl -w start"
# Configure the pgosmsimp06_test database as the OSM user.
su postgres sh -lc "psql -U osm pgosmsimp06_test" <<-EOSQL
CREATE EXTENSION postgis;
\i /install/script/pgsimple_schema_0.6.sql
\i /install/script/pgsimple_schema_0.6_action.sql
\i /install/script/pgsimple_schema_0.6_bbox.sql
\i /install/script/pgsimple_schema_0.6_linestring.sql
EOSQL
# Configure the pgosmsnap06_test database as the OSM user.
su postgres sh -lc "psql -U osm pgosmsnap06_test" <<-EOSQL
CREATE EXTENSION hstore;
CREATE EXTENSION postgis;
\i /install/script/pgsnapshot_schema_0.6.sql
\i /install/script/pgsnapshot_schema_0.6_action.sql
\i /install/script/pgsnapshot_schema_0.6_bbox.sql
\i /install/script/pgsnapshot_schema_0.6_linestring.sql
EOSQL
# Configure the pgosmsnap06_test_with_schema database as the OSM user.
su postgres sh -lc "psql -U osm pgosmsnap06_test_with_schema" <<-EOSQL
CREATE SCHEMA test_schema;
SET search_path TO test_schema,public;
CREATE EXTENSION hstore;
CREATE EXTENSION postgis;
\i /install/script/pgsnapshot_schema_0.6.sql
\i /install/script/pgsnapshot_schema_0.6_action.sql
\i /install/script/pgsnapshot_schema_0.6_bbox.sql
\i /install/script/pgsnapshot_schema_0.6_linestring.sql
EOSQL
# Configure the api06_test database as the OSM user.
su postgres sh -lc "psql -U osm api06_test" <<-EOSQL
\i /install/script/contrib/apidb_0.6.sql
\i /install/script/contrib/apidb_0.6_osmosis_xid_indexing.sql
EOSQL
# Stop the database.
su postgres sh -lc "pg_ctl -w stop"
fi
SHUTDOWN_COMMAND="echo \"Shutting down postgres\"; su postgres sh -lc \"pg_ctl -w stop\""
trap "${SHUTDOWN_COMMAND}" SIGTERM
trap "${SHUTDOWN_COMMAND}" SIGINT
# Start the database server.
su postgres sh -lc "pg_ctl -w start"
echo "Docker container startup complete"
# Wait for the server to exit.
while test -e "/var/lib/pgsql/data/postmaster.pid"; do
sleep 0.5
done
osmosis-0.46/build-support/docker/db/readme.txt 0000664 0000000 0000000 00000001240 13162451514 0021601 0 ustar 00root root 0000000 0000000 This directory contains the scripts to create a docker-based database server to be used for unit testing.
In order to use this server, docker must be installed on the local workstation. Beyond that, no additional
configuration should be required.
To build the docker image, run the following script.
./build.sh
To run the docker image, run the following command. To stop the server, press Ctrl-C.
docker run -ti --rm=true --name osmosis-build -p 5432:5432 openstreetmap.org/osmosis-db
If you wish to troubleshoot a running server, you may run the following command to get a bash prompt
inside the docker container.
docker exec -ti osmosis-build /bin/bash
osmosis-0.46/build-support/docker/db/script 0000777 0000000 0000000 00000000000 13162451514 0024513 2../../../package/script ustar 00root root 0000000 0000000 osmosis-0.46/build-support/docker/docker-compose.yml 0000664 0000000 0000000 00000000350 13162451514 0022654 0 ustar 00root root 0000000 0000000 version: "2"
services:
build:
image: openstreetmap.org/osmosis-build-${userId}
links:
- db
volumes:
- ${gradleUserDir}:/gradle
- ${projectDir}:/project
db:
image: openstreetmap.org/osmosis-db
osmosis-0.46/build-support/docker/env.sh 0000664 0000000 0000000 00000000216 13162451514 0020344 0 ustar 00root root 0000000 0000000 export gradleUserDir="${HOME}/.gradle"
export userId=$(id -u)
export groupId=$(id -g)
export projectDir="$( cd "${scriptDir}"/../.. && pwd )"
osmosis-0.46/build-support/docker/run.sh 0000775 0000000 0000000 00000001017 13162451514 0020363 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
set -e
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${scriptDir}"
. ./env.sh
# Create gradle directory in user home if it doesn't already exist.
if [ ! -d "${gradleUserDir}" ]; then
mkdir "${gradleUserDir}"
fi
# Launch our docker build container interactively and destroy on exit.
runCommand="docker-compose run --rm build"
if [ $# -eq 0 ]; then
${runCommand} /bin/bash
else
${runCommand} "${@}"
fi
# Remove remaining containers (e.g. db server)
docker-compose down -v
osmosis-0.46/build-support/osmosis_formatting.xml 0000664 0000000 0000000 00000067550 13162451514 0022437 0 ustar 00root root 0000000 0000000
osmosis-0.46/build.gradle 0000664 0000000 0000000 00000007615 13162451514 0015431 0 ustar 00root root 0000000 0000000 task wrapper(type: Wrapper) {
gradleVersion = '4.2'
}
apply plugin: 'idea'
/* Build collections containing each type of project. These collections will
* be used to apply common configurations to projects of the same type.
*/
def packageProjects = allprojects.findAll { project -> project.path.equals(':package') }
def buildProjects = allprojects.findAll { project -> project.path.equals(':build-support') }
def dockerProjects = allprojects.findAll { project -> project.path.equals(':db-server') }
// Java projects are all those that aren't in the previous collections.
def javaProjects = subprojects.findAll { project -> !packageProjects.contains(project) && !buildProjects.contains(project) && !dockerProjects.contains(project) }
// Apply common project configuration
subprojects {
apply plugin: 'eclipse-wtp'
apply plugin: 'idea'
// All projects use a common group id.
group = 'org.openstreetmap.osmosis'
// Load the project version dynamically from Git. For release builds, don't add a suffix.
def versionSuffix = "RELEASE".equals(osmosisBuildType) ? '' : '-' + osmosisBuildType
version = 'git describe --always --dirty'.execute().in.text.trim() + versionSuffix
// Enable access to artefact dependency repositories.
repositories {
// Standard Maven repository.
mavenCentral()
}
}
// Apply common configurations to all projects supporting Java.
configure(javaProjects) {
apply plugin: 'checkstyle'
apply plugin: 'java'
apply plugin: 'jdepend'
apply plugin: 'maven'
apply plugin: 'signing'
sourceCompatibility = 1.8
test {
/*
* Pass on each of our custom properties to the unit tests if they have
* been provided.
*/
['db.apidb.authfile', 'db.pgsql.authfile'].each {
propName ->
if (System.getProperties().containsKey(propName)) {
jvmArgs '-D' + propName + '=' + System.getProperty(propName)
}
}
//testLogging.showStandardStreams = true
}
dependencies {
testCompile group: 'junit', name: 'junit', version: dependencyVersionJunit
}
checkstyle {
configFile = new File(rootDir, 'build-support/checkstyle.xml')
configProperties.samedir = configFile.parentFile
}
// Build javadoc and source jars and include in published artifacts.
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives jar
archives javadocJar
archives sourcesJar
}
// Sign all published artifacts if signing is enabled.
signing {
sign configurations.archives
required = Boolean.valueOf(osmosisSigningEnabled)
}
// Configure the maven plugin to upload artefacts to the Sonatype repository.
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
// We upload to the Sonatype SNAPSHOT repository unless it is a release build in
// which case we upload to the staging repository.
def sonatypeRepoUrl = "RELEASE".equals(osmosisBuildType) ?
'https://oss.sonatype.org/service/local/staging/deploy/maven2/' :
'https://oss.sonatype.org/content/repositories/snapshots/'
repository(url: sonatypeRepoUrl) {
authentication(userName: sonatypeUsername, password: sonatypePassword)
}
pom.project {
name project.name
packaging 'jar'
description 'Osmosis is a Java application and library for processing OSM data.'
url 'http://wiki.openstreetmap.org/wiki/Osmosis'
scm {
url 'https://github.com/openstreetmap/osmosis'
connection 'scm:git:git://github.com/openstreetmap/osmosis.git'
developerConnection 'scm:git:ssh://git@github.com/openstreetmap/osmosis.git'
}
licenses {
license {
name 'Public Domain'
}
}
developers {
developer {
id 'brett'
name 'Brett Henderson'
email 'brett@bretth.com'
}
}
}
}
}
}
}
osmosis-0.46/docker.sh 0000775 0000000 0000000 00000000403 13162451514 0014744 0 ustar 00root root 0000000 0000000 #!/usr/bin/env bash
set -e
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${scriptDir}"
# Build docker images.
./build-support/docker/build.sh
# Run our interactive gradle enabled build environment.
./build-support/docker/run.sh "${@}"
osmosis-0.46/gradle.properties 0000664 0000000 0000000 00000003366 13162451514 0016525 0 ustar 00root root 0000000 0000000 # Enable the gradle build daemon. The daemon is a gradle process that
# remains running between builds. This significantly speeds up build
# times.
org.gradle.daemon=true
# 3rd Party Library Versions
dependencyVersionClassworlds=2.5.2
dependencyVersionCommonsCodec=1.10
dependencyVersionCommonsCompress=1.14
dependencyVersionCommonsDbcp=1.4
dependencyVersionJpf=1.5
dependencyVersionJunit=4.12
dependencyVersionMySql=6.0.6
dependencyVersionNetty=3.10.6.Final
dependencyVersionPostGis=2.2.1
dependencyVersionPostgreSql=42.1.4
dependencyVersionProtobuf=3.4.0
dependencyVersionSpring=4.3.11.RELEASE
dependencyVersionWoodstoxCore=5.0.3
dependencyVersionWoodstoxStax2=4.0.0
dependencyVersionXerces=2.11.0
# Builds are signed if the osmosisSigningEnabled property is set to true.
# To enable signing, it is recommended to leave this file untouched and to
# create a gradle.properties in your /.gradle/ directory and override
# the setting there. It is also necessary to set the following properties:
# * signing.keyId - Something like ABCDEFGH (see gpg --list-keys)
# * signing.secretKeyRingFile - Something like /home//.gnupg/secring.gpg
# * signing.password - The password to unlock the secret key.
osmosisSigningEnabled=false
# If uploading to the Sonatype repositories, a username/password must be
# provided. To do this, create a gradle.properties in your /.gradle/
# directory and override the below property values there.
sonatypeUsername=DO NOT EDIT ME. Read the above comments.
sonatypePassword=DO NOT EDIT ME. Read the above comments.
# By default, all builds are SNAPSHOT builds. To create a release build, this
# property should be overridden to be RELEASE. Note that this variable should
# not be updated.
osmosisBuildType=SNAPSHOT
osmosis-0.46/gradle/ 0000775 0000000 0000000 00000000000 13162451514 0014377 5 ustar 00root root 0000000 0000000 osmosis-0.46/gradle/wrapper/ 0000775 0000000 0000000 00000000000 13162451514 0016057 5 ustar 00root root 0000000 0000000 osmosis-0.46/gradle/wrapper/gradle-wrapper.jar 0000664 0000000 0000000 00000152664 13162451514 0021507 0 ustar 00root root 0000000 0000000 PK A META-INF/ PK A èëF
? T META-INF/MANIFEST.MFóMÌËLK-.Ñ
K-*ÎÌϳR0Ô3àåòÌ-ÈIÍMÍ+I,
ê†d–ä¤Z)¸%¦ä¤bȵšèñrñr PK A org/ PK A org/gradle/ PK A org/gradle/wrapper/ PK A ïzZ—ï Õ - org/gradle/wrapper/BootstrapMainStarter.classVYwÓVþË–#DgH!ÄÎbSJiIh
¸ œ@c5¡Å¾v²”Ê2$ݺ÷ðÚ—¾–›–SzúÚÑ?B;W²opšœs—Ù¿™;#ÿýü÷g ^ÁO2Bx[ÆaÌKXpAÆ .ÊXÄ%—‘âË’–e\ÁU¾¼Ä
§¤ƒ¸&Ẅ)ÝX•pCÆ»ÈH¸¹ýX“p+ˆ÷¸¹Û|yŸ/w‚Pe¬#+!ãǼŒC(HØ8£š='À
“fŽ èNi[.×™uM]׉J™YU_U-ßkDÑÞÐJb)Ó*$
–šÓYâ¥nn2+qÞ4í’M—%U3Ò¶jÙÌšà/ñ£€£ÑµÔ]õ¾šÐU£HÛ–ff]Šf&4Í:ñ¨V<ôµ »./šEŠ¥«QY@§Ë½¤Z}Ö4l¶e'uµTJ™jŽ1ìjÌN\_IÕ±¸r‘¢vHzë|;$îšó—˜½aæÕ X,¯³¬py$9ؘ¸íM/yýÍfÏLÌqËó[Y¶ik¦Q’ Q)òš‘K©e#»Á,Ìp´)OÍÈżæTGµ¬£d`…¯3ƒÂ¢€rÚ,[Y¶àh…Û.Î-(8‚Q3 û^:J=GÁ]Ü“ +(Â`*ØÄ
,¾´”q_Ál0zFq·jq½†8~Á¹óXlãCŠž§ž`5eOÁGøX@Ï.ùÊú]ª„„O|ŠÏ¨Ž^’ºYb¼
>Ǩr-?Ô º¶ÎÃûBÁ—øJÁC|M€Ý¸¦½¸¦ã·(+–„o|‹ïèìz^)¶Vd;•0Ÿ4Ëz.b˜vD§÷`³ˆ½Á".¶ˆg3réÜJD3V+ø?ðÐ~0þ?{Žšg7°ºˆü¶y}…^@O4Vß‹³%\¬I¦Z$S$9ÐTïô˜Þ.Ù¬ØØqž…f
§]™}Uµ˜AÃ!æ
ÏÓ´ø„¨+øµ
‹©Ô{³e‹òîý
n]*¾Äìd›¹0}‰»NεÁ0mJ- kмYq¶ÎZ‹Nìeeÿ‹x4Í5ã¾yÞðéz7n#4¸©‘b$ªw–÷‡€Ñ¦9Ó¬“z¦œÏ'e4Ö2l$¿¬ò ÝX†)ÞÓL#¢jSCÅv)¾I@ó¦EBM@Ûä³
ÐÏm¯Ògù0}ŸùŸŸy´¥[‚vvÿDÂc:t`ŒÖ€CÜc´*® Æ¥2&HŠ+?'9‰öüÄTËOáˈ@Ìø¦+ðWH?TA°ŠÎñ ä°XÁž°R*Ø;ãûC]$Ýñõ¡']AïL ˆÊø&éÞw#,þ…þG\ï7xìÏ£;†NZ‡Èûr“ôå?‰a\ÀVÁmˈã¿èFX‹žŸ&1å ÊcqBÀJCœl"‰ãô[F$k'èÿUBÍmžÄk$uª–—÷:ñÞ ŠH”Ód…¾ µ”VÉc€öËO1˜™í«bᥩgs¾Sâ€xègŒL
ˆ'x*
¨àà#Âþ_ŠÂ/ÿþó‡2¡a/O0REäÏÂ’[ž€š&HÇé|Š q¨sä6‚œ!0~t÷M¢u —4ßÂYØO•?G'‘‡·“’ËN"ø;8ïøIþPK A h‚df£ Õ # org/gradle/wrapper/Download$1.class}ŒM
Â0…ßh5Z+v/‚׆žÁp!.