[postgis-users] oddity with computing areas

Eric McKeeth eldin00 at gmail.com
Tue Jul 17 16:11:49 PDT 2012


On Tue, Jul 17, 2012 at 3:48 PM, Mike Toews <mwtoews at gmail.com> wrote:
> On 18 July 2012 09:46, Mike Toews <mwtoews at gmail.com> wrote:
>> with data as (select 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom1,
>> 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom2)
>> select st_isvalid(geom1), st_area(geom1),
>>        st_isvalid(geom2), st_area(geom2)
>> from data;
>
> Hmm, on further analysis, valid geometries shouldn't matter as much
> for ST_Intersection:
>
> with data as (select 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom1,
> 'POLYGON((0 0, 1 0, 1 1, 0 1, 0 0, 1 0, 1 1, 0 1, 0 0))'::geometry AS geom2)
> select
>  st_isvalid(st_intersection(geom1, geom1)),
>  st_area(st_intersection(geom1, geom1))
> from data;
>
> -MIke

Ok, I found the problem and it was user error. At one point the areas
were getting treated as strings, and the string values were getting
truncated, which was losing things like 'e-007' off the end. When the
programmer fixed that, the problem went away. Sorry for the noise.

-Eric
-



More information about the postgis-users mailing list