On Fri, 24 Sep 2021 13:06:07 -0700 (PDT), David Novak wrote:
> I have been playing around with the spatialite 5.1 version and tried
> to use the new knn2 module with temporary geometries. However,
> setting
> the F_TABLE_NAME as a temporary geometry, returns no values, while it
> does it just fine, when the table is an ordinary table. The query
> goes
> as follows:
>
> --------------------------- <snip>
> -----------------------------------
>
> Is there a restriction in knn2 on temporary geometries? This has been
> tested using Python.
>
Hi David,
the answer to your question is clearly explained in this Wiki page:
https://www.gaia-gis.it/fossil/libspatialite/wiki?name=TemporaryGeometries
"Behind the scenes 1.
SpatiaLite will silently create both geometry_columns and
spatial_ref_sys
metatables into the ATTACHED DATABASE when required."
short conclusion: KNN can only support geometry columns defined in
MAIN.geometry_columns
but temporary geometries are not in the MAIN database, they live in
the TEMP database, and consequently they are registered into
TEMP.geometry_columns, so they are invisible to KNN
bye Sandro