Ticket #1154 (closed defect: wontfix)
ST_Area returns wrong results for big geography polygon [-179.9 -89.9 179.9 89.9 ]
| Reported by: | mvimercati | Owned by: | pramsey |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | postgis | Version: | 1.5.X |
| Keywords: | ST_Area geography big huge area | Cc: |
Description
Seems that ST_Area has some problem calculating very big area, like global area [ minlon=-179.9 minlat=-89.9 maxlon=179.9 maxlat=89.9 ]. I remember earth areas is about 510348973 km2
This calculates the area of half earth (near, I'm not crossing dateline), and seems correct
select st_area(g)/1000000, st_area(transform(geometry(g), 4326)),astext(geometry(g)) from (select 'POLYGON((0 89.9, 179.9 89.9, 179.9 -89.9, 0 -89.9, 0 89.9))'::geography) as foo(g);
?column? | st_area | astext
------------------+----------+---------------------------------------------------------
255174486.625509 | 32346.02 | POLYGON((0 89.9,179.9 89.9,179.9 -89.9,0 -89.9,0 89.9))
where the whole globe gives strange result:
st_area(transform(geometry(g), 4326)),astext(geometry(g)) from (select 'POLYGON((-179.9 89.9, 179.9 89.9, 179.9 -89.9, -179.9 -89.9, -179.9 89.9))'::geography) as foo(g);
?column? | st_area | astext
------------------+----------+------------------------------------------------------------------------
283369.499733791 | 64692.04 | POLYGON((-179.9 89.9,179.9 89.9,179.9 -89.9,-179.9 -89.9,-179.9 89.9))
I'm running Postgis 1.5.3 on Postgres 9.0.4. Arch Linux 64bit
Best Regards Vime
Change History
Note: See
TracTickets for help on using
tickets.
