<div dir="ltr">Hi,<div><br></div><div>I maintain <a href="https://github.com/twpayne/pgx-geos">https://github.com/twpayne/pgx-geos</a> which serializes and deserializes PostGIS types for PostgresSQL's binary and text protocols. It makes it easy for Go developers to work with PostGIS and GEOS.</div><div><br></div><div>This question is about the different OIDs that PostGIS registers and their serialization over the wire between client and server.</div><div><br></div><div>Right now PostGIS registers six types:<br>  <a href="https://github.com/postgis/postgis/blob/2773d7419c4ada598847e1b5ac9b292cbd409846/libpgcommon/lwgeom_pg.c#L192-L197">https://github.com/postgis/postgis/blob/2773d7419c4ada598847e1b5ac9b292cbd409846/libpgcommon/lwgeom_pg.c#L192-L197</a><br><br></div><div>PostGIS registers box2df, but there's also box2d:<br><br>obstacledb=# SELECT typname, oid FROM pg_type WHERE typname IN ('box2d', 'box2df', 'box3d', 'gidx');<br> typname |   oid   <br>---------+---------<br> box3d   | 5248539<br> box2d   | 5248543<br> box2df  | 5248547<br> gidx    | 5248551<br>(4 rows)</div><div><br></div><div>I have the following specific questions:<br><br>- If PostGIS registers box2df, where does box2d come from?<br><br>- If I understand correctly, box2df should be a box2d with single-precision floats rather than double-precision floats. Is this correct?<br><br>- Are box2df's ever sent over the wire? What would be a query that returns a box2df as opposed to a box2d?<br><br>- If I understand correctly, the text serialization format for box2d is a string "BOX(minX minY,maxX maxY)", and there is no serialization for box2df. Is this correct?<br><br>- If I understand correctly, there is no binary serialization format for box2d or box2df. Is this correct?</div><div><br></div><div>- If I understand correctly, gidx is a box3d with single-precision floats, and, like box2df, is never sent over the wire. Is this correct?<br><br>Many thanks for any clarification here,</div><div><br></div><div>Tom</div><div><br><br><br></div><div><br></div></div>