Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS loader and exporter #8

Closed
martinRenou opened this issue Jun 13, 2024 · 4 comments
Closed

QGIS loader and exporter #8

martinRenou opened this issue Jun 13, 2024 · 4 comments
Labels
enhancement New feature or request
Milestone

Comments

@martinRenou
Copy link
Member

martinRenou commented Jun 13, 2024

We will implement a QGIS loader.

This will be initially implemented in jupytergis, though it could probably be extracted into its own jupytergis-qgis extension in the long term.

Similar to the jupytercad-freecad package (JupyterCAD is to FreeCAD what JupyterGIS will be to QGIS), it will implement a bridge between the QGIS format and our internal JGIS format.

@martinRenou martinRenou added the enhancement New feature or request label Jun 13, 2024
@martinRenou martinRenou changed the title QGIS loader QGIS loader and exporter Jun 13, 2024
@martinRenou
Copy link
Member Author

This should be fairly easy using the QGIS Python API:

In [1]: from qgis.core import QgsProject

In [2]: project = QgsProject.instance()
Application path not initialized
Application path not initialized
Application path not initialized
Application path not initialized
Application path not initialized
Application path not initialized

In [3]: print(project.fileName())


In [4]: project.read('examples/doc.qgz')
Out[4]: True

In [5]: project.layerTreeRoot
Out[5]: <function QgsProject.layerTreeRoot>

In [6]: project.layerTreeRoot()
Out[6]: <qgis._core.QgsLayerTree object at 0x000055913b5201a0>

In [7]: root = project.layerTreeRoot()

In [8]: root.children
Out[8]: <function QgsLayerTree.children>

In [9]: root.children()
Out[9]: 
[<QgsLayerTreeLayer: OpenStreetMap>,
 <QgsLayerTreeLayer: Mapzen Global Terrain>]

In [10]: project.crs
Out[10]: <function QgsProject.crs>

In [11]: project.crs()
Out[11]: <QgsCoordinateReferenceSystem: EPSG:3857>

@davidbrochart
Copy link
Collaborator

Just linking to the Felt QGIS plugin for inspiration, that allows to export a QGIS project to Felt from QGIS. There is a video.

@martinRenou
Copy link
Member Author

Adding another note that, QGIS files being plain xml, we may also look into reading those files in Python without using pyqgis

@martinRenou martinRenou added this to the 1.0.0 milestone Jun 19, 2024
@martinRenou
Copy link
Member Author

Closing as resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants