ST_StartPoint() for MultiLineStrings

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ST_StartPoint() for MultiLineStrings

David Quinn
As ST_StartPoint( multilinestring ) returns NULL for PostGIS 2.0
(http://postgis.refractions.net/docs/ST_StartPoint.html ), what
approach can be used to identify the start and end points of a
multilinestring?

Thanks,
David
_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: ST_StartPoint() for MultiLineStrings

Paul Ramsey-4
When ST_NumGeometries == 1, you can run ST_StartPoint on
ST_GeometryN(geom,1). Where ST_NumGeometries > 1 you are in
"interpretation land". What's the start point of a geometry with two
lines?

P.

On Tue, Sep 25, 2012 at 1:38 PM, David Quinn <[hidden email]> wrote:

> As ST_StartPoint( multilinestring ) returns NULL for PostGIS 2.0
> (http://postgis.refractions.net/docs/ST_StartPoint.html ), what
> approach can be used to identify the start and end points of a
> multilinestring?
>
> Thanks,
> David
> _______________________________________________
> postgis-users mailing list
> [hidden email]
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: ST_StartPoint() for MultiLineStrings

Paul Ramsey-3
This is actually one of those places where I wonder if an
answer-returning approach would be better or not. One interpretation:

ST_StartPoint(MultiLineString) -> MultiPoint

Which implies

ST_ExteriorRing(Multipolygon) -> MultiLineString

All sorts of fun. Question is: is this an improvement... still
requires handling the issues of N > 1, somehow or other.

P.

On Tue, Sep 25, 2012 at 2:08 PM, Paul Ramsey <[hidden email]> wrote:

> When ST_NumGeometries == 1, you can run ST_StartPoint on
> ST_GeometryN(geom,1). Where ST_NumGeometries > 1 you are in
> "interpretation land". What's the start point of a geometry with two
> lines?
>
> P.
>
> On Tue, Sep 25, 2012 at 1:38 PM, David Quinn <[hidden email]> wrote:
>> As ST_StartPoint( multilinestring ) returns NULL for PostGIS 2.0
>> (http://postgis.refractions.net/docs/ST_StartPoint.html ), what
>> approach can be used to identify the start and end points of a
>> multilinestring?
>>
>> Thanks,
>> David
>> _______________________________________________
>> postgis-users mailing list
>> [hidden email]
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: ST_StartPoint() for MultiLineStrings

David William Bitner
In reply to this post by Paul Ramsey-4
Perhaps to match a number of people's expectations, there should be an ST_First Point() that is basically ST_StartPoint(ST_GeometryN(ST_Multi(geometry),1)) 



On Tue, Sep 25, 2012 at 4:08 PM, Paul Ramsey <[hidden email]> wrote:
When ST_NumGeometries == 1, you can run ST_StartPoint on
ST_GeometryN(geom,1). Where ST_NumGeometries > 1 you are in
"interpretation land". What's the start point of a geometry with two
lines?

P.

On Tue, Sep 25, 2012 at 1:38 PM, David Quinn <[hidden email]> wrote:
> As ST_StartPoint( multilinestring ) returns NULL for PostGIS 2.0
> (http://postgis.refractions.net/docs/ST_StartPoint.html ), what
> approach can be used to identify the start and end points of a
> multilinestring?
>
> Thanks,
> David
> _______________________________________________
> postgis-users mailing list
> [hidden email]
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users



--
************************************
David William Bitner

_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: ST_StartPoint() for MultiLineStrings

Martin Davis-6
In which case why not just extend ST_StartPoint to include this behaviour?  Always nicer to keep the function list as short as possible.

On 9/27/2012 7:31 AM, David William Bitner wrote:
Perhaps to match a number of people's expectations, there should be an ST_First Point() that is basically ST_StartPoint(ST_GeometryN(ST_Multi(geometry),1)) 



On Tue, Sep 25, 2012 at 4:08 PM, Paul Ramsey <[hidden email]> wrote:
When ST_NumGeometries == 1, you can run ST_StartPoint on
ST_GeometryN(geom,1). Where ST_NumGeometries > 1 you are in
"interpretation land". What's the start point of a geometry with two
lines?

P.

On Tue, Sep 25, 2012 at 1:38 PM, David Quinn <[hidden email]> wrote:
> As ST_StartPoint( multilinestring ) returns NULL for PostGIS 2.0
> (http://postgis.refractions.net/docs/ST_StartPoint.html ), what
> approach can be used to identify the start and end points of a
> multilinestring?
>
> Thanks,
> David
> _______________________________________________
> postgis-users mailing list
> [hidden email]
> http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users



--
************************************
David William Bitner


_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2221 / Virus Database: 2441/5293 - Release Date: 09/26/12



_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: ST_StartPoint() for MultiLineStrings

Sandro Santilli
I'd rather keep it as it is, or even have it throw an exception.
If you want all endpoints use ST_Boundary (which should be extended
to support boundary node rule, btw).

I was also thinking that ST_StartPoint could probably be improved
to avoid full detoasting of the geometry...

--strk;

On Thu, Sep 27, 2012 at 08:06:38AM -0700, Martin Davis wrote:

> In which case why not just extend ST_StartPoint to include this
> behaviour?  Always nicer to keep the function list as short as
> possible.
>
> On 9/27/2012 7:31 AM, David William Bitner wrote:
> >Perhaps to match a number of people's expectations, there should
> >be an ST_First Point() that is basically
> >ST_StartPoint(ST_GeometryN(ST_Multi(geometry),1))
> >
> >
> >
> >On Tue, Sep 25, 2012 at 4:08 PM, Paul Ramsey <[hidden email]
> ><mailto:[hidden email]>> wrote:
> >
> >    When ST_NumGeometries == 1, you can run ST_StartPoint on
> >    ST_GeometryN(geom,1). Where ST_NumGeometries > 1 you are in
> >    "interpretation land". What's the start point of a geometry with two
> >    lines?
> >
> >    P.
> >
> >    On Tue, Sep 25, 2012 at 1:38 PM, David Quinn
> >    <[hidden email] <mailto:[hidden email]>> wrote:
> >    > As ST_StartPoint( multilinestring ) returns NULL for PostGIS 2.0
> >    > (http://postgis.refractions.net/docs/ST_StartPoint.html ), what
> >    > approach can be used to identify the start and end points of a
> >    > multilinestring?
> >    >
> >    > Thanks,
> >    > David
> >    > _______________________________________________
> >    > postgis-users mailing list
> >    > [hidden email]
> >    <mailto:[hidden email]>
> >    > http://postgis.refractions.net/mailman/listinfo/postgis-users
> >    _______________________________________________
> >    postgis-users mailing list
> >    [hidden email]
> >    <mailto:[hidden email]>
> >    http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> >
> >
> >
> >--
> >************************************
> >David William Bitner
> >
> >
> >_______________________________________________
> >postgis-users mailing list
> >[hidden email]
> >http://postgis.refractions.net/mailman/listinfo/postgis-users
> >
> >
> >No virus found in this message.
> >Checked by AVG - www.avg.com <http://www.avg.com>
> >Version: 2012.0.2221 / Virus Database: 2441/5293 - Release Date: 09/26/12
> >
>

> _______________________________________________
> postgis-users mailing list
> [hidden email]
> http://postgis.refractions.net/mailman/listinfo/postgis-users

_______________________________________________
postgis-users mailing list
[hidden email]
http://postgis.refractions.net/mailman/listinfo/postgis-users