1

I want to compare a geoprocessing done in QGIS and PostGIS. It involves a union of two large polygonal vector layers.The processing in QGIS tooks 1.5 hours on a well-equipped workstation (32 GB of RAM). I was never able to complete the processing on PostGIS.

Here is the tested SQL query:

create table public.union as
select st_union(ST_Forece2D(mos.geom), ST_Forece2D(bd_topo_bat.geom))
from public.mos, public.bd_topo_bat

Here is the error message:

ERROR: could not extend file "base/19370/76968.57" with FileFallocate(): No space left on device HINT: Check available disk space. ERROR: Could not extend file "base/19370/76968.57" with FileFallocate(): No space left on device SQL state: 53100

The error message is related to a problem with the temporary log file. In the postgresql.conf file, I edited the file by setting the value of log_temp_files = 10240. The default value was -1. I took this action based on this post: https://stackoverflow.com/questions/508 ... on-device

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Jun 24 at 9:31
6
  • 3
    You need to get a bigger disc Commented Jun 24 at 10:16
  • 1
    Your query is cross joining the tables so you are creating mos row count * topo row count features. What are you trying to do, the PostGIS equivalent of QGIS Dissolve, or Merge? Commented Jun 24 at 10:20
  • Thanks so much for your replies. i try to do the union Qgis Geoprocessing : docs.qgis.org/3.40/en/docs/user_manual/processing_algs/qgis/… Commented Jun 24 at 10:30
  • There is no PostGIS equivalent of that Union... See for example: gis.stackexchange.com/questions/179533/… . Do you need the attributes or are you ok with only the geometries? Commented Jun 24 at 10:39
  • 1
    Thnaks again for your help @Bera i need the attributes and geometries Commented Jun 24 at 12:03

1 Answer 1

1

As some commenters are saying, you are creating a many to many join. This is blowing the lid off the memory of Postgres. QGIS is not quite doing the equivalent process.

Test your query first with LIMIT 10 or WHERE id = 123456 in PGAdmin, in the results window, for the GEOM column, there will be a button to view the results in the built in geometry viewer. See if your polygons overlay each other.

answered Aug 12 at 21:04

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.