[postgis-users] Math Operators

Michael Smedberg Michael.Smedberg at redfin.com
Wed Jul 1 11:38:41 PDT 2009


Could you store the numbers "1" and "-1", and then do 

 

+ (one_or_minus_one * 15000)

 

That is, subtraction is the same as addition of the negative?

________________________________

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Wednesday, July 01, 2009 11:35 AM
To: PostGIS Users Discussion
Subject: [postgis-users] Math Operators

 

Hi

 

I have an expression such as -

 

select ST_distance(st_centroid(p_id.p_id.the_geom),
st_boundary(p_id.p_id.the_geom))/2 + 15000
   from p_id.p_id
   where p_id.p_id.process_id = '1012' ;

 

This works

 

I can access the number 15000 from a table as a variable. 

 

I want to be able to also access the + (or -) from a table as a variable
but can't figure out how to do this.

 

Is it possible to store math operators and access them from a table??

 

Bob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090701/7849bd5d/attachment.html>


More information about the postgis-users mailing list