[postgis-devel] [topology] missing = operator for topogeometry

Rémi Cura remi.cura at gmail.com
Wed Oct 23 05:32:16 PDT 2013


Ok I understand what you mean.
If I follow you the = operator should cast topogeom to geom and perform the
regular geom=geom operation?

I modified the = operator to become the topogeom==topogeom

Cheers,
Rémi



_second an == operator for topogeometry

--creating the egal operator for topology.topogeometry type
DROP FUNCTION IF EXISTS  topology.topogeometry_egal(tg1
topology.topogeometry,tg2 topology.topogeometry) CASCADE;
CREATE FUNCTION topology.topogeometry_egal(tg1 topology.topogeometry,tg2
topology.topogeometry)
    RETURNS boolean AS
    $BODY$
-- This function returns true if every field of topogeom1 are egal to
topogeom2 (int = meaning) in the same order, false else.
--returns null if any field is NULL, whatever the others.
DECLARE
BEGIN
-- RETURN
-- (tg1).topology_id=(tg2).topology_id
-- AND (tg1).layer_id=(tg2).layer_id
-- AND (tg1).id=(tg2).id
-- AND (tg1).type=(tg2).type;
RETURN tg1::int[]=tg2::int[];
END;
    $BODY$
LANGUAGE plpgsql IMMUTABLE;

CREATE OPERATOR == (
    leftarg = topology.topogeometry,
    rightarg = topology.topogeometry,
    procedure = topology.topogeometry_egal,
    commutator = ==
);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20131023/36cdb25b/attachment.html>


More information about the postgis-devel mailing list