Created
January 31, 2025 07:41
-
-
Save mcihad/8596c25459253d1156e4d5979770b689 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from qgis.core import * | |
from qgis.gui import * | |
@qgsfunction(group='Custom', referenced_columns=[]) | |
def get_park_id(geometry): | |
layer = QgsProject.instance().mapLayersByName('Parklar')[0] # "Parklar" katmanını al | |
for feature in layer.getFeatures(): | |
if feature.geometry().intersects(geometry): # Kesişen parkı bul | |
return feature['id'] # Parkın id'sini döndür | |
return None # Kesişen park yoksa NULL döndür |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment