[osmosis-dev] Can't load osm file to PostGRESql
Brett Henderson
brett at bretth.com
Tue May 4 13:50:53 BST 2010
On Tue, May 4, 2010 at 5:56 PM, Ibrahim Bouchrika <
ibrahim_bouchrika at hotmail.com> wrote:
> The database i'm using is a fresh made one, so the error must be duplicate
> entries in the osm. I have the same problem with a duplicate relation in the
> new york city file i extracted from a cloudmade map.
>
> Could the duplicate values be a result of a bug while extracting a bbox
> with osmosis?
>
I doubt it, extracting a bbox should never create multiple instances of the
same id. It's more likely to be caused by incorrect use of the
--apply-change task when applying minute or hourly diff files. It was
possible with older versions of osmosis to apply a full history diff
containing multiple changes for a single entity which would result in
multiple versions of the same entity being written to the result file.
>
> Is there a way around those duplicate entries, like perhaps overwriting
> duplicate data? Going through all those entries manually seems almost
> impossible.
>
Hmm, I'm not sure about the best way to tackle this ...
I seem to remember Frederik having a clever way of removing duplicates. I
think he did something like the following:
1. Convert the entire file to an osc file by wrapping the entire contents of
the file in osmChange element with an action of create or modify.
2. Feed the osc file through the --simplify-change task.
3. Create an empty osm file, then use the --apply-change task to add the
entire change file to it.
Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20100504/e32e2ea4/attachment.html>
More information about the osmosis-dev
mailing list