File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -598,19 +598,16 @@ Datum geography_from_geometry(PG_FUNCTION_ARGS)
598598);
599599}
600600
601- /* Recalculate the boxes after re-setting the geodetic bit */
601+ /* force recalculate of box by dropping */
602602lwgeom_drop_bbox (lwgeom );
603603
604604g_ser = gserialized_geography_from_lwgeom (lwgeom , -1 );
605605
606- /*
607- ** Replace the unaligned lwgeom with a new aligned one based on GSERIALIZED.
608- */
606+
609607lwgeom_free (lwgeom );
610608
611609PG_FREE_IF_COPY (geom , 0 );
612610PG_RETURN_POINTER (g_ser );
613-
614611}
615612
616613PG_FUNCTION_INFO_V1 (geometry_from_geography );
Original file line number Diff line number Diff line change @@ -1066,21 +1066,21 @@ Datum geography_segmentize(PG_FUNCTION_ARGS)
10661066GSERIALIZED * g2 = NULL ;
10671067double max_seg_length ;
10681068uint32_t type1 ;
1069-
1069+
10701070/* Get our geometry object loaded into memory. */
10711071g1 = PG_GETARG_GSERIALIZED_P (0 );
10721072type1 = gserialized_get_type (g1 );
1073-
1073+
10741074/* Convert max_seg_length from metric units to radians */
10751075max_seg_length = PG_GETARG_FLOAT8 (1 ) / WGS84_RADIUS ;
1076-
1076+
10771077/* We can't densify points or points, reflect them back */
10781078if ( type1 == POINTTYPE || type1 == MULTIPOINTTYPE || gserialized_is_empty (g1 ) )
10791079PG_RETURN_POINTER (g1 );
1080-
1080+
10811081/* Deserialize */
10821082lwgeom1 = lwgeom_from_gserialized (g1 );
1083-
1083+
10841084/* Calculate the densified geometry */
10851085lwgeom2 = lwgeom_segmentize_sphere (lwgeom1 , max_seg_length );
10861086
@@ -1093,7 +1093,7 @@ Datum geography_segmentize(PG_FUNCTION_ARGS)
10931093lwgeom_free (lwgeom1 );
10941094lwgeom_free (lwgeom2 );
10951095PG_FREE_IF_COPY (g1 , 0 );
1096-
1096+
10971097PG_RETURN_POINTER (g2 );
10981098}
10991099
You can’t perform that action at this time.
0 commit comments