Esri / spatial-framework-for-hadoop

The Spatial Framework for Hadoop allows developers and data scientists to use the Hadoop data processing system for spatial data analysis.
Apache License 2.0
363 stars 160 forks source link

ST_SetSRID downcasts MultiPolygon to Polygon #109

Closed chaosmail closed 7 years ago

chaosmail commented 7 years ago

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

randallwhitman commented 7 years ago

Offhand that does sound a bit surprising - that will need looking into. Confirm the same output reproduces for me.