[postgis-devel] Questions about exposing `uint32_hilbert` API

Han Wang hanwgeek at gmail.com
Sat Jun 19 03:42:37 PDT 2021


Hi Darafei,

Thanks for your answer!
I thought about calling `gbox_get_sortable_hash
<https://github.com/postgis/postgis/blob/main/liblwgeom/gbox.c#L893:1>`
directly before. But the definition of the GiST op class
<https://github.com/postgis/postgis/blob/main/postgis/postgis.sql.in#L781>,
it seems that the GiST uses `*box2df*` as a simple representation of
geometry types. And all of the other support functions accept `*BOX2DF*`
datum for further process.

Can you get the original datum to reuse it?
>
As of right now, I am unable to locate the API of getting the
original `GSERIALIZED` datum. And I will pull the request after more
research and some detailed tests.

If you have any suggestions or questions, please let me know.

Best regards,
Han

On Sat, Jun 19, 2021 at 6:10 PM Darafei "Komяpa" Praliaskouski <
me at komzpa.net> wrote:

> Hello,
>
> There is already exposed gbox_get_sortable_hash. In that function the SRID
> of geometry is also considered, as the generated Hilbert curve without
> normalization is very jittery around lat=0 and lon=0 lines, so popular
> SRIDs are special-cased.
>
> Can you get the original datum to reuse it?
>
> Otherwise, please expose whatever you need and get the pull request posted
> somewhere (I like github). Whether to expose it or move around will be best
> seen after you get something working on the flamegraph of the index
> creation.
>
>
> On Sat, Jun 19, 2021 at 11:29 AM Han Wang <hanwgeek at gmail.com> wrote:
>
>> HI all,
>>
>> Currently, I have to apply only the `*uint32_hilbert*
>> <https://github.com/postgis/postgis/blob/b3874ecb488c3e04bcc26f701864a188788c472a/liblwgeom/gbox.c#L815>`
>> to hash `*BOX2DF*` objects of geometry data. Would it be okay to include
>> the `uint32_hilbert` function signature in the `liblwgeom.h` for the
>> outside calls?
>>
>> Best regards,
>> Han
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>>
>
>
> --
> Darafei "Komяpa" Praliaskouski
> OSM BY Team - http://openstreetmap.by/
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20210619/b6d68f20/attachment.html>


More information about the postgis-devel mailing list