From: Regina Obe Date: Tue, 3 Nov 2015 10:54:45 +0000 (+0000) Subject: cleanup whitespace and comments X-Git-Tag: 2.3.0beta1~396 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=255139a8b3b4f3cf65f37a605bc0ee6d1c4e68b8;p=postgis cleanup whitespace and comments references #3356 (for 2.3 branch) references #3355 (for 2.3 branch for segmentize) git-svn-id: http://svn.osgeo.org/postgis/trunk@14352 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/postgis/geography_inout.c b/postgis/geography_inout.c index 12235bca8..7659d882c 100644 --- a/postgis/geography_inout.c +++ b/postgis/geography_inout.c @@ -598,19 +598,16 @@ Datum geography_from_geometry(PG_FUNCTION_ARGS) ); } - /* Recalculate the boxes after re-setting the geodetic bit */ + /* force recalculate of box by dropping */ lwgeom_drop_bbox(lwgeom); g_ser = gserialized_geography_from_lwgeom(lwgeom, -1); - /* - ** Replace the unaligned lwgeom with a new aligned one based on GSERIALIZED. - */ + lwgeom_free(lwgeom); PG_FREE_IF_COPY(geom, 0); PG_RETURN_POINTER(g_ser); - } PG_FUNCTION_INFO_V1(geometry_from_geography); diff --git a/postgis/geography_measurement.c b/postgis/geography_measurement.c index 06b363704..5d19fd7b8 100644 --- a/postgis/geography_measurement.c +++ b/postgis/geography_measurement.c @@ -1066,21 +1066,21 @@ Datum geography_segmentize(PG_FUNCTION_ARGS) GSERIALIZED *g2 = NULL; double max_seg_length; uint32_t type1; - + /* Get our geometry object loaded into memory. */ g1 = PG_GETARG_GSERIALIZED_P(0); type1 = gserialized_get_type(g1); - + /* Convert max_seg_length from metric units to radians */ max_seg_length = PG_GETARG_FLOAT8(1) / WGS84_RADIUS; - + /* We can't densify points or points, reflect them back */ if ( type1 == POINTTYPE || type1 == MULTIPOINTTYPE || gserialized_is_empty(g1) ) PG_RETURN_POINTER(g1); - + /* Deserialize */ lwgeom1 = lwgeom_from_gserialized(g1); - + /* Calculate the densified geometry */ lwgeom2 = lwgeom_segmentize_sphere(lwgeom1, max_seg_length); @@ -1093,7 +1093,7 @@ Datum geography_segmentize(PG_FUNCTION_ARGS) lwgeom_free(lwgeom1); lwgeom_free(lwgeom2); PG_FREE_IF_COPY(g1, 0); - + PG_RETURN_POINTER(g2); }