[postgis-users] line direction

285 views
Skip to first unread message

franco base

unread,
May 14, 2013, 7:03:29 AM5/14/13
to PostGIS Users Discussion
Hi.
I have a question for the list.

Is there a postgis function to have line direction?

For example ehen I use st_offset_curve
I have a correct offset according to direction,
So I have this information inside geometry
and I'd extract.

Thank

regards
fb

Paolo Corti

unread,
May 14, 2013, 7:13:30 AM5/14/13
to PostGIS Users Discussion
On Tue, May 14, 2013 at 6:03 PM, franco base <frenk...@gmail.com> wrote:
> Hi.
> I have a question for the list.
>
> Is there a postgis function to have line direction?
>

http://postgis.refractions.net/docs/ST_Azimuth.html

regards
p

--
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti
_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users

franco base

unread,
May 14, 2013, 7:49:58 AM5/14/13
to PostGIS Users Discussion
Hi.
I know tgis function but doesn't work.
Myabe my question isn't correct.
I'd have a binary value according to the arc direction.
For example, in qgis I can view this information:
I can see an arrow on my arc according to direction.
I'd have the same using postgis.

Thanks



2013/5/14 Paolo Corti <pco...@gmail.com>

Nicolas Ribot

unread,
May 14, 2013, 9:07:34 AM5/14/13
to PostGIS Users Discussion
Hi,

If you want to materialize direction from start to end of line, you can use st_startPoint and st_endpoint to determines the right ends.
What is your use case ?

Nicolas

franco base

unread,
May 16, 2013, 11:14:32 AM5/16/13
to PostGIS Users Discussion
I send again message because it was blocked for the attcahed file too big


 
I have a public transport network with an arc for 2 Point(the bus stop).
I'd know without using the points information arc direction like in qgis
(as you can see from the attached imagine with arc_id and direction)


2013/5/14 Nicolas Ribot <nicola...@gmail.com>
arc_direction.png

Stephen Woodbridge

unread,
May 16, 2013, 12:36:54 PM5/16/13
to PostGIS Users Discussion
How do you define arc direction?
If you had a function:

select getArcDirection(arc);

What would you expect the output to be?

In your image, the arc direction is a function of the labeling algorithm
in combination with this that of the arc. For example if the label were
flipped upside down and written along the underside of the line then the
arc direction symbol would have to be reversed. So we can see that it is
a function of the label and not just the arc alone.

postgis does not do rendering so it can not define that.

-Steve

On 5/16/2013 11:14 AM, franco base wrote:
> I send again message because it was blocked for the attcahed file too big
>
>
> I have a public transport network with an arc for 2 Point(the bus stop).
> I'd know without using the points information arc direction like in qgis
> (as you can see from the attached imagine with arc_id and direction)
>
>
> 2013/5/14 Nicolas Ribot <nicola...@gmail.com
> <mailto:nicola...@gmail.com>>
>
> Hi,
>
> If you want to materialize direction from start to end of line, you
> can use st_startPoint and st_endpoint to determines the right ends.
> What is your use case ?
>
> Nicolas
>
>
> On 14 May 2013 13:49, franco base <frenk...@gmail.com
> <mailto:frenk...@gmail.com>> wrote:
>
> Hi.
> I know tgis function but doesn't work.
> Myabe my question isn't correct.
> I'd have a binary value according to the arc direction.
> For example, in qgis I can view this information:
> I can see an arrow on my arc according to direction.
> I'd have the same using postgis.
>
> Thanks
>
>
>
> 2013/5/14 Paolo Corti <pco...@gmail.com <mailto:pco...@gmail.com>>
>
> On Tue, May 14, 2013 at 6:03 PM, franco base
> <frenk...@gmail.com <mailto:frenk...@gmail.com>> wrote:
> > Hi.
> > I have a question for the list.
> >
> > Is there a postgis function to have line direction?
> >
>
> http://postgis.refractions.net/docs/ST_Azimuth.html
>
> regards
> p
>
> --
> Paolo Corti
> Geospatial software developer
> web: http://www.paolocorti.net
> twitter: @capooti
> skype: capooti
> _______________________________________________
> postgis-users mailing list
> postgi...@lists.osgeo.org
> <mailto:postgi...@lists.osgeo.org>
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgi...@lists.osgeo.org <mailto:postgi...@lists.osgeo.org>
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgi...@lists.osgeo.org <mailto:postgi...@lists.osgeo.org>

franco base

unread,
Oct 4, 2013, 7:43:18 AM10/4/13
to PostGIS Users Discussion
Hi Stephen
How can you explain that the st_offsetcurve make offset according to line direction.
 
For example
SELECT ST_OffsetCurve (geom, -20)  as geom_off
FROM table
WHERE id_arc in (1690,1693)
 
give me the result that you can see in the attached image rendering in qgis
(One Direction on the left, the other on the right).
 
So I have the dirction information inside the arc geometry.
 
 
 
Thanks
fb


2013/5/16 Stephen Woodbridge <woo...@swoodbridge.com>
How do you define arc direction?
If you had a function:

select getArcDirection(arc);

What would you expect the output to be?

In your image, the arc direction is a function of the labeling algorithm in combination with this that of the arc. For example if the label were flipped upside down and written along the underside of the line then the arc direction symbol would have to be reversed. So we can see that it is a function of the label and not just the arc alone.

postgis does not do rendering so it can not define that.

-Steve


On 5/16/2013 11:14 AM, franco base wrote:
I send again message because it was blocked for the attcahed file too big


I have a public transport network with an arc for 2 Point(the bus stop).
I'd know without using the points information arc direction like in qgis
(as you can see from the attached imagine with arc_id and direction)


2013/5/14 Nicolas Ribot <nicola...@gmail.com
            <mailto:postgis-users@lists.osgeo.org>

            http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users



        _______________________________________________
        postgis-users mailing list

        http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users



    _______________________________________________
    postgis-users mailing list
offset_arcdirection.jpg

George Silva

unread,
Oct 4, 2013, 10:12:00 AM10/4/13
to PostGIS Users Discussion

The direction is always considered from start point to end point. You need to use these methods to determine everything else.

Reply all
Reply to author
Forward
0 new messages