[postgis-users] TRANSFORM on multipolygons with several geometries crashes database engine (pgsql7.4.1, pg0.8-dev)

Havard Tveite havard.tveite at nlh.no
Tue Jan 13 00:24:58 PST 2004


Dear list,

We are having problems with the transform function.

TRANSFORM on multipolygons with more than one geometry (e.g.
polygons with holes) crashes the database engine.
PostGreSQL 7.4.1
PostGIS 0.8-developing version, 12. january 2004 build (same
      results on the 0.8 version)
Geos 1.0 - 7. november 2003

 From coordinate system 4326 (WGS84 lat-long).

Interaction with PostGreSQL (real data set created with shp2pgsql):

%postgistest=# select TRANSFORM(the_geom, 32633) from test1 where gid = 59;
%server closed the connection unexpectedly
%        This probably means the server terminated abnormally
%        before or while processing the request.
%The connection to the server was lost. Attempting reset: Failed.

A simple example geometry that will also make TRANSFORM crash PostGreSQL:
MULTIPOLYGON(((11 59,11 59.1,11.2 59.1,11.2 59,11 59),(11.1 59.02,11.15 59.07,11.05 59.07,11.1 59.02)))

To reproduce the problem (database called "postgistest"):

create table pgtest (gid serial);
select AddGeometryColumn('postgistest','pgtest','the_geom','4326','MULTIPOLYGON',2);
begin;
Insert into pgtest (gid,the_geom) values('1',GeometryFromText('MULTIPOLYGON(((11 59,11 59.1,11.2 59.1,11.2 59,11 59),(11.1 59.02,11.15 59.07,11.05 59.07,11.1 59.02)))',4326));
Insert into pgtest (gid,the_geom) values('2',GeometryFromText('MULTIPOLYGON(((11 59,11 59.1,11.2 59.1,11.2 59,11 59)))',4326));
end;

select TRANSFORM(the_geom, 32633) from pgtest where gid = 2;
select TRANSFORM(the_geom, 32633) from pgtest where gid = 1;

The first select statement returns:
%                                                                                              transform
%------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
% SRID=32633;MULTIPOLYGON(((270278.433402198 6546929.75103777,270945.446198309 6558052.09702025,282390.013847871 6557382.6223687,281756.381195413 6546259.0260906,270278.433402198 6546929.75103777)))
%(1 row)

The second select statement returns:
%server closed the connection unexpectedly
%        This probably means the server terminated abnormally
%        before or while processing the request.
%The connection to the server was lost. Attempting reset: Failed.


-- 
Håvard Tveite
Department of Mathematical Sciences and Technology
Agricultural University of Norway
Drøbakveien 14, POBox 5003, N-1432 Ås, NORWAY
Phone: +47 64948857 Fax: +47 64948810 http://www.nlh.no/imt



More information about the postgis-users mailing list