[osmosis-dev] pgsimple/pgsnapshot possible bug

Brett Henderson brett at bretth.com
Mon Jan 28 04:01:19 GMT 2013


Hi Daniel,


On 25 January 2013 07:47, Daniel Kaneider <kaneiderdaniel at gmail.com> wrote:

>  Hi,
>
> I did some import of OSM data into a Postgresql 9.2 DB using osmosis 0.41.
> The pgsnapshot_load script stopped since some function could not be found
> (Envelope,Collect). If I am not wrong then
>
> UPDATE ways SET bbox = (
>     SELECT Envelope(Collect(geom))
>     FROM nodes JOIN way_nodes ON way_nodes.node_id = nodes.id
>     WHERE way_nodes.way_id = ways.id
> );
>
> should be changed to
>
> UPDATE ways SET bbox = (
>     SELECT *ST_Envelope*(*ST_Collect*(geom))
>     FROM nodes JOIN way_nodes ON way_nodes.node_id = nodes.id
>     WHERE way_nodes.way_id = ways.id
> );
>
> This should apply also to the pg_simple script.
>

Thanks for the message.  I suspect you're right.  If nobody beats me to it
I'll fix it as soon as I can.

Note however, that most times you don't need those SQL statements and can
comment them out.  If you use Osmosis to generate the COPY data files it
should be able to populate the bbox and/or linestring columns for you.
That should be *much* faster than having PostgreSQL do it for you.

Check out the --write-plsql-dump task and the enableBboxBuilder,
enableLinestringBuilder options.

Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20130128/51730f4d/attachment-0001.html>


More information about the osmosis-dev mailing list