Hello,
I'm trying to automate changes in the projection used by the map canvas. If
I open the python console and use the following command sequence:
novus_CRS = '+proj=lcc +lat_1c.0 +lat_2u.0 +lat_0p.0 +lon_0=-97.0
+datum=WGS84 +no_defs'
crs = QgsCoordinateReferenceSystem.fromProj4(novus_CRS)
qgsProject = QgsProject.instance()
qgsProject.setCrs(crs)
This works fine. However, and when I try to incorporate it programmatically
(e.g. in a plugin), I keep getting the error:
Failed to open /usr/local/share/qgis/resources/data/world_map.gpkg
However, this file seems to be in the right subdirectory:
$ cd /usr/local/share/qgis/resources/data
ubuntu@ip-172-31-23-167:/usr/local/share/qgis/resources/data$ ls -l
total 12744
-rw-r--r-- 1 root root 2542 Jun 8 2022 README_world_map.md
-rw-r--r-- 1 root root 27743 Jun 8 2022 contributors.json
-rw-r--r-- 1 root root 17711 Jun 8 2022 contributors.qml
-rw-r--r-- 1 root root 8355 Jun 8 2022 qgis-hackfests.json
-rw-r--r-- 1 root root 18507 Jun 8 2022 qgis-hackfests.qml
-rw-r--r-- 1 root root 4412 Jun 8 2022 user_groups.qml
-rw-r--r-- 1 root root 8897 Jun 8 2022 user_groups_data.json
-rw-r--r-- 1 root root 12914688 Jun 8 2022 world_map.gpkg
-rw-r--r-- 1 root root 25158 Jun 8 2022 world_map_generalize.model3
Not sure why of this behavior discrepancy console vs. programmatically.
Thanks.
AF
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to