Opened 9 years ago

Closed 9 years ago

#3522 closed enhancement (fixed)

ST_Subdivide() returns 0 rows on point geometries

Reported by: snorris Owned by: pramsey
Priority: medium Milestone: PostGIS 2.2.3
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

Based on http://blog.cartodb.com/subdivide-all-things/ I just tried ST_Subdivide. It works great, a nice performance benefit.

Points weren't handled as I expected though:

SELECT ST_Subdivide(ST_GeomFromText('POINT(1 1)',4326),10);
 st_subdivide
--------------
(0 rows)

Of course subdividing points makes no sense, but the function might be easier to use if points were returned unchanged?

Change History (2)

comment:1 by pramsey, 9 years ago

Milestone: PostGIS 2.2.3

Hm, a simple fix to preserve points opens a new can of worms: how to handle multipoints correctly.

with mp as (
  select st_collectionhomogenize(st_collect(pt)) as geom 
  from (
    select st_makepoint(random(), random()) as pt 
    from generate_series(1,100)
    ) as foo
  ) 
select st_subdivide(geom,16) 
from mp;

comment:2 by pramsey, 9 years ago

Resolution: fixed
Status: newclosed

Should be resolved for POINT and MULTIPOINT at r14834 in 2.2 and r14835 in trunk.

Note: See TracTickets for help on using tickets.