Tuesday, October 17, 2023

Saga of QGIS Tutorial--NetBSD stumble at the finish line

Previously*, I wrangled QGis version 3.28 or better on Raspberry Pi's trying to complete pertinent tutorial lessons and hitting local software application limits. I had success with OpenSUSE and FreeBSD (on x86 hardware). My next focus was NetBSD on a Pi4 (with the full 8GB), after upgrading the package system (in fits and starts) to the Q3 2023 release. 

https://jspath55.blogspot.com/2023/09/tiling-for-geo-map-referencing-in-qgis.html

https://jspath55.blogspot.com/2023/10/qgis-tutorial-torture-track.html

Just because it says BETA doesn't mean this is a flaky OS. The tiny box just takes everything I can throw at it; my main challenge is getting all the pieces talking nice (and doing a valid GEO PDF at the end).

$ uname -a
NetBSD nb 10.0_BETA NetBSD 10.0_BETA (GENERIC64) #0: Sat Sep  9 15:02:43 UTC 2023  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64 evbarm

[     1.000000] NetBSD 10.0_BETA (GENERIC64) #0: Sat Sep  9 15:02:43 UTC 2023
[     1.000000]         mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/evbarm/compile/GENERIC64
[     1.000000] total memory = 8024 MB
[     1.000000] avail memory = 7735 MB

[     1.000000] simplebus0 at armfdt0: Raspberry Pi Foundation Raspberry Pi 4 Model B

[     2.425653] bwfm0: Firmware file model-spec: brcmfmac43455-sdio.Raspberry Pi 4 Model B.bin

The PkgSrc has a current enough version (between Rasbian and Windows), and all the ducks included.

$ ldd /usr/pkg/bin/qgis
/usr/pkg/bin/qgis:
        -lqgis_app.3.28.7 => /usr/pkg/lib/libqgis_app.so.3.28.7
        -lqwt.6 => /usr/pkg/qwt-6.1.5/lib/libqwt.so.6
        -lexecinfo.0 => /usr/lib/libexecinfo.so.0
        -lelf.2 => /usr/lib/libelf.so.2
        -lc.12 => /usr/lib/libc.so.12
        -lgcc_s.1 => /usr/lib/libgcc_s.so.1
        -lQt5PrintSupport.5 => /usr/pkg/qt5/lib/libQt5PrintSupport.so.5
        -lQt5Widgets.5 => /usr/pkg/qt5/lib/libQt5Widgets.so.5
        -lQt5Gui.5 => /usr/pkg/qt5/lib/libQt5Gui.so.5
        -lQt5Core.5 => /usr/pkg/qt5/lib/libQt5Core.so.5
        -lz.1 => /usr/lib/libz.so.1
        -ldouble-conversion.3 => /usr/pkg/lib/libdouble-conversion.so.3
        -lstdc++.9 => /usr/lib/libstdc++.so.9


Summing up:

$ qgis --version

QGIS 3.28.7-Firenze 'Firenze' (exported)

Steps for tutorial section 14 (part: "14.3.6. basic Follow Along: Joining the Forest Stand Data")

1. Clicking on the table on the right side lights up the areas on the left. Huzzah. Tiny sliver of badly-drawn border there as I could not (did not) locate the "fix overlaps" routine). Next lesson.

QGIS Attributes table - Pi 4 NetBSD 10

The attributes link is a huge step in correlating pictures to numbers, as it were.

2. Filter on the far left (funnel icon) where I selected by a routine just 2 subsets. Heads above manually clicking to select, and saved for future changes.

QGIS Filter - Pi4 NetBSD 10


3. A tree view of attributes rather than a grid view, 


QGIS attributes / Tutorial document

Zoom

The lessons worked, as far as an academic follow-the-book exercise went. I knew the parts I skipped or didn't complete, learning enough to see applicability to a few real-world projects.

The export to a georeferenced PDF is almost there but the NetBSD packages I installed omitted a GDAL subset.

GDAL PDF driver was not built with PDF read support. A build with PDF read support is required for GeoPDF creation.

Back to the package manual. And the mailing support lists with a reasonable question.

