cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

QGIS python command in Databricks notebook

emiliec
New Contributor

Hello, 

I would like to run a qgis python script in a databricks notebook. Currently, databricks doesn't recognize the qgis package. 

For example, i'd like to run this small example : 

from qgis.core import *

# Supply path to qgis install location
QgsApplication.setPrefixPath("/path/to/qgis/installation", True)

# Create a reference to the QgsApplication. Setting the
# second argument to False disables the GUI.
qgs = QgsApplication([], False)

# Load providers
qgs.initQgis()

# Write your code here to load some layers, use processing
# algorithms, etc.

# Finally, exitQgis() is called to remove the
# provider and layer registries from memory
qgs.exitQgis()

1 REPLY 1

VZLA
Databricks Employee
Databricks Employee

QGIS is not directly usable in Scala or Spark environments as it is a standalone Geographic Information System (GIS) application, installing and using it directly within Databricks may not be straightforward due to the specific environment and dependencies required by QGIS. For geospatial analysis within a Scala/Spark context, you might want to consider using GeoSpark, GeoPandas, Shapely or another JVM-compatible geospatial library.

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now