Wednesday, June 17, 2026

Forward with QGIS 4 and NetBSD 11 and more

 A week ago, based on a tip from Greg T, I build QGIS 4.0 on a NetBSD 10.1 system. It worked, after arranging the work-in-progress snapshot.

Peripherally, I got into gdal (for georeferenced PDFs), postgis (with PostgreSQL 18), and fence-posting of PGSQL 14 through 18 as allowed by the pkgsrc tools and all.


I put the problems first, instead of the splash screen showing the build worked; this showed it work-worked.

Splash - QGIS 4.0 starting banner, with an auth fail flag.


To show the build time (as opposed to package download/install time), I used Zabbix charts of CPU time and/or temperature.

First is the fastest machine I have, compiling QGIS 3 followed by 4. A few hours each. Ish.


Sidebar in the future about single-threaded builds, as I have a collection of antique laptops that I've kept out of the hopper by installing BSD on them with new SSDs. 2 or 4 core, plus one "tower" that has a laptop-type board inside (HP made money doing that).

The glitch for using other than one PGSQL versions I found was the packaged build use 16 (as of this writing), but the pkgsrc make process allows one (and only one) of 14 through 18. For some reason I've got even number versions running, not on purpose, just the time I jumped into the pool for some app/reason.

A bigger test/build/test cycle is brewing, with the rough starting time after 2026 Q2 packages are distributed in a few weeks. Meanwhile I built 3.4.8 on a system with PostgreSQL 14 server. 18 to 24 hours on this box.

===> Extracting for qgis-3.44.8

=> Full dependency postgresql14-client>=14.17nb2: found postgresql14-client-14.23

I like this chart as Zabbix allows dashboards with arbitrary charts to go on the same page. Easier than trying to line up 2 Y-axes unless they are on the same scale (like classic 1/5/15 minute processor loads).

Issues above (and beyond)

  • First encounter with an authorization message. Doesn't stop use, but it's unfamiliar territory.
  • Building a current work-in-progress sub-tree broke apps on my main machine, maybe not the version 4.0.
  • One core dump in the short time I ran 4.0.
  • I had/have outdated pkgsrc trees, getting up to date with 2026 Q1 then Q2.
  • Wishful thinking I could cross-build an aarch64 QGIS 4.0 as a Pi 4 may take as long to build as an old Intel (unsure)
  • Geo-referenced PDF exports depend on the gdal library; Greg imported a change prior to freeze that I have yet to try.
  • PostGIS works with version 18 now.
  • The PKGSRC.se site has some new data, some old data on their pages. Images at the end. #ToDo
  • The QGIS.org site shows build steps for FreeBSD and OpenBSD, not NetBSD. (Whom do I know?)
  • pkg_admin version?
  • The NetBSD wiki and pkgsrc docs could explain more how to/why to use a PGSQL version with QGIS or any other DB app.
    • e.g 

https://wiki.netbsd.org/pkgsrc/how_to_install_a_postgresql_server/
Last edited 5 years and 9 months ago
...
The recommended way is to install the prebuilt postgresql binaries.
The PostgreSQL Server depends on the postgreSQL Client.

? road less traveled way - how to use a version other than default ?

cd geography/qgis
set version ?
"make install"

PHP and PostgreSQL
You may wish to install the postgres Module for PHP, e.g. for PHP 7.0 use:
# pkg_add -v php70-pgsql

3$ pkgin se php".*"-pgsql
php56-pgsql-5.6.40nb1  PHP extension for PostgreSQL databases
php74-pgsql-7.4.33nb1  PHP extension for PostgreSQL databases
php82-pgsql-8.2.31nb1  PHP extension for PostgreSQL databases
php83-pgsql-8.3.31nb1  PHP extension for PostgreSQL databases
php84-pgsql-8.4.20nb1  PHP extension for PostgreSQL databases
php85-pgsql-8.5.7nb1  PHP extension for PostgreSQL databases

add Python example:

$ pkgin se psyco
py311-psycopg2-2.9.11  PostgreSQL database adapter for Python
py312-psycopg2-2.9.11  PostgreSQL database adapter for Python
py313-psycopg2-2.9.11 = PostgreSQL database adapter for Python
py314-psycopg2-2.9.11  PostgreSQL database adapter for Python

import psycopg2


add Perl via DBI/DBD:

$ pkgin se p5-dbd-postgresql
p5-DBD-postgresql-3.14.2nb5  Perl DBI/DBD driver for PostgreSQL databases

use DBI qw(:sql_types);
use DBD::Pg qw(:pg_types);

export PGUSER=scott
export PGDATABASE=emp
export PGHOST=dept

? Read the manual ?

https://www.netbsd.org/docs/pkgsrc/pkgsrc.html

pgsql.buildlink3.mk will accept any of the Postgres versions in the variable PGSQL_VERSIONS_ACCEPTED and default to the version PGSQL_VERSION_DEFAULT. See the file for more information.

Explain default version "middle of the road" at a point in time for more users than other versions (subject to debate) not "most recent" version of PostreSQL.


https://pkgsrc.se/wip/qgis


https://pkgsrc.se/geography/qgis

Others in scope:

https://pkgsrc.se/geography/gdal-lib

https://pkgsrc.se/databases/py-psycopg2


Wednesday, June 10, 2026

Delaminating the Onion, OGR style

 After I learned about geospatial PDF documents with layers of GIS "goo" embedded I've tried out maps and similar graphics for events and travel. New challenge--having a layered PDF for a theater stage floor plan. The idea came when I found first one, then a different paper drawing, detailed but lacking those "mechanical drawing" features such as a title block, date, scale, source, things like that.

New version, showing 3 of 8 layers


The old drawings could have come from Corel Draw for all I know.


I wanted to use LibreOffice Draw if possible, to create a layered PDF, as I've learned how to do most of what I could do with MS Visio. The above image is the fix for dimensions in Imperial units that show up as "10.01 feet" for unknown reasons. Truncating to 1 decimal place makes it better as "10.0 feet."

Here's one with a rounding error, and also a scaling error as the scale "rod" should be 10 feet, not 9 and a half-ish.

The ODG, seat numbers and scan layers were supposed to have boxes to check if that layer was included in the view. 

But no, while the LibreOffice drawing can manage internal layer juggling, writing a PDF with defined layers does not work.

https://bugs.documentfoundation.org/show_bug.cgi?id=138142

Bug 138142 - "Draw should have an option to export to PDF keeping separate layers"

A workaround posted here:

https://graphicdesign.stackexchange.com/questions/169487/how-to-export-a-drawing-odg-file-from-libreoffice-25-8-to-a-multi-layered-pdf-f 

Load the ODG file into Scribus, then export to a layered PDF. It works, but only to a degree, as the layers get shuffled and renamed.

Extra layers can be added in Scribus, so I chose to do the measured baselines (aisles etc.) in ODG and the icing of title blocks and guides for lining out skewed scanned of paper drawings in Scribus.

I've also added an SVG layer from Inkscape.

Looking at an imported JPEG is awful from Scribus. But the PDF looks fine.

Layers and more


Almost had an issue with "back-loading" a Scribus file on Windows 1.6, after creating a document in NetBSD with 1.7. So I'll use the higher version and save as" a lower if anyone needs to look for themselves.



The scans ended up slightly different in shape, added to the task of alignment.

 

Embellishing with seat designs and numbers in Inkscape turned out to be a bigger task than imagined. For one thing, the web site has a dark theme, but printing the images for human note-taking needs a light theme, as these are.

The seat counts differ between the two, I finally noticed also.