Skip to content

Commit

Permalink
rename to imposm
Browse files Browse the repository at this point in the history
  • Loading branch information
olt committed Apr 17, 2018
1 parent f83080c commit 0ca3441
Show file tree
Hide file tree
Showing 20 changed files with 123 additions and 114 deletions.
12 changes: 7 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ before_deploy:
- mkdir -p ${PKG_DIR}/lib

# copy files
- cp imposm3 ${PKG_DIR}
- cp imposm ${PKG_DIR}
- ln -s imposm ${PKG_DIR}/imposm3
- cp README.md ${PKG_DIR}
- cp example-mapping.json ${PKG_DIR}/mapping.json

# copy/link libs
Expand All @@ -112,9 +114,9 @@ before_deploy:
- chrpath ${PKG_DIR}/lib/libgeos_c.so -r '${ORIGIN}'

# create tar.gz
- BUILD_VERSION=`${PKG_DIR}/imposm3 version`-linux-x86-64
- mv ${PKG_DIR} /tmp/imposm3-${BUILD_VERSION}
- cd /tmp && tar zcvf imposm3-${BUILD_VERSION}.tar.gz imposm3-${BUILD_VERSION}
- BUILD_VERSION=`${PKG_DIR}/imposm version`-linux-x86-64
- mv ${PKG_DIR} /tmp/imposm-${BUILD_VERSION}
- cd /tmp && tar zcvf imposm-${BUILD_VERSION}.tar.gz imposm-${BUILD_VERSION}

# move back to build dir for deploy
- cd ${TRAVIS_BUILD_DIR}
Expand All @@ -123,7 +125,7 @@ deploy:
provider: releases
api_key:
secure: fBhtCy6vdxxxuLYuJWXeTHJb3SAZCCbUJncIvR9ZOLCDWMJAPBnzPoqJFbByWzl6XghVRwhy9fe/82vzqByKiB/AQpqGqBxlwA9dSsqvSQcQxomAoHKKfZVdOuxM2bLDW3v5pJpmFtCMwhWjgwIOb9WxnBVeLxBbsq2Ox49tgHw=
file: /tmp/imposm3-${BUILD_VERSION}.tar.gz
file: /tmp/imposm-${BUILD_VERSION}.tar.gz
skip_cleanup: true
on:
repo: omniscale/imposm3
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ VERSION_LDFLAGS=-X github.com/omniscale/imposm3.Version=$(BUILD_VERSION)

all: build test

imposm3: $(PBGOFILES) $(GOFILES)
$(GO) build $(GOTAGS) $(GOLDFLAGS) ./cmd/imposm3
imposm: $(PBGOFILES) $(GOFILES)
$(GO) build $(GOTAGS) $(GOLDFLAGS) ./cmd/imposm

build: imposm3
build: imposm

clean:
rm -f imposm3
rm -f imposm
(cd test && make clean)

test: imposm3 system-test-files
test: imposm system-test-files
$(GO) test $(GOTAGS) -i `$(GO) list ./... | grep -Ev '/vendor'`
$(GO) test $(GOTAGS) `$(GO) list ./... | grep -Ev '/vendor'`

test-unit: imposm3
test-unit: imposm
$(GO) test $(GOTAGS) -i `$(GO) list ./... | grep -Ev '/test|/vendor'`
$(GO) test $(GOTAGS) `$(GO) list ./... | grep -Ev '/test|/vendor'`

test-system: imposm3
test-system: imposm
(cd test && make test)

system-test-files:
Expand Down
73 changes: 36 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
Imposm 3
========
Imposm
======

Imposm is an importer for OpenStreetMap data. It reads PBF files and
imports the data into PostgreSQL/PostGIS. It can also automatically update the database with the latest changes from OSM.
Imposm is an importer for OpenStreetMap data. It reads PBF files and imports the data into PostgreSQL/PostGIS. It can also automatically update the database with the latest changes from OSM.

It is designed to create databases that are optimized for rendering (i.e. generating tiles or for WMS services).

