7

A colleague's team has been using the eVis plugin in QGIS to store research photos. eVis relies upon a filepath or URL stored in the data source (shapefile, Spatialite db, etc.). They are using a filepath on the local machine.

They recently ran into problems with photos not displaying, and after investigating, they found that folders had been moved or renamed. I have suggested that they organize their data (currently in shapefiles) in a spatial database (Spatialite or PostGIS), and they are interested in doing so. I also think they can benefit from storing the photos as BLOBs in the Spatialite or PostGIS database. I tested eVis and it works fine with data in Spatialite or PostGIS as long as the photo files are external and accessed through the file system or URL. It doesn't appear to provide a way to access photos stored as BLOBs in the database.

Is there a way that QGIS (or a plugin) can display photos stored as BLOBs in a Spatialite or PostGIS database?

2
  • 1
    The docs say that one can give evis a url. I have the same problem and I am looking at setting up a web server on the database machine that serves the photos in much the same way as a database would. i.e. under relative path set base path to something like http:// localhost/photos/ and check the first box so it just grabs the filename from the attribute. Jul 7, 2018 at 22:24
  • 1
    This sounds like Hyperlink or Attachment functionality so they may provide additional keywords to search on.
    – PolyGeo
    Apr 12, 2019 at 8:21

2 Answers 2

1

QGIS support for blobs is currently limited to disk-based layers like gpkg and memory layers, not databases. (See Load PostGIS Layer with BLOB and use the form widget for binary fields (QGIS 3.6) not working )

If you can live with this limitation, or if blob support is later expanded to additional providers, see my question and answer here: Display photo stored as blob in GPKG

The approach described turns the blob into an HTML img tag with a data URL data:image/jpeg;base64 as source. This can then be displayed in an HTML widget on the attribute form, or an HTML map tip.

1

QGIS can display photos stored in the database. Tested with Postgresql and Geopackage.

Please follow the other two questions related:

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.