[postgis-users] FW: Support in ST_ConvexHull syntax

Sandro Santilli strk at keybit.net
Thu Oct 20 02:53:27 PDT 2011


On Thu, Oct 20, 2011 at 09:26:48AM +0000, Gery . wrote:

> mop=# \d unaprueba
>    Table "public.unaprueba"
>  Column |   Type   | Modifiers 
> --------+----------+-----------
>  id     | smallint | 
>  geom   | geometry | 
> Indexes:
>     "unaprueba_geom" gist (geom)
> Check constraints:
>     "enforce_dims_geom" CHECK (st_ndims(geom) = 2)
>     "enforce_geotype_geom" CHECK (geometrytype(geom) = 'POLYGON'::text OR geom IS NULL)
>     "enforce_srid_geom" CHECK (st_srid(geom) = 4326)

...

> mop=# insert into unaprueba (geom) SELECT st_convexhull(st_collect(geom)) as geom FROM splitbeam_point ;
> ERROR:  new row for relation "unaprueba" violates check constraint "enforce_dims_geom"
> 
> where could be the problem?

<< The new row violates check constraint "enforce_dims_geom" >>

Compare the above message with the output of \d above:

> Check constraints:
>     "enforce_dims_geom" CHECK (st_ndims(geom) = 2)
      ^^^^^^^^^^^^^^^^^^^
>     "enforce_geotype_geom" CHECK (geometrytype(geom) = 'POLYGON'::text OR geom IS NULL)

Check the output of:

  st_ndims(st_convexhull(st_collect(geom)) from splitbeam_point;

Must be 2 ...

--strk; 

  ()   Free GIS & Flash consultant/developer
  /\   http://strk.keybit.net/services.html



More information about the postgis-users mailing list