[postgis-users] Distance constraints on spatial points

fork forkandwait at gmail.com
Tue May 3 16:32:35 PDT 2011


fork <forkandwait <at> gmail.com> writes:

> 
> Sairam Krishnamurthy <kmsram420 <at> gmail.com> writes:
> 
> > 
> > Thanks. But how do I specify the code to raise an error if the distance is 
> > not met ? 

This might help:
 
> You probably want to write a PLPGSQL function with a SELECT statement that
> returns the min(st_distance(NEW.the_geom, a.the_geom)), 

http://www.postgresql.org/docs/9.0//static/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW

> and raise an exception
> if it is below a certain amount.  

http://www.postgresql.org/docs/9.0//static/plpgsql-errors-and-messages.html





More information about the postgis-users mailing list