1

Is there an equivalent to ST_Project that I can use for an SQL query for a virtual layer in QGIS

https://www.gaia-gis.it/gaia-sins/spatialite-sql-4.2.0.html

ST_Project( start_point Geometry, distance Double precision, azimuth Double precision ) : Geometry

Sethinacan
  • 1,724
  • 11
  • 19
  • Why not using ST_Project ? as QGIS virtual layer use SQLite/SpatiaLite it should work was is the problem exactly – J.R Jan 08 '24 at 16:14
  • Reprojection is computationally expensive. It's not really something you want to re-perform with every draw request. In database terms, you really want a materialized view. – Vince Jan 08 '24 at 16:14
  • @J.R I tried ST_Project in the virtual layer dialogue and the database manager. typing "ST_P' doesn't result in an autocomplete option for ST_Project. I tried queries like "Project (geometry,1000,Radians(45)) " and they don't move my points. It may well be that its supported and I am being daft. – Sethinacan Jan 08 '24 at 18:01
  • @vince I am drawing irregular tree canopies following an approach similar to the smooth polygon approach in the following link. The shapes are dynamic as the survey maybe corrected/ amended. Using Project seems tidier than translate. I would welcome any suggestions for a computationally more efficient method. Your reference to re-projection makes me wonder if you are mixing ST_Project and ST_Transform but I suspect that isn't the case – Sethinacan Jan 08 '24 at 18:17
  • 1
    From https://gis.stackexchange.com/questions/382795/listing-all-functions-available-in-qgiss-virtual-layer , the st_project function seems unavailable. Interestingly, you can use project with an extra parameter (the altitude), which successfully wraps over a qgis function (still not listed in the linked post!), though is it now using the point CRS distance unit instead of meters – JGH Jan 08 '24 at 19:15
  • 1
    If the function is not available, it should error out instead of silently returning a Null geometry. You can try to report it as a QGIS bug. – JGH Jan 08 '24 at 19:17

0 Answers0