[postgis-users] how many vertices in a linestring

Marco Lechner - FOSSGIS e.V. marco.lechner at fossgis.de
Fri Nov 20 08:07:16 PST 2009


Maxime van Noppen schrieb:
> Marco Lechner - FOSSGIS e.V. wrote:
>   
>> is there a function that returns the number of points of a geometry?
>>
>> LINESTRING(9.6567389 47.8442843,9.6572511 47.8443736,9.6570058
>> 47.8449885,9.6565007 47.8449207,9.6567378 47.8442853) => 5
>> LINESTRING(8.9289313 48.6910326,8.9289313 48.6910326) => 2
>> ...
>>     
>
> Hi,
>
> You might want to look at ST_NPoints and ST_Numpoints for linestrings :
>
> http://postgis.refractions.net/documentation/manual-1.4/ST_NumPoints.html
> http://postgis.refractions.net/documentation/manual-1.4/ST_NPoints.html
>
> However for geometries in general it's more complicated
exactly. thnx. by the way: what's the difference between st_numpoints()
and st_npoints()? The results in my case are the same



More information about the postgis-users mailing list