1

I am currently working with a high-quality PDF file that displays perfectly when viewed in Adobe. However, when I import this file into QGIS for georeferencing, the quality significantly degrades and the image becomes pixelated.

I've tried various settings within QGIS to improve the image quality, but so far, I haven't had any success. I'm wondering if there might be a workaround within QGIS that I'm not aware of that might handle this type of high-quality PDF better for georeferencing purposes.

How can I maintain the original quality of the PDF when importing it for georeferencing in a GIS application?

Original file screenshot when opened in Adobe

enter image description here

Screenshot of the same area after importing to QGIS for Georeferencing:

enter image description here

EDIT: After converting to TIFF format with DPI set to a higher value

After converting to TIFF with DPI set to a higher value

5
  • Could you share some test data?
    – user30184
    Commented Jul 30, 2023 at 19:46
  • Asking for software opinions in GIS SE is asking to get your Question closed for being opinion-based. I suggest you Edit this to focus on the problem, not on alternative approaches.
    – Vince
    Commented Jul 30, 2023 at 19:50
  • @Vince I've deleted the question about opinion
    – Abhilash
    Commented Jul 30, 2023 at 20:19
  • It looks bad because your PDF is being loaded as a raster, you could try to get the vector data using a PDF-DXF (eg cloudconvert.com/pdf-to-dxf) or PDF-SHP (eg mygeodata.cloud/converter/pdf-to-shp) then georeference the vector. Disclaimer: I have never used nor specifically endorse these services, they are only provided as examples of services that exist. Commented Jul 31, 2023 at 2:17
  • @user30184 Sure here is one sample file for testing adur-worthing.gov.uk/media/Media,156286,smxx.pdf
    – Abhilash
    Commented Jul 31, 2023 at 7:53

1 Answer 1

4

Since QGIS uses GDAL to load PDF files, we could set an Windows/Linux/iOS environment variable GDAL-PDF-DPI=300 to increase the raster quality from 150dpi (default) to 300dpi.

3
  • 1
    I have tried your solution. But for some reason it was not working i.e, PDF is not loading into the georeferencer. So I have used your idea and converted the PDF into TIFF format by using the below command. set GDAL_PDF_DPI=1200 gdal_translate -of GTiff -co "COMPRESS=DEFLATE" -co "PREDICTOR=2" -co "ZLEVEL=9" Media_156286_smxx.pdf output.tif I then imported the TIFF file for georeferencing. It worked out pretty well this way.
    – Abhilash
    Commented Jul 31, 2023 at 10:30
  • 1
    @Abhilash I'm glad I could help. Would add --config GDAL_CACHEMAX 1024 -co NUM_THREADS=ALL_CPUS -co TILED=YES to the command line to speed up translation and for image tiling. If your PDF has layers included, you could even remove the unnecessary ones. See all options here: gdal.org/drivers/raster/pdf.html
    – christoph
    Commented Jul 31, 2023 at 10:38
  • 1
    @Abhilash when I look at the sample PDF you have posted, it would be better to use JPEG compression for smaller size and faster loading: gdal_translate --config GDAL_CACHEMAX 1024 -co NUM_THREADS=ALL_CPUS -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -co TILED=YES -co JPEG_QUALITY=90 -b 1 -b 2 -b 3 <source.pdf> <target.tif>. And use overviews: gdaladdo --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR --config GDAL_TIFF_INTERNAL_MASK YES -r cubicspline <source.tif> 2 4 8 16
    – christoph
    Commented Jul 31, 2023 at 11:03

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.