[postgis-users] Error while importing data

Markus Schaber markus at schabi.de
Tue Mar 22 12:04:38 PST 2005

Hi, Stephen,

Stephen Woodbridge schrieb:

>>>> would this affect mapserver btw? I'm up to try and experiment anything,
>>>> and help where I can.
>>> About mapserver you shouldn't have any problem as all geometries are
>>> converted to 2d before parsing anyway, I don't think it uses
>>> the 'dimension' field of geometry_columns at all.
>> For mapserver, it could even benefit if you run your geometries through
>> force_2d in an update, and then VACUUM FULL ANALYZE the table. This way
>> you avoid reading and transmitting the data to mapserver only to have it
>> thrown away there.
> So, just to confirm that I understand this correctly, I would run:
> UPDATE mytable SET the_geom = force_2d(the_geom);
> to get all my geometry in mytable to be 2D.

Basically, yes.

In case of large tables, it can pay off to run the UPDATE only on a
fraction of your data, and then VACUUM the table, and then UPDATE the
next bunch, this saves you a lot of disk space.

And don't forget to update_geometry_stats() afterwards for PostgreSQL 7.X.

Another performance tip: If your table is read-only (which is almost
always the case for map data), you may also benefit from CLUSTERing your
table on the geometry index. To be able to do this, you will either have
to add a not null constraint to your geometry column, or use a partial
index that skips NULL values (CREATE INDEX ... WHERE the_geom is not null).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050322/342ea6ce/attachment.pgp>

More information about the postgis-users mailing list