[postgis-tickets] [PostGIS] #3009: ST_Area(the_geom, false) may change column value
PostGIS
trac at osgeo.org
Wed Dec 17 06:00:56 PST 2014
#3009: ST_Area(the_geom, false) may change column value
----------------------+-----------------------------------------------------
Reporter: fursten | Owner: pramsey
Type: defect | Status: new
Priority: critical | Milestone: PostGIS 2.1.5
Component: postgis | Version: 2.1.x
Keywords: |
----------------------+-----------------------------------------------------
Changes (by robe):
* priority: medium => critical
Comment:
Okay this is very disturbing. I was able to replicate the issue on my
2.1.3 install. I'll retest in 2.1.4. So something with the autocast from
geometry to geography is doing an address pointer switch instead of a
copy. A bug I presume in the ST_Area(geography) function.
{{{
CREATE TABLE test_weird AS SELECT 'MULTIPOLYGON(((-8.62650874577284
115.346832275391,-8.58441599597068 115.309066772461,-8.68013625652618
115.214309692383,-8.72629051135205 115.198516845703,-8.76225972524743
115.307693481445,-8.64348030291466 115.343399047852,-8.62650874577284
115.346832275391)))'::geometry As areas;
SELECT ST_AsText(areas)
FROM test_weird;
-- outputs --
MULTIPOLYGON(((-8.62650874577284 115.346832275391,-8.58441599597068
115.309066772461,-8.68013625652618 115.214309692383,-8.72629051135205
115.198516845703,-8.76225972524743 115.307693481445,-8.64348030291466
115.343399047852,-8.62650874577284 115.346832275391)))
-- then run
SELECT ST_Area(areas, true)
FROM test_weird;
--outputs 77811189.1983376 (since it falls into the autocast to
geography)
-- then run
SELECT ST_AsText(areas)
FROM test_weird;
-- outputs
MULTIPOLYGON(((-8.62650874577284 64.653167724609,-8.58441599597068
64.690933227539,-8.68013625652618 64.785690307617,-8.72629051135205
64.801483154297,-8.76225972524743 64.692306518555,-8.64348030291466
64.656600952148,-8.62650874577284 64.653167724609)))
}}}
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/3009#comment:1>
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