7

I am interested to know whether changing the projection of a PostGIS table will affect the rending speed when viewing it in QGIS.

I have two layers coming from QGIS which are exactly the same and cover a geographical area covering England in the United Kingdom. The only difference is their projection:

  1. The first is ESPG: 4326 (WGS 84)
  2. The second is ESPG: 27700 (BNG)

The former (4326) appears to render in 2500ms and the second one in 7500ms.

Additional info

  • Both layers have a primary key on the same field
  • Both layers have a spatial index
  • The QGIS version is 3.4.15 and the project CRS is 27700
8
  • 2
    Feels odd that it would be faster to render from native EPSG:4326 and re-project into the QGIS project CRS EPSG:27700 than to read native EPSG:27700 directly. Could there be something else than CRS that is different in the tables or indexes? EPSG:27700 version may have more decimals in the coordinates and thus more data to transfer. What is the total rendering time?
    – user30184
    Feb 19 '20 at 12:39
  • 1
    Are both tables vacuumed? Next you should somehow divide the total time between the time spent for reading the data from the database and time that QGIS is using for rendering.
    – user30184
    Feb 19 '20 at 15:21
  • 1
    You can consider clustering both tables (ideally by an ID that tends to group nearby features, or using the spatial index, or..). If the features to be drawn are on disk physically near each others, it will be much faster than if the DB has to read many pages of data.
    – JGH
    Feb 19 '20 at 15:38
  • 2
    Try without QGIS: do a explain analyze using a spatial query (a bounding box) on both tables and see the difference
    – JGH
    Feb 19 '20 at 15:39
  • 1
    I don't think that coordinate precision matters whatsoever... They are not transferred as text, they are transferred as double precision floating point numbers, which occupy same space no matter what the actual number is...
    – DavidP
    Feb 19 '20 at 15:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.