[postgis-users] envelope

Mark Cave-Ayland m.cave-ayland at webbased.co.uk
Mon Jun 20 08:42:20 PDT 2005


Hi,
 
What version of PostgreSQL are you using? Also can you show us the complete
function including the CREATE FUNCTION line?
 
 
Kind regards,
 
Mark.

------------------------
WebBased Ltd
17 Research Way
Tamar Science Park
Plymouth
PL6 8BT

T: +44 (0)1752 797131
F: +44 (0)1752 791023
W: http://www.webbased.co.uk <http://www.webbased.co.uk/> 
  

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
rsosnowski at cableone.net
Sent: 17 June 2005 22:54
To: postgis-users at postgis.refractions.net
Cc: rsosnowski at cableone.net
Subject: [postgis-users] envelope



Hello all,

Trying to write a stored procedure that returns the envelope.

Code follows:

  sSQLExp:= 'SELECT the_geom FROM ' || quote_ident(stable) || ' WHERE ' ||
quote_ident(sfield) || ' = ' || quote_literal(svalue);
  RAISE NOTICE 'sSQLExp = %', sSQLExp;
  OPEN pTempCursor FOR EXECUTE sSQLExp;
  LOOP
  FETCH pTempCursor INTO pFeatureGeometry;
  EXIT WHEN NOT FOUND;
      sSQL:= 'SELECT envelope(' || sSQLExp || ') FROM ' ||
quote_ident(stable);
      RAISE NOTICE 'sSQL = %', sSQL;

    OPEN pCursor FOR EXECUTE sSQL;
    LOOP
      FETCH pCursor INTO pBoundBox;
      EXIT WHEN NOT FOUND;      
   END LOOP;
 END LOOP;
 CLOSE pCursor;
 CLOSE pTempCursor;

************************************************************
THE SECOND NOTICE STATEMENT SHOWS:
sSQL = SELECT envelope(SELECT the_geom FROM subdiv WHERE subdivname =
'HIGHLANDER ESTATES') FROM subdiv

GET THE FOLLOWING ERROR:

SYNTAX ERROR AT OR NEAR "SELECT" AT CHARACTER 17; POINTS TO THE 'S' IN THE
SECOND SELECT STATEMENT.
    SELECT ENVELOPE(SELECT.....
 
ANY IDEAS????





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20050620/3bf06716/attachment.html>


More information about the postgis-users mailing list