<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>To Dennis -</p>
<p>Spatialite and GeoPackage is *not* the same.</p>
<p><u>How to create a GeoPackage using Spatialite SQL commands</u> :
<a class="moz-txt-link-freetext" href="https://gis.stackexchange.com/questions/321596/how-to-create-table-with-geometry-column-in-gpkg-with-spatialite">https://gis.stackexchange.com/questions/321596/how-to-create-table-with-geometry-column-in-gpkg-with-spatialite</a></p>
<p><u>Using guid field af Primary Key in GeoPackage:</u> The
GeoPackage standard *requires* an integer as primary key. So You
can't use GUID value as PK. </p>
<p>However you can have a GUID value in a non-PK text field. And use
these fields in both QGIS relations and joins to combine 2 tables
containing guid text-fields.</p>
<p>And you might consider <u>creating views in GeoPackages for
permanent joins</u>. :
<a class="moz-txt-link-freetext" href="https://gis.stackexchange.com/questions/438574/create-view-and-display-in-qgis-of-a-spatial-table-in-geopackage-or-spatialite">https://gis.stackexchange.com/questions/438574/create-view-and-display-in-qgis-of-a-spatial-table-in-geopackage-or-spatialite</a></p>
<p>The registered views will look like read-only tables in QGIS. <br>
</p>
<pre class="moz-signature" cols="72">--
Med venlig hilsen / Best regards
Bo Victor Thomsen
Civ.Ing. / M.Sc.Eng.
aestasGIS Denmark
</pre>
<div class="moz-cite-prefix">On 02/02/2025 01.06, dennis mckay via
QGIS-User wrote:<br>
</div>
<blockquote type="cite"
cite="mid:2087913672.6211910.1738454800162@mail.yahoo.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div class="yahoo-style-wrap"
style="font-family:verdana, helvetica, sans-serif;font-size:13px;">
<div>In Vol 227, Issue 8 I explained my bewilderment that the
processes I have used throughout the existence of Geopackages
were now not working. I was able to solve this by downloading
the latest Spatialite and using the spatialite.exe command
processor.<br>
<br>
The successful command was of the form: SELECT
AddGeometryColumn('','control','geom_control','4269','POINT',2,true);
This had worked with an earlier version of spatialite_gui.exe
(2.0.0-devel) Same software. Now, no go.<br>
<br>
The other problem was having populated geometry fields that
were not recognized as geometry fields. I had mistakenly been
populating the geopackage geometry columns with binary data
from PostGIS tables. <br>
<br>
I remedied this by exporting the data from PostGIS as textual
geometries, then imported into geopackage fields as
ST_GeomFromText(). A nice project would be to have both
softwares recognize the other's standards and accommodate.<br>
<br>
An unsolved part of my mystery remains. Why can't we convert
PostGIS tables to geopackage tables and retain the Primary
Fields as GUIDs? I was able to work around this for now.<br>
<br>
I regret providing a link to my free PDF book without
clarifying that I am not trying to sell anything. It is not a
trap.<br>
<br>
Dennis K. McKay<br>
Retired Federal Cadastral Surveyor</div>
<div><br>
</div>
</div>
<br>
<fieldset class="moz-mime-attachment-header"></fieldset>
<pre wrap="" class="moz-quote-pre">_______________________________________________
QGIS-User mailing list
<a class="moz-txt-link-abbreviated" href="mailto:QGIS-User@lists.osgeo.org">QGIS-User@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
</pre>
</blockquote>
</body>
</html>