NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

I've managed to setup both locally tile_server and API on rails-port. Their dbs are populated with local copy of maps. Im able to preview tiles and download rawdata from API using JOSM. When im uploading changes back to API server i cannot see the changes on tiles, which is ok because they have seperate databases.

I assume replication is needed.

I've gone through and

Right now im a bit stuck because, when i tried to use

osmosis --replicate-apidb

I ended up with new folder called replicate which has state.txt replicate.lock files and 000 folder and inside this folder i have 001.state.txt and 001.osc.gz

but it appears that there is no data, like if there were no changes at all.

i've also tried osmosis -q --replicate-apidb iterations=0 minInterval=10000 maxInterval=60000 authFile=dbAuth.txt --send-replication-sequence port=8081 --write-replication workingDirectory=data

but here i end up with error message: Task type write-replication doesn't exist.

It seems that im missing some steps but i have no clue where to look.

Right now i want just to update my tile_server db with my recent change, but when this works i would like to set osmosis to do it automatically every hour or minute, so that i dont bother anymore with console.

asked 01 Jun '16, 15:44

jorax's gravatar image

accept rate: 0%

Today i tried to make one-off data migration.

osmosis --read-apidb-change authFile=Auth.txt validateSchemaVersion=no intervalBegin="2016-05-29_00:00:00" --write-xml-change

THis produced change.osc with the data i want so big success

Now something is wrong with db:

osmosis --read-xml-change --write-pgsql-change authfile=Auth.txt validateSchemaVersion=no

this results in error:

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT id, name FROM users WHERE id = ?]; nested exception is org.postgresql.util.PSQLException: ERROR: relation "users" does not exist

So i tried osm2pgsql

osm2pgsql -l --append --database gis --username root --slim --cache 2048 change.osc

This ends up with another error:

Osm2pgsql failed due to ERROR: result COPY_END for planet_osm_polygon failed: ERROR: Geometry SRID (4326) does not match column SRID (900913) CONTEXT: COPY planet_osm_polygon, line 1, column way: "SRID=4326;POLYGON ((9.6640657999999995 53.5647483999999992, 9.6643272000000007 53.5649425000000008, ..."

(02 Jun '16, 09:31) jorax

Ok above comment is almost ok, problem was with flag -l. After removing this flag, i managed to import change.osc file. But still this is a manual process. My goal is to have this automatically.

(03 Jun '16, 09:08) jorax

Do you success to set the osmosis replication task automatically? Can you tell me how to make it automatically?

(12 Sep '16, 08:21) yuyy

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 01 Jun '16, 15:44

question was seen: 2,965 times

last updated: 12 Sep '16, 08:21

NOTICE: is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum