@@ -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 */
11331132Datum
11341133get_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+
21162113static inline uint32_t
21172114get_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 */
21302123static uint32_t
21312124write_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 */
21582150static uint32_t
21592151write_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 */
21752165static uint32_t
21762166write_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 * /
21922182static uint32_t
21932183calculate_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
22122201static void
22132202get_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 */
22422227static bytea *
22432228handle_multi_to_postgis (GeometryData * geom_data )
0 commit comments