[postgis-users] My crusade to get the real angle

strk at refractions.net strk at refractions.net
Mon Jul 10 09:45:32 PDT 2006


On Mon, Jul 10, 2006 at 10:33:37AM -0300, Ezequias Rodrigues da Rocha wrote:
> Thank you very much Guido,
> 
> I still want to make an if statement on psql command line.

Something like:

CASE WHEN <condition> THEN <value> END CASE

Check your SQL manual.

--strk;


> 
> Best regards...
> Ezequias
> 
> Guido Lemoine escreveu:
> >Just use a 'where' clause. This is basic SQL. Nothing to do with PostGIS.
> >
> >UPDATE TABLE MUB SET ANGLE = 90 – ANGLE
> >WHERE ANGLE BETWEEN 0 AND 90
> >
> >(try lower case if this doesn't work).
> >
> >GL
> >
> >Ezequias Rodrigues da Rocha wrote:
> >
> >>Hi list,
> >>
> >>I am still on my crusade to my real angle (not azimuth). Even with 
> >>the mapserver doesen't helping me with labels I am sill trying to 
> >>retrieve the real angle of a linestring.
> >>
> >>As you should know I have the azimuth of a set of linestrings and 
> >>after a radians to degree conversion I noticed that the XY system is 
> >>quite different from the Azimuth system and I need to do some 
> >>conversions for each quadrant.
> >>
> >>*So my question is:* How do I apply a if statement on 
> >>Postgis/Postgresql ? I know is is not a Postgis question but I think 
> >>you could help me.
> >>
> >>I am trying to run this command line on psql:
> >>
> >>select angulo from mub;
> >>IF ANGLE >= 0 AND ANGLE <=90 THEN
> >>UPDATE TABLE MUB SET ANGLE = 90 – ANGLE
> >>END IF;
> >>
> >>But it does not work. Any help will be welcomed.
> >>
> >>Regards ...
> >>
> >>-- 
> >>Ezequias Rodrigues da Rocha
> >>http://ezequiasrocha.blogspot.com
> >>msn:ezequias at hotmail.com
> >>"the worst of democracies is still better than the best of dictatorship"
> >> 
> >>
> >>------------------------------------------------------------------------
> >>
> >>_______________________________________________
> >>postgis-users mailing list
> >>postgis-users at postgis.refractions.net
> >>http://postgis.refractions.net/mailman/listinfo/postgis-users
> >> 
> >>
> >_______________________________________________
> >postgis-users mailing list
> >postgis-users at postgis.refractions.net
> >http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> 
> -- 
> Ezequias Rodrigues da Rocha
> http://ezequiasrocha.blogspot.com
> msn:ezequias at hotmail.com
> "the worst of democracies is still better than the best of dictatorship"
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

-- 

 /"\    ASCII Ribbon Campaign
 \ /    Respect for low technology.
  X     Keep e-mail messages readable by any computer system.
 / \    Keep it ASCII. 




More information about the postgis-users mailing list