Imposm 3 is written in Go and it is a complete rewrite of the previous Python implementation.
Imposm >=3 is written in Go and it is a complete rewrite of the previous Python implementation.
Configurations/mappings and cache files are not compatible with Imposm 2, but they share a similar architecture.

The development of Imposm 3 was sponsored by [Omniscale](http://omniscale.com/). There are [commercial licenses available for Imposm](http://omniscale.com/opensource/soss) to support the long-term development of Imposm.
There is also commercial support available from Omniscale.
The development of Imposm is sponsored by [Omniscale](https://omniscale.com/).


Features
Expand Down Expand Up @@ -47,10 +45,10 @@ Features
Limit imported geometries to polygons from GeoJSON, for city/state/country imports.

- Easy deployment:
Single binary with only runtime dependencies to common libs (GEOS, ProtoBuf and LevelDB).
Single binary with only runtime dependencies to common libs (GEOS and LevelDB).

- Automatic OSM updates:
Includes background service (imposm3 run) that automatically downloads and imports the latest OSM changes.
Includes background service (`imposm run`) that automatically downloads and imports the latest OSM changes.

- Route relations:
Import all relation types including routes.
Expand All @@ -61,11 +59,9 @@ Features
Performance
-----------

Imposm 3 is much faster than Imposm 2 and osm2pgsql:

* Makes full use of all available CPU cores
* Bulk inserts into PostgreSQL with `COPY FROM`
* Efficient intermediate cache for reduced IO load during ways and relations building
* Imposm makes full use of all available CPU cores
* Imposm uses bulk inserts into PostgreSQL with `COPY FROM`
* Imposm uses efficient intermediate caches for reduced IO load during ways and relations building


An import in diff-mode on a Hetzner PX121-SSD server (Intel Xeon E5-1650 v3 Hexa-Core, 256GB RAM and SSD RAID 1) of a 36GB planet PBF (2017-08-10) with generalized tables and spatial indices, etc. takes around 6:30h. This is for an import that is ready for minutely updates. The non-diff mode is even faster.
Expand All @@ -76,26 +72,30 @@ Imports without SSDs will take longer.
Current status
--------------

Imposm 3 is used in production but there is no official 3.0 release yet.
Imposm is used in production but there is no official 3.0 release yet.
Imposm >=3, successor of Imposm 2, was called "Imposm 3" and binaries were named `imposm3` during development. Since April 2018 the project is only called Imposm to allow semantic versioning beyond version 3.
The repository will be renamed to github.com/omniscale/imposm in the future.

### Planned features ###

There are a few features we like to see in Imposm 3:
There are a few features we like to see in Imposm:

* Support for other projections than EPSG:3857 or EPSG:4326
* Custom field/filter functions
* Official releases with binaries for more platforms

There is no roadmap however, as the implementation of these features largely depends on external funding. There are [commercial licenses available for Imposm](http://omniscale.com/opensource/soss) if you like to help with this development.
There is no roadmap however, as the implementation of these features largely depends on external funding.

Installation
------------

### Binary

There are no official releases, but you find development builds at <http://imposm.org/static/rel/>.
These builds are for x86 64bit Linux and require *no* further dependencies. Download, untar and start `imposm3`.
Imposm 0.5 binaries are compatible with Debian 8, Ubuntu 14.04 and SLES 12 (and newer versions). Older Imposm binaries also support Debian 6, RHEL 6 and SLES 11.
[Binary releases are available at GitHub.](https://github.com/omniscale/imposm3/releases)

These builds are for x86 64bit Linux and require *no* further dependencies. Download, untar and start `imposm`.
Binaries are compatible with Debian 8, Ubuntu 14.04 and SLES 12 (and newer versions). Older Imposm binaries (<=0.4) also support Debian 6, RHEL 6 and SLES 11.
Older versions are available at <http://imposm.org/static/rel/>.

### Source

Expand All @@ -107,14 +107,13 @@ You need [Go >=1.6](http://golang.org).

#### C/C++ libraries

Other dependencies are [libleveldb][], [libgeos][] and [protobuf][].
Imposm 3 was tested with recent versions of these libraries, but you might succeed with older versions.
Other dependencies are [libleveldb][] and [libgeos][].
Imposm was tested with recent versions of these libraries, but you might succeed with older versions.
GEOS >=3.2 is recommended, since it became much more robust when handling invalid geometries.


[libleveldb]: https://github.com/google/leveldb/
[libgeos]: http://trac.osgeo.org/geos/
[protobuf]: https://github.com/google/protobuf

#### Compile

Expand All @@ -124,17 +123,17 @@ Create a [Go workspace](http://golang.org/doc/code.html) by creating the `GOPATH
cd go
export GOPATH=`pwd`

Get the code and install Imposm 3:
Get the code and install Imposm:

go get github.com/omniscale/imposm3
go install github.com/omniscale/imposm3/cmd/imposm3
go install github.com/omniscale/imposm3/cmd/imposm

Done. You should now have an imposm3 binary in `$GOPATH/bin`.
Done. You should now have an imposm binary in `$GOPATH/bin`.

Go compiles to static binaries and so Imposm 3 has no runtime dependencies to Go.
Just copy the `imposm3` binary to your server for deployment. The C/C++ libraries listed above are still required though.
Go compiles to static binaries and so Imposm has no runtime dependencies to Go.
Just copy the `imposm` binary to your server for deployment. The C/C++ libraries listed above are still required though.

See `packaging.sh` for instruction on how to build binary packages for Linux.
See also `packaging.sh` for instructions on how to build binary packages for Linux.

#### LevelDB

Expand All @@ -145,36 +144,36 @@ For better performance you can either use [HyperLevelDB][libhyperleveldb] as an
Usage
-----

`imposm3` has multiple subcommands. Use `imposm3 import` for basic imports.
`imposm` has multiple subcommands. Use `imposm import` for basic imports.

For a simple import:

imposm3 import -connection postgis://user:password@host/database \
imposm import -connection postgis://user:password@host/database \
-mapping mapping.json -read /path/to/osm.pbf -write

You need a JSON file with the target database mapping. See `example-mapping.json` to get an idea what is possible with the mapping.

Imposm creates all new tables inside the `import` table schema. So you'll have `import.osm_roads` etc. You can change the tables to the `public` schema:

imposm3 import -connection postgis://user:passwd@host/database \
imposm import -connection postgis://user:passwd@host/database \
-mapping mapping.json -deployproduction


You can write some options into a JSON configuration file:

{
"cachedir": "/var/local/imposm3",
"cachedir": "/var/local/imposm",
"mapping": "mapping.json",
"connection": "postgis://user:password@localhost:port/database"
}

To use that config:

imposm3 import -config config.json [args...]
imposm import -config config.json [args...]

For more options see:

imposm3 import -help
imposm import -help


Note: TLS/SSL support is disabled by default due to the lack of renegotiation support in Go's TLS implementation. You can re-enable encryption by setting the `PGSSLMODE` environment variable or the `sslmode` connection option to `require` or `verify-full`, eg: `-connect postgis://host/dbname?sslmode=require`. You will need to disable renegotiation support on your server to prevent connection errors on larger imports. You can do this by setting `ssl_renegotiation_limit` to 0 in your PostgreSQL server configuration.
Expand Down Expand Up @@ -202,7 +201,7 @@ You can report any issues at: <https://github.com/omniscale/imposm3/issues>
License
-------

Imposm 3 is released as open source under the Apache License 2.0. See LICENSE.
Imposm is released as open source under the Apache License 2.0. See LICENSE.

All dependencies included as source code are released under a BSD-ish license. See LICENSE.dep.

Expand All @@ -229,4 +228,4 @@ There is a Makefile that creates all test files if necessary and then runs the t

Call `make test-system` to skip the unit tests.

WARNING: It uses your local PostgeSQL database (`imposm3testimport`, `imposm3testproduction` and `imposm3testbackup` schema). Change the database with the standard `PGDATABASE`, `PGHOST`, etc. environment variables.
WARNING: It uses your local PostgreSQL database (`imposm_test_import`, `imposm_test_production` and `imposm_test_backup` schema). Change the database with the standard `PGDATABASE`, `PGHOST`, etc. environment variables.
8 changes: 4 additions & 4 deletions cache/delta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestReadWriteDeltaCoordsLinearImport(t *testing.T) {
}

func checkReadWriteDeltaCoords(t *testing.T, withLinearImport bool) {
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newDeltaCoordsCache(cache_dir)
Expand Down Expand Up @@ -157,7 +157,7 @@ func deleteAndCheck(t *testing.T, cache *DeltaCoordsCache, id int64) {
}

func TestSingleUpdate(t *testing.T) {
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newDeltaCoordsCache(cache_dir)
Expand Down Expand Up @@ -189,7 +189,7 @@ func TestSingleUpdate(t *testing.T) {

func BenchmarkWriteDeltaCoords(b *testing.B) {
b.StopTimer()
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newDeltaCoordsCache(cache_dir)
Expand Down Expand Up @@ -217,7 +217,7 @@ func BenchmarkWriteDeltaCoords(b *testing.B) {

func BenchmarkReadDeltaCoords(b *testing.B) {
b.StopTimer()
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newDeltaCoordsCache(cache_dir)
Expand Down
6 changes: 3 additions & 3 deletions cache/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestDiffCache(t *testing.T) {

cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newCoordsRefIndex(cache_dir)
Expand Down Expand Up @@ -49,7 +49,7 @@ func TestDiffCache(t *testing.T) {
}

func TestWriteDiff(t *testing.T) {
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newRefIndex(cache_dir, &globalCacheOptions.CoordsIndex)
Expand Down Expand Up @@ -77,7 +77,7 @@ func TestWriteDiff(t *testing.T) {

func BenchmarkWriteDiff(b *testing.B) {
b.StopTimer()
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newRefIndex(cache_dir, &globalCacheOptions.CoordsIndex)
Expand Down
15 changes: 8 additions & 7 deletions cache/osm_test.go
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
package cache

import (
"github.com/omniscale/imposm3/element"
"io/ioutil"
"math/rand"
"os"
"testing"

"github.com/omniscale/imposm3/element"
)

func TestCreateCache(t *testing.T) {
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newNodesCache(cache_dir)
Expand All @@ -24,7 +25,7 @@ func TestCreateCache(t *testing.T) {
}

func TestReadWriteNode(t *testing.T) {
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newNodesCache(cache_dir)
Expand Down Expand Up @@ -58,7 +59,7 @@ func TestReadWriteNode(t *testing.T) {
}

func TestReadWriteWay(t *testing.T) {
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newWaysCache(cache_dir)
Expand Down Expand Up @@ -93,7 +94,7 @@ func TestReadWriteWay(t *testing.T) {
}

func TestReadMissingWay(t *testing.T) {
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newWaysCache(cache_dir)
Expand All @@ -111,7 +112,7 @@ func TestReadMissingWay(t *testing.T) {

func BenchmarkWriteWay(b *testing.B) {
b.StopTimer()
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newWaysCache(cache_dir)
Expand All @@ -133,7 +134,7 @@ func BenchmarkWriteWay(b *testing.B) {

func BenchmarkReadWay(b *testing.B) {
b.StopTimer()
cache_dir, _ := ioutil.TempDir("", "imposm3_test")
cache_dir, _ := ioutil.TempDir("", "imposm_test")
defer os.RemoveAll(cache_dir)

cache, err := newWaysCache(cache_dir)
Expand Down
2 changes: 1 addition & 1 deletion cache/query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
relIds = flags.String("rel", "", "relation")
full = flags.Bool("full", false, "recurse into relations/ways")
deps = flags.Bool("deps", false, "show dependent ways/relations")
cachedir = flags.String("cachedir", "/tmp/imposm3", "cache directory")
cachedir = flags.String("cachedir", "/tmp/imposm", "cache directory")
)

type nodes map[string]*node
Expand Down
Loading

0 comments on commit 0ca3441

Please sign in to comment.