[postgis-tickets] [PostGIS] #3428: Feature request: A function to convert a geometry's coordinates into a MultiPoint

PostGIS trac at osgeo.org
Wed Jan 13 17:04:34 PST 2016


#3428: Feature request: A function to convert a geometry's coordinates into a
MultiPoint
--------------------------+----------------------------
  Reporter:  mwtoews      |      Owner:  pramsey
      Type:  enhancement  |     Status:  new
  Priority:  medium       |  Milestone:  PostGIS Future
 Component:  postgis      |    Version:  2.2.x
Resolution:               |   Keywords:
--------------------------+----------------------------
Changes (by mwtoews):

 * version:   => 2.2.x


Comment:

 The performance degrades with more geometries (e.g. 500 geometries, each
 with 1000 points):
 {{{
 DROP TABLE IF EXISTS random_lines;
 SELECT id, ST_MakeLine(array_agg(pt)) AS geom
 INTO TEMP random_lines
 FROM (
   SELECT id, ST_MakePoint(random(), random()) pt
   FROM generate_series(1, 500) id, generate_series(1, 1000)
 ) r
 GROUP BY id;
 -- Test 1
 WITH rows AS (
   SELECT ST_NPoints(ST_ToMultiPoint(geom)) FROM random_lines)
 SELECT count(*) FROM rows;
 -- Test 2
 WITH rows AS (
   SELECT ST_NPoints(geom) FROM random_lines)
 SELECT count(*) FROM rows;
 }}}
 With PostGIS 2.1 I'm comparing 500 ms vs. 30 ms.

 (Where I really noticed this issue was with an older PostGIS 1.5 that my
 work insists on using, where I'm comparing a painful 22021 ms vs. 30 ms,
 which is dismal, but on an unsupported release.)

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3428#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list