Hi Sandro!
On Thursday, 13 March 2025, 21:15:21 CET
a.fu...@lqt.it wrote:
> I hope there is someone on this mailing list who
> can give you the assistance you are looking for,
> but you may also be the first and only human being
> to venture into these adventurous shores.
Thank you for your kind words! It truly is an adventure. But it works! I don't
know what Base is doing in the background, I think they might have their own
SQL parser, as my usual SQL is not working. But looking at the SQL their
visual designer gives me, I can translate my queries. Usually, for getting the
area of different subdivisions in a forest enterprise I would write something
like that:
```
select
n1."ogc_fid",
d1."distrikt" as 'Distrikt',
d1."name" as 'Distriktname',
a1."abteilung" as 'Abteilung',
a1."name" as 'Abteilungsname',
n1."unterabt" as 'Unterabteilung',
st_area(st_union(n1."geometry"))/10000 as 'Fläche [ha]',
st_union(n1."geometry") as geometry
from
"nutzungsarten" as n1
left join "abteilungen" as a1 on n1."abteilung_id"=a1."ogc_fid"
left join "distrikte" as d1 on n1."distrikt_id"=d1."ogc_fid"
group by
n1."unterabt",
n1."abteilung",
n1."distrikt"
order by
n1."distrikt",
n1."abteilung",
n1."unterabt"
```
Now, in Base, I need to write it like this, sans the geometry, because I don't
need to display polygons:
```
SELECT
"distrikte"."distrikt" "Distrikt",
"distrikte"."name" "Distriktname",
"abteilungen"."abteilung" "Abteilung",
"abteilungen"."name" "Abteilungsname",
"nutzungsarten"."unterabt" "Unterabteilung",
st_area( st_union( "nutzungsarten"."geometry" ) ) / 10000 "Fläche
[ha]"
FROM {
oj "nutzungsarten"
LEFT OUTER JOIN "abteilungen" ON "nutzungsarten"."abteilung_id" =
"abteilungen"."ogc_fid"
LEFT OUTER JOIN "distrikte" ON "nutzungsarten"."distrikt_id" =
"distrikte"."ogc_fid"
}
GROUP BY
"Unterabteilung",
"abteilungen"."abteilung",
"distrikte"."distrikt"
ORDER BY
"Distrikt" ASC,
"Abteilung" ASC,
"Unterabteilung" ASC
```
The views I created in QGIS DB Manager and spatialite_gui load without
problems however and all ST_* commands work! I'll write to the creator of the
SQLite-ODBC driver. I vaguely remember being able to load extensions on
Windows through the graphical ODBC interface.
Alternatively, I might set up a PostGIS locally with docker, as Libreoffice
has a native Postgres driver. This might actually work without tinkering, but
the tinkering is way more fun!
Generally, data-sources in Calc/Base are quite powerful. I can set up a
worksheet with pivot-tables and pivot-charts once and have them regenerate
when the data-source changes. Still less comfortable than R with GDAL, but the
client insists on office documents and "selling" them LibreOffice instead of
Excel and Word was enough work already.
Even now, in 2025, Writer is still ahead of Word in terms of structuring a
document and separating content from layout. If I can't write LaTeX, I always
choose Writer. I'm using Writer since 97, so I might be biased. I'm also
amazed how well Base works as an interface to databases, it feels a lot like
working with Access in the late 90s and early 2000s.
> I can't seem to recall anyone else using SpatiaLite
> via Calc.
I found someone else :-D :
>
https://groups.google.com/g/spatialite-users/c/GZfqHJqh_YQ/m/Lq0SyjKk3w4J
bye and best regards