Skip to content

Commit 33d0c1c

Browse files
committed
update credits
1 parent 0b798a7 commit 33d0c1c

File tree

9 files changed

+58
-30
lines changed

9 files changed

+58
-30
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# -------------------
66
# begin : 2023-09-11
77
# git sha : $Format:%H$
8-
# copyright : (C) 2023 by cuprit gbr
9-
# email : toni.schoenbuchner@cuprit.net
8+
# copyright : (C) 2023 by csgis gbr
9+
# email : toni.schoenbuchner@csgis.net
1010
# ***************************************************************************/
1111
#
1212
#/***************************************************************************

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Everything you need to know:
44

5-
**Docs:** http://kgr-finder-docs.cuprit.net/
5+
**Docs:** http://kgr-finder-docs.csgis.net/
66

77

88
**Lisence:** https://www.gnu.org/licenses/gpl-3.0.en.html

data_apis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def getAttributeMappings(self):
157157

158158
def extractElements(self, data):
159159
if not data:
160-
return None
160+
return []
161161
# Extract elements from the Overpass API response
162162
return data.get("elements", [])
163163

@@ -264,7 +264,7 @@ def getAttributeMappings(self):
264264

265265
def extractElements(self, data):
266266
if not data:
267-
return None
267+
return []
268268
# Extract elements from the Overpass API response
269269
return data.get("result", [])
270270

find_osm_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
-------------------
99
begin : 2023-09-11
1010
git sha : $Format:%H$
11-
copyright : (C) 2023 by cuprit gbr
12-
email : toni.schoenbuchner@cuprit.net
11+
copyright : (C) 2023 by csgis gbr
12+
email : toni.schoenbuchner@csgis.net
1313
***************************************************************************/
1414
1515
/***************************************************************************

find_osm_data_dockwidget.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
-------------------
99
begin : 2023-09-11
1010
git sha : $Format:%H$
11-
copyright : (C) 2023 by cuprit gbr
12-
email : toni.schoenbuchner@cuprit.net
11+
copyright : (C) 2023 by csgis gbr
12+
email : toni.schoenbuchner@csgis.net
1313
***************************************************************************/
1414
1515
/***************************************************************************

kgr_finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
A QGIS plugin for detecting cultura places
66
-------------------
77
begin : 2023-09-11
8-
copyright : (C) 2023 by cuprit gbr
9-
email : toni.schoenbuchner@cuprit.net
8+
copyright : (C) 2023 by csgis gbr
9+
email : toni.schoenbuchner@csgis.net
1010
***************************************************************************/
1111
1212
/***************************************************************************

metadata.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ name=KGR Finder
77
qgisMinimumVersion=3.0
88
description=This QGIS Plugin allows Users to currently download data from OpenStreetMap and/or iDAI.Gazetteer either by drawing a rectangle or by selecting a polygon layer.
99
version=0.1
10-
author=cuprit GbR.
11-
email=toni.schoenbuchner@cuprit.net
10+
author=csgis GbR.
11+
email=toni.schoenbuchner@csgis.net
1212

1313
about=Find cultural heritage from different sources like OpenStreetMap, iDAI.Gazetteer etc.
1414

15-
tracker=https://github.com/cuprit-gbr/KGRFinder-docs/issues
16-
repository=https://github.com/cuprit-gbr/KGRFinder-docs
15+
tracker=https://github.com/csgis-gbr/KGRFinder-docs/issues
16+
repository=https://github.com/csgis-gbr/KGRFinder-docs
1717
# End of mandatory metadata
1818

1919
# Recommended items:
@@ -25,7 +25,7 @@ hasProcessingProvider=no
2525
# Tags are comma separated with spaces allowed
2626
tags=python,osm,iDAI.Gazetteer,heritage,cultural,
2727

28-
homepage=https://kgr-finder-docs.cuprit.net/
28+
homepage=https://kgr-finder-docs.csgis.net/
2929
category=Plugins
3030
icon=assets/greif.png
3131
# experimental flag

pb_tool.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
# Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
66
# -------------------
77
# begin : 2023-09-11
8-
# copyright : (C) 2023 by cuprit gbr
9-
# email : toni.schoenbuchner@cuprit.net
8+
# copyright : (C) 2023 by csgis gbr
9+
# email : toni.schoenbuchner@csgis.net
1010
# ***************************************************************************/
1111
#
1212
#/***************************************************************************

tools.py

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,31 @@ def __init__(self, canvas):
5151
self.api_strategies.append(iDAIGazetteerAPIQueryStrategy())
5252
Log.log_debug(str(self.api_strategies))
5353

54-
def checkAreaSize(self, x_min, y_min, x_max, y_max, threshold=500):
55-
area = (x_max - x_min) * (y_max - y_min)
54+
def checkAreaSize(self, x_min, y_min, x_max, y_max, threshold=1000000000):
55+
area_sqm = (x_max - x_min) * (y_max - y_min)
5656

57-
if area > threshold:
57+
# Conversion factors
58+
sqm_to_km2 = 1 / 1_000_000
59+
sqm_to_ha = 1 / 10_000
60+
61+
# Convert area to km² and ha
62+
area_km2 = area_sqm * sqm_to_km2
63+
area_ha = area_sqm * sqm_to_ha
64+
65+
# Convert threshold to km² and ha
66+
threshold_km2 = threshold * sqm_to_km2
67+
threshold_ha = threshold * sqm_to_ha
68+
69+
if area_sqm > threshold:
5870
reply = QMessageBox.question(
5971
iface.mainWindow(),
60-
"Large Polygon Detected",
61-
f"The selected area is {area:.2f} square meters, which is larger than {threshold} square meters. "
62-
"This may result in a long API request. Do you want to continue?",
72+
"WARNING: Large Polygon Detected",
73+
f"WARNING: Large Polygon Detected \n\n"
74+
f"The selected area is {area_km2:.2f} km², "
75+
f"which exceeds the threshold of {threshold_km2:.2f} km².\n\n"
76+
"Proceeding with this selection may result in a lengthy API request, potentially causing delays, "
77+
"request failures, or QGIS crashing.\n\n"
78+
"Do you still want to continue?",
6379
QMessageBox.Yes | QMessageBox.No,
6480
QMessageBox.No,
6581
)
@@ -69,6 +85,7 @@ def checkAreaSize(self, x_min, y_min, x_max, y_max, threshold=500):
6985

7086
return True
7187

88+
7289
def addFeature(self, feature):
7390
self.polygons_features_must_be_within.append(feature)
7491

@@ -176,12 +193,23 @@ def addFeaturesByStrategy(
176193
):
177194
polygon_layer.dataProvider().addFeature(feature)
178195

179-
iface.messageBar().pushMessage(
180-
"KGR",
181-
"Data from " + strategy.source + " loaded",
182-
level=Qgis.Success,
183-
duration=3,
184-
)
196+
print("here")
197+
print(elements)
198+
199+
if len(elements) == 0:
200+
iface.messageBar().pushMessage(
201+
"KGR",
202+
"No Data from " + strategy.source + " received",
203+
level=Qgis.Warning,
204+
duration=3,
205+
)
206+
else:
207+
iface.messageBar().pushMessage(
208+
"KGR",
209+
"Data from " + strategy.source + " loaded",
210+
level=Qgis.Success,
211+
duration=3,
212+
)
185213

186214
def createFeature(self, element, fields, attribute_mappings, strategy):
187215
geometry_type = strategy.getGeometryType(element)

0 commit comments

Comments
 (0)