[postgis-users] ST_NumPoints

Kis János Tamás kijato at gmail.com
Thu May 21 01:39:59 PDT 2009


Hi,

I have a big table (with 21000 rows):

CREATE TABLE kecskemet_k.foldreszletek
( sorszam bigserial NOT NULL,
  hrsz text,
  geometria geometry --POLYGON
) WITH (OIDS=TRUE);
CREATE INDEX i_foldreszletek_geometria ON kecskemet_k.foldreszletek
USING gist (geometria);

I'd like to know, how many point exists each geometry.

When I use the next SQL:

SELECT hrsz, round(ST_Area(geometria)), ST_NumPoints(geometria),
              CASE WHEN ST_NumPoints(geometria) IS NULL THEN '-' ELSE
else '+' END
FROM kecskemet_k.foldreszletek
ORDER BY 2 DESC
LIMIT 10;

the result is:
   hrsz    | round | st_numpoints | case
-----------+-------+--------------+------
 0118/4    |  2913 |              | -
 01521/172 | 21738 |              | -
 0183/27   |  2877 |              | -
 0855/53   |  5169 |              | -
 0413/43   |  1025 |              | -
 094/65    |  3130 |              | -
 0747/2    |  2877 |              | -
 01183/4   |   326 |              | -
 01609/79  |  2737 |              | -
 0801/163  |  1924 |              | -
(10 rows)

Why I got NULL value in the st_numpoints?

thx,
kjt



More information about the postgis-users mailing list