# [postgis-users] Need some help

strk strk at keybit.net
Thu Aug 5 11:21:05 PDT 2004

```On Thu, Aug 05, 2004 at 11:47:36AM -0600, Zamil Murji wrote:
> What if the line is not a straight line but a diagonal one, then the Y will not be the same.
> Your example will work for lines like so: | but doesn't work for lines like so: / or \
> For such lines, i do need an angle.

You're right. You do :)
I need paper and a pencil to give you an answer, but I think you
can try it yourself. Also check if sin/cos funx are accessible
from pl/pgsql (I belive they are).

--strk;

>
> Thanks
> Zamil
>
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of strk
> Sent: Thursday, August 05, 2004 11:46 AM
> To: PostGIS Users Discussion
> Subject: Re: [postgis-users] Need some help
>
>
> On Thu, Aug 05, 2004 at 11:38:52AM -0600, Zamil Murji wrote:
> > That's where I'm stuck, I have no clue on how to build that line. I know how to get the X/Y values from the line, but thats where I get lost.
> >
> > Even some pseudo code would be nice...I know I have to use angles, but my knowledge is pretty limited in this domain. I should have paid more attention during some linear algebra classes.
>
> To get a T you need no angle. Your line will have same Y as your
> upper point Y for both point and X-(length/2) X+(length/2) for the
> X of left-right points, where lenght is the lenght of your line.
>
> --strk;
>
> >
> > Thanks
> > Zamil
> >
> > -----Original Message-----
> > From: postgis-users-bounces at postgis.refractions.net
> > [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of strk
> > Sent: Thursday, August 05, 2004 11:15 AM
> > To: PostGIS Users Discussion
> > Subject: Re: [postgis-users] Need some help
> >
> >
> > On Thu, Aug 05, 2004 at 11:09:44AM -0600, Zamil Murji wrote:
> > > I'm open to using pl/pgsql...any sample code to do it with that?
> >
> > If you give it a try and report your code, I'm open to review it.
> > Basically you'll need to construct a WKT representation of the
> > line you need... see postgis manual on how to extract X/Y values
> > --strk;
> >
> > >
> > > Thanks
> > > Zamil
> > >
> > > -----Original Message-----
> > > From: postgis-users-bounces at postgis.refractions.net
> > > [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of strk
> > > Sent: Thursday, August 05, 2004 11:01 AM
> > > To: PostGIS Users Discussion
> > > Subject: Re: [postgis-users] Need some help
> > >
> > >
> > > On Thu, Aug 05, 2004 at 10:53:06AM -0600, Zamil Murji wrote:
> > > > Hello list,
> > > >
> > > > I have a column in a table defined as a LINESTRING, the lines display just fine using mapserver. Now I want to create a line that is perpendicular to that line, but I want to do it with SQL. I can get the end point of the line, but I'm at a loss of what to do next. My goal is to create a T with the line that is already stored in the db. What is the quickest way to do something like this.
> > > >
> > > > Thanks in advance,
> > > > Zamil
> > >
> > > Postgis does not currently support creating geometries with SQL.
> > > You need pl/pgsql for that.
> > >
> > > --strk;
> > >
> > > _______________________________________________
> > > 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
> > _______________________________________________
> > 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
> _______________________________________________
> 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

```