3

PostGIS Bundle 3.3.3 for Windows with MobilityDB

 1 year ago
source link: https://www.bostongis.com/blog/index.php?%2Farchives%2F281-PostGIS-Bundle-3_3_3-for-Windows-with-MobilityDB_html=
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Friday, June 02. 2023

PostGIS Bundle 3.3.3 for Windows with MobilityDB

I recently released PostGIS 3.3.3. bundle for Windows which is available on application stackbuilder and OSGeo download site for PostgreSQL 11 - 15. If you are running PostgreSQL 12 or above, you get an additional bonus extension MobilityDB which is an extension that leverages PostGIS geometry and geography types and introduces several more spatial-temporal types and functions specifically targeted for managing objects in motion.

What kind of management, think of getting the average speed a train is moving at a segment in time or collisions in time, without any long SQL code. Just use a function on the trip path, and viola. Think about storing GPS data very compactly in a singe row /column with time and being able to ask very complex questions with very little SQL. True PostGIS can do some of this using geometry with Measure (geometryM) geometry types, but you have to deal with that craziness of converting M back to timestamps, which mobilitydb temporal types automatically encode as true PostgreSQL timestamp types.

Anita Graser, of QGIS and Moving Pandas fame, has written several posts about it such as: Visualizing Trajectories with QGIS and mobilitydb and Detecting close encounters using MobilityDB 1.0.

Why did it take so long to package for windows?

MobilityDb has been around for a couple of years now. The version packaged with PostGIS 3.3.3. bundle, is the develop branch and not yet tagged. The current tagged MobilityDB 1.0 does not work on windows. Part of the delay was just getting all the pieces to work right to behave right under Mingw64 (what I build all PostGIS related extensions for windows with). Some of that is because I have my dependencies all separate so I can easily swap out newer versions of things, thus need to explicitly specify every single dependency, and then there were just issues beyond that, too long to get into.

Needless to say, I'm very grateful to MobilityDb developers who took on the challenge of working out many of my problems. So when I revisited again, things just worked. I haven't thoroughly tested it though, so I expect there to still be problems. You can report any issues on the MobilityDB issue tracker and I'll try to address as best I can. Once MobilityDb 1.1.0 is tagged, I expect to do a rerelease of the PostGIS 3.3.3 windows bundle with the tagged version, if we don't release PostGIS 3.3.4 before then.

How do you use it

One gotcha at the moment is that the postgis library has to be preloaded, so to use, you'd need to do the below. This isn't specific to windows, it's the same even if running on a Linux/Unix based system.


-- confirm you don't have any existing pre-loaded libraries,
-- if you do make sure to readd when alter system
SHOW shared_preload_libraries;
ALTER SYSTEM  SET shared_preload_libraries = 'postgis-3';

SHOW max_locks_per_transaction;

-- if lower than 128, then run the below
ALTER SYSTEM SET max_locks_per_transaction = 128;

From Windows services, restart the PostgreSQL service. Now you are ready to enable mobilitydb in a database.


CREATE EXTENSION mobilitydb;

If you failed to do the above steps or restart your service, you might get an error when you run the create extension command of the sort:

“C:/Program Files/PostgreSQL/15/lib/libMobilityDB-1.1.dll”: The specified module could not be found.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK