[postgis-users] Equality operator for type box2d

Kuien Liu kliu at pivotal.io
Tue Apr 21 03:24:17 PDT 2015


thanks, got it. Surely you may meet this issue, distinct cannot find the
'OPERATOR =' for data type 'box2d'.

PostGIS only supports 3 kinds of OPERATOR =, i.e.,

   1. OPERATOR =  (geometry,geometry)
   2. OPERATOR =  (geography,geography)
   3. OPERATOR =  (raster,raster)

Maybe we can try these ways:

   1. cast box2d to geometry: select distinct st_extent(the_geom)::geometry
   from test;
   2. create ordering operator for box2d.


Cheers,
Kuien Liu

On Tue, Apr 21, 2015 at 6:06 PM, Nick Ves <vesnikos at gmail.com> wrote:

> On Tue, Apr 21, 2015 at 12:50 PM, Kuien Liu <kliu at pivotal.io> wrote:
> > I'm not sure I understand what your query really looks like, but I can
> run
> > query below.
>
> try this one:
>
> select distinct st_extent(the_geom) over () from test;
>
>
> > gis=# SELECT ST_GeometryType(ST_Extent(the_geom))='ST_Polygon' FROM test
> > WHERE num < 10;
> >  ?column?
> > ----------
> >  true
> > (1 row)
> >
> > where the table 'test' contains 50,000 points.
> >
> > Wish this helps to you.
> >
> > Cheers,
> > Kuien Liu
> >
> > On Tue, Apr 21, 2015 at 4:58 PM, Nick Ves <vesnikos at gmail.com> wrote:
> >>
> >> I was playing with the ST_Extent today and I wanted to try a query like
> >> this:
> >>
> >> select distinct ST_Extent(geom)  over () box from parcels_test
> >>
> >> where the geom is Type ST_Polygon but I got this error instead:
> >>
> >>   ERROR:  could not identify an equality operator for type box2d
> >>
> >> The aim was to get the BBox from a set of polygons that might or might
> >> not be adjutant. Ofc you can get the same results by limit the result
> >> to 1 but, it hitted me strange box2d type not having an equal operator
> >>
> >> using "POSTGIS="2.1.4 r12966" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel.
> >> 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24"
> >> LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER"
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at lists.osgeo.org
> >> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> >
> >
> >
> > _______________________________________________
> > postgis-users mailing list
> > postgis-users at lists.osgeo.org
> > http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150421/4bfe7360/attachment.html>


More information about the postgis-users mailing list