From: Paul Ramsey Date: Wed, 3 Mar 2010 06:06:00 +0000 (+0000) Subject: Move spheroid test to the correct place. X-Git-Tag: 2.0.0alpha1~3147 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7dbd3c0c6f7dad504461bd98983d49f5c45c5ae1;p=postgis Move spheroid test to the correct place. git-svn-id: http://svn.osgeo.org/postgis/trunk@5369 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/geography_measurement.c b/postgis/geography_measurement.c index 689adf488..f6f03cc42 100644 --- a/postgis/geography_measurement.c +++ b/postgis/geography_measurement.c @@ -248,10 +248,6 @@ Datum geography_area(PG_FUNCTION_ARGS) /* Initialize spheroid */ spheroid_init(&s, WGS84_MAJOR_AXIS, WGS84_MINOR_AXIS); - /* User requests spherical calculation, turn our spheroid into a sphere */ - if ( ! use_spheroid ) - s.a = s.b = s.radius; - lwgeom = lwgeom_from_gserialized(g); /* EMPTY things have no area */ @@ -279,6 +275,10 @@ Datum geography_area(PG_FUNCTION_ARGS) use_spheroid = LW_FALSE; } + /* User requests spherical calculation, turn our spheroid into a sphere */ + if ( ! use_spheroid ) + s.a = s.b = s.radius; + /* Calculate the area */ if ( use_spheroid ) area = lwgeom_area_spheroid(lwgeom, &gbox, &s);