Next lesson: Elevations with topographic or other sources, or a dive into database storage/retrieval.



Monday, October 9, 2023

QGIS tutorial torture track

 I tried to follow the QGIS Forestry tutorial (link below) on a couple Raspberry Pi's (would have liked to use only one but meh). I got up to vector-to-polygon and then stalled on the first day hands-on. In 2 weeks there's a QGIS conference in town I'm attending; consider this my study hall.

Previously: jspath55.blogspot.com/2023/09/tiling-for-geo-map-referencing-in-qgis.html

Wherein I list the QGIS versions within reach. Odd to have this many flavors, so let's do the taste test, starting with the Pi with the newest version, running on OpenSUSE. 


The OS is missing something in the Perl layer which results in error messages and missing menus. Until I can track them down or they reappear with an unrelated app upgrade.

Tutorial link:

The learning here is use the filter (search) field to enter the coordinate reference system (the other CRS, not the can't remember stuff one) with numbers. I missed one of the transformations as the version I used had slightly different field text.

Geo-referencing was easy until I misread something, throwing off the mark. Easily seen by the result, and I skipped to the next lesson by keying in the exact values instead of trying the visual drop the claw-grab protocol.




Very nice to have the answers in the margins, so to speak.
The skewed first version:



Maxwell Smart voice: "missed it by that much."

Gnu Imp

Sigh. Crashed on tutorial section trying to select by color.

Bang, Zoom, to the Moon, or as my Brit friends might say, "Cloud-cuckoo-land."


12:33:55



12:34:01

Fortunately, only the user session/window manager died, not the whole OS as it might look.

Switched over to another PI running Rasbian (but QGIS 3.10) that had Gnu Imp which worked, to a fault.

Gnu Imp - Lower Left of Map



More results in the green goo.



Not the ideal output the tutorial has, but the steps are workable. Later attempts to move to polygonal spaces failed as the Raspbian was missing parts, or I cannot find them yet, and the OpenSUSE needs the python hooks re-hooked to shape up the shape files.

SQL FUN

Something was in the wrong mode.


ERROR 1: sqlite3_exec(DROP TRIGGER rtree_states_provinces_geom_update3) failed: attempt to write a readonly database

ERROR 1: sqlite3_exec(CREATE TRIGGER "rtree_disputed_borders_geom_update3" AFTER UPDATE ON "disputed_borders" WHEN OLD."fid" != NEW."fid" AND (NEW."geom" NOTNULL AND NOT ST_IsEmpty(NEW."geom")) BEGIN DELETE FROM "rtree_disputed_borders_geom" WHERE id = OLD."fid"; INSERT OR REPLACE INTO "rtree_disputed_borders_geom" VALUES (NEW."fid",ST_MinX(NEW."geom"), ST_MaxX(NEW."geom"),ST_MinY(NEW."geom"), ST_MaxY(NEW."geom")); END) failed: trigger "rtree_disputed_borders_geom_update3" already exists


FILE TIFFing


tutorial-pi400/rautjarvi_green_georef.tif: TIFF image data, little-endian, direntries=29, height=4561, bps=362, compression=none, PhotometricIntepretation=RGB, name=U:\Dropbox\GISMOOD_KESKUS_prj2014\0-13004-002-Simosol-online_gis_materials\1-mets\303\244materiaalit\0-mets\303\244materiaalit\ex1-map digi, description=Groovy Green Goo, orientation=upper-left, width=2014



C.R.S.


"Multiple operations are possible for converting coordinates between these two Coordinate Reference Systems. Please select the appropriate conversion operation, given the desired area of use, origins of your data, and any other constraints which may alter the "fit for purpose" for particular transformation operations."


"An alternative, ballpark-only transform was used when transforming coordinates between EPSG:2392 - KKJ / Finland zone 2 and EPSG:3067 - ETRS89 / TM35FIN(E,N). The results may not match those obtained by using the preferred operation:
Possibly an incorrect choice of operation was made for transformations between these reference systems. Check the Project Properties and ensure that the selected transform operations are applicable over the whole extent of the current project."