Hi Brett,

thanx for your answer.
I thought using completeWays=yes and completeRelations=yes takes care of
nodes outside my bounding polygon.

1. If a node is created new it will be inside my merged osc and
therefore be inside my patched AOI.osm and (if part of a way or
relation) put in my recently cutted AOI.osm
2. If a node is deleted it will be deleted by patching the merged osc
3. the only problem seems to exist if an existing node outside the
polygon is changed and integrated into a way or relation inside my AOI.
Because the node doesn't exist in my AOI (also not in the patched AOI
before cutting it again), because it isn't created freshly. Am I right?
Or are there situations I miss?

I'm very interessted in creating a consistent regionally bordered OSM-DB.

Marco

Brett Henderson schrieb:
> Hi Marco,
>
> I'm not sure if you've received an answer elsewhere, but here goes.
>
> There are a number of ways your data can end up with referential
> integrity problems.  The most likely is simply that by cutting an area
> out using the bounding polygon task you'll end up with missing nodes. 
> Some ways will be included because they have nodes within the bounding
> polygon, but nodes that are part of the way but lie outside the
> polygon will not be included.
>
> You have a couple of choices:
>
>     * Set clipIncompleteEntities=true on your --bp task.  This will
>       modify the ways and relations to fix referential integrity, but
>       be aware that the entities no longer match the API database so
>       they *MUST NOT* be re-uploaded.
>     * Simply drop the offending constraint from the database.  This is
>       what I've done in the past.  I can't guarantee it will work with
>       rails, but it certainly used to in the past.
>
> Brett
>
> On Tue, Feb 9, 2010 at 2:50 AM, Marco Lechner - FOSSGIS e.V.
> <[email protected] <mailto:[email protected]>> wrote:
>
>     Hi I tried to use the described way to keep a AOI (area of interest)
>     OSM-file up to date. The following errors or unexpected behaviour
>     occured:
>
>     1. downloaded planetfile (planet-100120.osm.bz2)
>     2. osmosis (0.32) with --bp completeWays=yes and completeRelations=yes
>     to cut out myAOI
>     3. downloaded daily-diffs (20100120-20100121.osc, ...)
>     4. merged the diffs using osmosis => 20100120-20100120.osc
>     5. applied merged diffs using:
>        ./bin/osmosis --rxc 20100120-20100126.osc --rx aoi-100120.osm.bz2
>     --ac --bp file=aoi.pff completeWays=yes completeRelations=yes --wx
>     file=aoi-100126.osm.bz2
>     6. tried to import both aoi-....osm.bz2 into separate PostgreSQL-DBs
>     using API-Scheme.
>        Results:
>        No Errors: - bzcat ./aoi-100120.osm.bz2 | ./bin/osmosis --rx file=-
>     --wd database=osmAOI_api_1 host=localhost:5432 user=osmuser
>     password="pass"
>        Error: - bzcat ./aoi-100126.osm.bz2 | ./bin/osmosis --rx file=-
>     --wd
>     database=osmAOI_api_2 host=localhost:5432 user=osmuser password="pass"
>     Error message:
>     Unable to load current way nodes.
>        at
>     
> org.openstreetmap.osmosis.core.apidb.v0_6.ApidbWriter.complete(ApidbWriter.java:980)
>        at
>     org.openstreetmap.osmosis.core.xml.v0_6.XmlReader.run(XmlReader.java:110)
>        at java.lang.Thread.run(Thread.java:619)
>     Caused by: org.postgresql.util.PSQLException: ERROR: Insert or
>     Update in
>     table »current_way_nodes« verletzt foreignkey-Constraint
>     »current_way_nodes_node_id_fkey«
>      Detail: key (node_id)=(581918002) does not exist in table
>     »current_nodes«.
>
>     The error message says it clear. My workflow to keep aoi.osm.bz2 up to
>     date seems to produce an "erroneous" aoi.osm.bz2 or at least a
>     osm-file
>     that differs from a freshly cutted one. I expected that cutting an AOI
>     from a planetfile should produce the same results than keeping my
>     AOI up
>     to date by applying planet*.osc and cutting these back to myAOI.
>
>     Before trying to:
>
>     bzcat ./aoi-100120.osm.bz2 | ./bin/osmosis --rx file=- --wd
>     database=osmAOI_api_1 host=localhost:5432 user=osmuser password="pass"
>
>     ./bin/osmosis --rxc 20100120-20100126.osc --rd database=osmAOI_api_1
>     host=localhost:5432 user=osmuser password="pass" --ac --bp
>     file=aoi.pff
>     completeWays=yes completeRelations=yes --wd database=osmAOI_api_1
>     host=localhost:5432 user=osmuser password="pass"
>
>     will this keep my apiDB of an AOI up to date?
>
>     Marco
>
>     P.S. I'm not sure if this is more or less a user-question and
>     therefore
>     using the wrong list, but I guess it moves quite next to the
>     feature-wish section.
>
>     Lennard schrieb:
>     > Marco Lechner - FOSSGIS e.V. wrote:
>     >
>     >
>     >> Otheriwse I have to apply the diff onto a planetfile and cut it
>     everyday
>     >> or apply the planet diff to ma AOI.osm and cut it afterwards.
>     >> Is this a proper workflow?
>     >> Or what ist the best task to keep an AOI.osm (cutted by osmosis
>     using
>     >> --bp) up-to-date?
>     >>
>     >
>     > Apply the diffs first, then pass it through the --bp task before
>     writing
>     > it out again:
>     >
>     > osmosis --rxc 20100127-20100128.osc.gz --rx AIO-20100127.osm
>     --ac --bp
>     > file=/path/to/your/polygon/file --wx AIO-20100128.osm
>     >
>     >
>
>
>     _______________________________________________
>     osmosis-dev mailing list
>     [email protected] <mailto:[email protected]>
>     http://lists.openstreetmap.org/listinfo/osmosis-dev
>
>


_______________________________________________
osmosis-dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/osmosis-dev

Reply via email to