Lars Aksel Opsahl

Chief Engineer

(+47) 911 97 964

Ås O43

Visiting address
Oluf Thesens vei 43, 1433 Ås


In Norway we now get more up-to-date maps for land resource map (AR5), because the domain experts on agriculture in the municipalities in Norway have got access to a easy to use client. This system includes a simple web browser client and a database built on Postgis Topology. In this talk we will focus on, what is it with Postgis Topology that makes it easier to build user friendly and secure tools for updating of land resource maps like AR5. We will also say a couple of words about advantages related to traceability and data security, when using Postgis Topology. In another project, where we do a lot ST_Intersection and ST_Diff on many big Simple Feature layers that covers all of Norway, we have been struggling with Topology exceptions, wrong results and performance for years. Last two years we also tested JTS OverlayNG, but we still had problems. This year we are switching to Postgis Topology and tests so far are very promising. We also take a glance on this project here in this talk. A Postgis Topology database modell has normalised the data related to borders and surfaces as opposed to Simple Feature where this is not the case. Simple Feature database modell may be compared to not using foreign keys between students and classes in a database model, but just using a standard spreadsheet model where each student name are duplicated in each class they attend. URL’s that relate this talk


When you care about data integrity of spatial data you need to know about the limitations/weaknesses of using simple feature datatype in your database. For instance contains 2,377,772 simple features among which we find 852 overlaps and 1420 invalid polygons. For this test I used “ESRI FGDB” file and gdal for import to postgis. We find such minor overlaps and gaps quite often, which might not be visible for the human eye. The problem here is that it covers up for real errors and makes difficult to enforce database integrity constraints for this. Close parallel lines also seems to cause Topology Exception in many spatial libraries. A core problem with simple features is that they don't contain information about the relation they have with neighbor features, so integrity of such relations is hard to constraint. Another problem is mixing of old and new data in the payload from the client. This makes it hard and expensive to create clients, because you will need a full stack of spatial libraries and maybe a complete locked exact snapshot of your database on the client side. Another thing is that a common line may differ from client to client depending on spatial lib, snapTo usage, tolerance values and transport formats. In 2022 many system are depending on live updates also for spatial data. So it’s big advantage to be able to provide a simple and “secure” API’s with fast server side integrity constraints checks that can be used from a standard web browser. When we have this checks on server side we will secure the equal rules across different clients. Is there alternatives that can secure data integrity in a better way? Yes, for instance Postgis Topology. The big difference is that Postgis Topology has more open structure that is realized by using standard database relational features. This lower the complexity of the client and secures data integrity. In the talk “Use Postgis Topology to secure data integrity, simple API and clean up messy simple feature datasets.” we will dive more into the details off Postgis Topology Building an API for clients may be possible using simple features, but it would require expensive computations to ensure topological integrity but to solve problem with mixing of new and old borders parts can not be solved without breaking the polygon up into logical parts. Another thing is attribute handling, like if you place surface partly overlapping with another surface should that have an influence on the attributes on the new surface. We need to focus more on data integrity and the complexity and cost of creating clients when using simple feature, because the demands for spatial data updated in real time from many different clients in a secure and consistent way will increase. This will be main focus in this talk.


This report describes the development of a novel model & digital map system for visualising diverse ecosystem services at national scale in Norway. Denne rapporten beskriver utviklingen av en ny metode og en digital kartløsning for å visualisere ulike økosystemtjenester på nasjonal skala i Norge.