#375 closed enhancement (fixed)
Add lwcollection_homogenize and ST_Homogenize
Reported by: | colivier | Owned by: | pramsey |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.0 |
Component: | postgis | Version: | |
Keywords: | homogenize collection ST_GeomFromKML | Cc: |
Description
/* ** Given a generic collection, return the "simplest" form. ** ** eg: GEOMETRYCOLLECTION(MULTILINESTRING()) => MULTELINESTRING() ** GEOMETRYCOLLECTION(MULTILINESTRING(), MULTILINESTRING(), POINT()) ** => GEOMETRYCOLLECTION(MULTILINESTRING(), MULTIPOINT()) ** ** In general, if the subcomponents are homogeneous, return a properly ** typed collection. ** Otherwise, return a generic collection, with the subtypes in minimal ** typed collections.
I need this stuff for ST_GeomFromKML, to be able to return simplest geometry forms if KML input is mixed.
Change History (13)
comment:1 by , 15 years ago
comment:2 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
If no one react, i guess that it doesn't worth that much to expose to SQL this function.
I close the ticket.
comment:3 by , 13 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
comment:4 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:5 by , 13 years ago
Reacting, as I like this function Olivier: still interested in bringing it in ?
comment:6 by , 13 years ago
Sandro,
Core function is already in. just need to expose it trought PostGIS API.
Can took it, with an help on the related documentation.
comment:8 by , 13 years ago
OK, I've updated the internal function to handle more types, now to do the SQL binding.
follow-up: 13 comment:11 by , 13 years ago
Why did this one end up being called ST_CollectionHomogenize rather than just ST_Homogenize ? It also homogenizes MULTI*, not just collection. Are we in time to rename before going final or should we live with the current name forever ?
comment:12 by , 13 years ago
Beside, documentation is also wrong: "Collections that are homogeneous will be returned as the appropriate multi-type", while instead a GEOMETRYCOLLECTION composed by a single element is returned as a point, not a multi-point. Or maybe that's what "singleton" was about..
comment:13 by , 13 years ago
Replying to strk:
Why did this one end up being called ST_CollectionHomogenize rather than just ST_Homogenize ? It also homogenizes MULTI*, not just collection.
It puts it next to ST_CollectionExtract it's similar-but-different functional cousin.
Synopsys become:
Commited in lwgeom as r5265 and r5266
Do you think is worth to be exposed as SQL function also ? And if yes ST_Homogenize is a good name choice ?