Opened 6 years ago

Closed 4 years ago

#4252 closed enhancement (wontfix)

Revise gidx_merge behavior with unknown

Reported by: komzpa Owned by: Komzpa
Priority: medium Milestone: PostGIS 3.1.0
Component: postgis Version: master
Keywords: Cc:

Description

Spin off #4139

In gserialized_gist_nd there are two conflicting clauses:

  • gidx_unknown is a gidx with 0 dimensions, and considered to include nothing;
  • an unshared dimension is considered to be "true" for any spatial relation.

Also volume/edge of unknown gidx is considered 0 when it could be infinity which may lead to better trees.

Evaluation whether we need to special case gidx_unknown is needed

Change History (7)

comment:1 by pramsey, 6 years ago

We do need it, because otherwise there's no way to handle indexing empty geometries (correctly). In fact I think (have to check) our 2d index still chuffs on empty because it lacks a good way to flag an empty geometry.

comment:2 by komzpa, 6 years ago

I think for WKB we already do POINT EMPTY as POINT (NaN, NaN). If we apply same thinking here, GIDX(NaN NaN, NaN NaN) will be a box for such a thing, and it will give the relation we want with all the functions:

  • gidx_merge(GIDX(NaN NaN, NaN NaN), GIDX(1 2, 3 4)) -> GIDX(1 2, 3 4)
  • overlaps(GIDX(NaN NaN, NaN NaN), GIDX(1 2, 3 4)) -> False
  • overlaps(GIDX(NaN NaN, NaN NaN), GIDX(NaN NaN, NaN NaN)) -> False
  • intersects(GIDX(NaN NaN, NaN NaN), GIDX(1 2, 3 4)) -> False
  • intersects((GIDX(NaN NaN, NaN NaN), GIDX(NaN NaN, NaN NaN))) -> False

And there will be no need to special case the undefined/empty across all functions. Any invariant that breaks this way?

comment:3 by komzpa, 5 years ago

Milestone: PostGIS 3.0.0PostGIS next

comment:4 by komzpa, 5 years ago

Milestone: PostGIS nextPostGIS 3.0.2

Milestone renamed

comment:5 by pramsey, 5 years ago

No, I don't think that works, since then you end up with EMPTY in the index that are basically non-findable. An empty key is not consistent with any node, so an index search always returns no results. The index needs a place to put empty things...

comment:6 by robe, 4 years ago

Milestone: PostGIS 3.0.2PostGIS 3.1.0

Are we still doing anything with this or shall we close as wontfix?

comment:7 by komzpa, 4 years ago

Resolution: wontfix
Status: assignedclosed
Note: See TracTickets for help on using tickets.