Skip to content

ST_SetSRID downcasts MultiPolygon to Polygon #109

@chaosmail

Description

@chaosmail

Hi guys,

I am not sure if this is a bug or a feature, however in my opinion this behavior is surprising.

SELECT ST_AsText(
  ST_MultiPolygon(array(0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0))
) FROM src LIMIT 1;

> OK
> MULTIPOLYGON (((0 0, 0 1, 1 1, 1 0, 0 0)))
> Time taken: 1.156 seconds, Fetched: 1 row(s)

vs

SELECT ST_AsText(
  ST_SetSRID(ST_MultiPolygon(array(0.0, 0.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0)), 4326)
) FROM src LIMIT 1;

> OK
> POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0))
> Time taken: 0.916 seconds, Fetched: 1 row(s)

Best, Christoph

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions