Skip to content

Commit feef22f

Browse files
author
Gopal Verma
committed
updating the comments
1 parent 4e2b31f commit feef22f

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

contrib/babelfishpg_common/src/spatialtypes.c

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,7 +1128,6 @@ get_geometry_from_wkb(PG_FUNCTION_ARGS)
11281128

11291129
/*
11301130
* Converts WKB binary to geography with SRID and latitude validation.
1131-
* Mirrors get_geography_from_text but for WKB input.
11321131
*/
11331132
Datum
11341133
get_geography_from_wkb(PG_FUNCTION_ARGS)
@@ -2109,10 +2108,8 @@ handle_point_coordinates(GeometryData *geom_data, uint8 *result_data)
21092108
memcpy(dst, src + m_offset, COORD_SIZE);
21102109
}
21112110
}
2112-
/*
2113-
* Helper: get WKB type code with dimension encoding.
2114-
* PostGIS convention: +1000 for Z, +2000 for M, +3000 for ZM
2115-
*/
2111+
/* Get WKB type code with PostGIS dimension encoding (+1000 Z, +2000 M, +3000 ZM) */
2112+
21162113
static inline uint32_t
21172114
get_wkb_type(uint32_t base_type, bool has_z, bool has_m)
21182115
{
@@ -2122,11 +2119,7 @@ get_wkb_type(uint32_t base_type, bool has_z, bool has_m)
21222119
return base_type;
21232120
}
21242121

2125-
/*
2126-
* Write a single interleaved point (XY [Z] [M]) from CLR columnar layout.
2127-
* Reusable by all child WKB writers (Point, LineString, Polygon).
2128-
* Returns: bytes written
2129-
*/
2122+
/* Write interleaved point (XY [Z] [M]) from CLR columnar layout */
21302123
static uint32_t
21312124
write_interleaved_point(uint8 *dst, uint8 *src_base, uint32_t total_points, uint32_t pt_idx, bool has_z, bool has_m)
21322125
{
@@ -2153,7 +2146,6 @@ write_interleaved_point(uint8 *dst, uint8 *src_base, uint32_t total_points, uint
21532146

21542147
/*
21552148
* Write a single WKB Point child from CLR columnar data.
2156-
* Returns: bytes written
21572149
*/
21582150
static uint32_t
21592151
write_wkb_point_child(uint8 *dst, uint8 *src_base, uint32_t total_points, uint32_t pt_idx, bool has_z, bool has_m)
@@ -2168,10 +2160,8 @@ write_wkb_point_child(uint8 *dst, uint8 *src_base, uint32_t total_points, uint32
21682160
return pos;
21692161
}
21702162

2171-
/*
2172-
* Dispatch: write one child WKB entry based on parent multi-type.
2173-
* Returns: bytes written.
2174-
*/
2163+
2164+
/* Write child WKB entry based on parent multi-type */
21752165
static uint32_t
21762166
write_child_wkb(uint8 *dst, uint8 *src_base, uint32_t total_points, uint32_t pt_start, uint32_t child_npoints, uint8 parent_type, GeometryData *geom_data, uint32_t fig_start, uint32_t fig_end, bool has_z, bool has_m)
21772167
{
@@ -2187,7 +2177,7 @@ write_child_wkb(uint8 *dst, uint8 *src_base, uint32_t total_points, uint32_t pt_
21872177
}
21882178

21892179
/*
2190-
* Calculate WKB size for one child geometry.
2180+
/* Calculate WKB size for child geometry */
21912181
*/
21922182
static uint32_t
21932183
calculate_child_wkb_size(uint8 parent_type, uint32_t child_npoints, GeometryData *geom_data, uint32_t fig_start, uint32_t fig_end, bool has_z, bool has_m)
@@ -2205,9 +2195,8 @@ calculate_child_wkb_size(uint8 parent_type, uint32_t child_npoints, GeometryData
22052195
}
22062196
}
22072197

2208-
/*
2209-
* Get child geometry info (point range, figure range) for a given child index.
2210-
*/
2198+
/* Get child geometry point and figure ranges */
2199+
22112200

22122201
static void
22132202
get_child_info(GeometryData *geom_data, uint32_t child_idx,
@@ -2234,10 +2223,6 @@ get_child_info(GeometryData *geom_data, uint32_t child_idx,
22342223

22352224
/*
22362225
* Convert CLR multi-geometry binary to PostGIS WKB.
2237-
Designed to support
2238-
* MultiLineString, MultiPolygon in future with no changes
2239-
* to this function — only add cases to write_child_wkb()
2240-
* and calculate_child_wkb_size().
22412226
*/
22422227
static bytea*
22432228
handle_multi_to_postgis(GeometryData *geom_data)

0 commit comments

Comments
 (0)