Hi,<br>try <span class="term">ST_npoints(geometry)<br></span>(ST_NumPoints(geometria) is only for linestring)<br><span class="term"><br><br>Fred<br><br><br><br></span><br><div class="gmail_quote">2009/5/21 Kis János Tamás <span dir="ltr"><<a href="mailto:kijato@gmail.com">kijato@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
I have a big table (with 21000 rows):<br>
<br>
CREATE TABLE kecskemet_k.foldreszletek<br>
( sorszam bigserial NOT NULL,<br>
hrsz text,<br>
geometria geometry --POLYGON<br>
) WITH (OIDS=TRUE);<br>
CREATE INDEX i_foldreszletek_geometria ON kecskemet_k.foldreszletek<br>
USING gist (geometria);<br>
<br>
I'd like to know, how many point exists each geometry.<br>
<br>
When I use the next SQL:<br>
<br>
SELECT hrsz, round(ST_Area(geometria)), ST_NumPoints(geometria),<br>
CASE WHEN ST_NumPoints(geometria) IS NULL THEN '-' ELSE<br>
else '+' END<br>
FROM kecskemet_k.foldreszletek<br>
ORDER BY 2 DESC<br>
LIMIT 10;<br>
<br>
the result is:<br>
hrsz | round | st_numpoints | case<br>
-----------+-------+--------------+------<br>
0118/4 | 2913 | | -<br>
01521/172 | 21738 | | -<br>
0183/27 | 2877 | | -<br>
0855/53 | 5169 | | -<br>
0413/43 | 1025 | | -<br>
094/65 | 3130 | | -<br>
0747/2 | 2877 | | -<br>
01183/4 | 326 | | -<br>
01609/79 | 2737 | | -<br>
0801/163 | 1924 | | -<br>
(10 rows)<br>
<br>
Why I got NULL value in the st_numpoints?<br>
<br>
thx,<br>
kjt<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</blockquote></div><br>