<div dir="ltr">Hello,<div><br></div><div>The correct way to implement that would be to borrow the compare function that already exists in postgis (<a href="https://github.com/postgis/postgis/blob/master/liblwgeom/gserialized.c#L313:5">https://github.com/postgis/postgis/blob/master/liblwgeom/gserialized.c#L313:5</a>) and already sorts everything in a nice Hilbert curve. All of the type punning is already there.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 2, 2021 at 6:04 PM Han Wang <<a href="mailto:hanwgeek@gmail.com">hanwgeek@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,<br></div><div><br></div><div>I am currently working on the GSoC project of `<b>Implementating a pre-sorting methods before GiST index building</b>` and now try to borrow some ideas from <a href="https://github.com/postgres/postgres/blob/master/src/backend/access/gist/gistproc.c#L1761" target="_blank">z-order implementation</a> in Postgres.</div><div><div>I am wondering, however, if I should use lower level postgres functions like `<b><a href="https://github.com/postgres/postgres/blob/master/src/backend/access/gist/gistproc.c#L1576" target="_blank">point_zorder_internal</a></b>` and `<a href="https://github.com/postgres/postgres/blob/master/src/backend/access/gist/gistproc.c#L1604" target="_blank"><b>ieee_float32_to_uint32</b></a>` and data structure like `<b><a href="https://github.com/postgres/postgres/blob/master/src/include/utils/geo_decls.h#L140" target="_blank">BOX</a></b>`.</div><div>What's more, I don't know if it is necessary to implement a util function `<b>ieee_float32_to_uint32</b>` in lwgeom.</div></div><div><br></div><div>I appreciate your ideas and suggestions. Feel free to talk to me.</div><div><br></div><div>Best regards,</div><div>Han</div></div>
_______________________________________________<br>
postgis-devel mailing list<br>
<a href="mailto:postgis-devel@lists.osgeo.org" target="_blank">postgis-devel@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-devel" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-devel</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Darafei "Komяpa" Praliaskouski<br>OSM BY Team - <a href="http://openstreetmap.by/" target="_blank">http://openstreetmap.by/</a><br></div></div>