Compare commits

..
Author SHA1 Message Date
mpeltriaux b132f0a514 Merge pull request '# Parcel fetcher improvements' (#604) from 599_Schneider_Auth_header into master
Reviewed-on: #604
2026-11-01 11:27:15 +01:00
mpeltriaux b0114024c7 # Parcel fetcher improvements
* switch from custom auth header to standard 'Authorization' bearer token header
* drops definition of custom schneider authentication header from settings
* refactors ParcelFetcher geom-shrinking code into own method for better maintainability
2026-11-01 11:26:15 +01:00
mpeltriaux 9cc095367d Merge pull request '# New API mapping on old client' (#601) from #600_Neue_Geodienste into master
Reviewed-on: #601
2026-10-31 17:08:18 +01:00
mpeltriaux af69935238 # New API mapping on old client
* updates geo service endpoints to new ones
* adds legacy mapping to map_proxy.py to ensure old mapclient receives new API data in a processable way
2026-10-31 17:06:06 +01:00
mpeltriaux 0be75749b8 Merge pull request '# Bugfix empty feature collection' (#597) from bugfix_empty_geometry_on_form into master
Reviewed-on: #597
2026-10-17 13:04:40 +02:00
mpeltriaux 717cb9e99c # Bugfix empty feature collection
* fixes a bug on empty feature collections input of SimpleGeomForm
2026-10-17 13:03:53 +02:00
7 changed files with 152 additions and 49 deletions

No files matched your search

-1
View File
@@ -31,7 +31,6 @@ GEOPORTAL_RLP_PASSWORD=CHANGE_ME
# Schneider # Schneider
SCHNEIDER_BASE_URL=https://schneider.naturschutz.rlp.de SCHNEIDER_BASE_URL=https://schneider.naturschutz.rlp.de
SCHNEIDER_AUTH_TOKEN=CHANGE_ME SCHNEIDER_AUTH_TOKEN=CHANGE_ME
SCHNEIDER_AUTH_HEADER=auth
# SSO # SSO
SSO_SERVER_BASE_URL=https://login.naturschutz.rlp.de SSO_SERVER_BASE_URL=https://login.naturschutz.rlp.de
@@ -8,5 +8,4 @@ Created on: 14.12.22
from konova.sub_settings.django_settings import env from konova.sub_settings.django_settings import env
base_url = env("SCHNEIDER_BASE_URL") base_url = env("SCHNEIDER_BASE_URL")
auth_header = env("SCHNEIDER_AUTH_HEADER")
auth_header_token = env("SCHNEIDER_AUTH_TOKEN") auth_header_token = env("SCHNEIDER_AUTH_TOKEN")
+15 -2
View File
@@ -277,10 +277,10 @@ class GeoJsonValidator:
""" """
features = self._input_geojson.get("features", []) features = self._input_geojson.get("features", [])
is_input_geojson_empty = len(self._input_geojson) == 0 is_input_geojson_empty_str = len(self._input_geojson) == 0
no_features_in_input_found = len(features) == 0 no_features_in_input_found = len(features) == 0
if not is_input_geojson_empty and no_features_in_input_found: if not is_input_geojson_empty_str and no_features_in_input_found:
# check if _input_geojson is a feature itself # check if _input_geojson is a feature itself
if self.__is_geojson_feature(): if self.__is_geojson_feature():
features = [ features = [
@@ -288,6 +288,9 @@ class GeoJsonValidator:
"geometry": self._input_geojson "geometry": self._input_geojson
} }
] ]
elif self.__is_geojson_featurecollection():
# special case if empty featurecollection received
pass
else: else:
self.__add_error("Input does not seem to be geojson") self.__add_error("Input does not seem to be geojson")
return return
@@ -372,3 +375,13 @@ class GeoJsonValidator:
has_coordinates = self._input_geojson.get("coordinates", None) is not None has_coordinates = self._input_geojson.get("coordinates", None) is not None
has_properties = self._input_geojson.get("properties", None) is not None has_properties = self._input_geojson.get("properties", None) is not None
return has_type and has_coordinates and has_properties return has_type and has_coordinates and has_properties
def __is_geojson_featurecollection(self):
""" Checks whether _input_geojson is a geojson featurecollection
Returns:
"""
is_fc_type = self._input_geojson.get("type", None) == "FeatureCollection"
has_feature_attribute = isinstance(self._input_geojson.get("features", None), list)
return is_fc_type and has_feature_attribute
+35 -20
View File
@@ -9,16 +9,14 @@ import json
from json import JSONDecodeError from json import JSONDecodeError
import requests import requests
from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSGeometry
from konova.sub_settings import schneider_settings from konova.sub_settings import schneider_settings
from konova.sub_settings.lanis_settings import DEFAULT_SRID
from konova.sub_settings.proxy_settings import PROXIES from konova.sub_settings.proxy_settings import PROXIES
class ParcelFetcher: class ParcelFetcher:
base_url = schneider_settings.base_url base_url = schneider_settings.base_url
auth_header = schneider_settings.auth_header
auth_header_token = schneider_settings.auth_header_token auth_header_token = schneider_settings.auth_header_token
geometry = None geometry = None
@@ -30,30 +28,47 @@ class ParcelFetcher:
raise AssertionError("Geometry must not be none") raise AssertionError("Geometry must not be none")
self.geometry = geometry self.geometry = geometry
# Reduce size of geometry to avoid "intersections" because of exact border matching geom = self._shrink_geometry(geometry.geom)
buffer_threshold = 0.001
geom = geometry.geom.buffer(-buffer_threshold) self.geojson = geom.geojson
if geom.area < buffer_threshold:
# Fallback for malicious geometries which are way too small and would disappear on negative buffering
geom = geometry.geom
try:
geom.transform(DEFAULT_SRID)
except gdal.GDALException as e:
raise ValueError(f"{str(e)}\nCould not transform geometry (id: {geometry.id}) to {DEFAULT_SRID}:\n {geom.geojson}")
self.geojson = geom.ewkt
self.results = [] self.results = []
def get_parcels(self, url: str = None): def _shrink_geometry(self, geometry: GEOSGeometry) -> GEOSGeometry:
post_url = url """ Shrink geometry by a minimal factor to avoid intersections with neighboring features due to
if post_url is None: exact outline match.
post_url = f"{self.base_url}/parcel/intersect/"
Args:
geometry (GEOSGeometry): geometry to shrink
Returns:
geom (GEOSGeometry): Shrinked geometry
"""
# Reduce size of geometry to avoid "intersections" because of exact border matching
buffer_threshold = 0.001
return_geom = geometry.buffer(-buffer_threshold)
if return_geom.area < buffer_threshold:
# Fallback for malicious geometries which are way too small and would disappear on negative buffering
return_geom = geometry
return return_geom
def get_parcels(self, url: str = None) -> list:
""" Perform parcel fetching
Args:
url (None|str): (optional) Provide an alternative url for fetching parcels. Default will be used if None
Returns:
results (list): List of fetched parcels
"""
if url is None:
url = f"{self.base_url}/parcel/intersect/"
response = requests.post( response = requests.post(
url=post_url, url=url,
proxies=PROXIES, proxies=PROXIES,
data=self.geojson, data=self.geojson,
headers={ headers={
self.auth_header: self.auth_header_token "Authorization": f"Bearer {self.auth_header_token}"
} }
) )
+79 -2
View File
@@ -11,6 +11,7 @@ from json import JSONDecodeError
import requests import requests
import urllib3.util import urllib3.util
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.contrib.gis import geos
from django.http import JsonResponse, HttpRequest, HttpResponse from django.http import JsonResponse, HttpRequest, HttpResponse
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
from django.utils.http import urlencode from django.utils.http import urlencode
@@ -18,7 +19,7 @@ from django.views import View
from requests.auth import HTTPDigestAuth from requests.auth import HTTPDigestAuth
from konova.sub_settings.lanis_settings import MAP_PROXY_HOST_WHITELIST from konova.sub_settings.lanis_settings import MAP_PROXY_HOST_WHITELIST, DEFAULT_SRID_RLP
from konova.sub_settings.proxy_settings import PROXIES, GEOPORTAL_RLP_USER, GEOPORTAL_RLP_PASSWORD from konova.sub_settings.proxy_settings import PROXIES, GEOPORTAL_RLP_USER, GEOPORTAL_RLP_PASSWORD
@@ -76,7 +77,83 @@ class ClientProxyParcelSearch(BaseClientProxyView):
raise PermissionError(f"Proxied url '{url}' is not allowed!") raise PermissionError(f"Proxied url '{url}' is not allowed!")
content, response_code = self.perform_url_call(url) content, response_code = self.perform_url_call(url)
return HttpResponse(content) content = json.loads(content)
try:
content = self.__process_response_into_old_client_format(content, url)
except KeyError:
pass
return JsonResponse(content)
def __process_response_into_old_client_format(self, content: dict, url: str) -> dict:
""" Returns the response in a structure which is compatible with the old netgis mapclient.
THIS METHOD IS TEMPORARILY USED AND WILL NOT BE NEEDED ANYMORE, ONCE THE MAPCLIENT IS CAPABLE OF PROCESSING
THE NEW API'S STRUCTURE!
Args:
content (dict): The api response body
url (str): The called api url
Returns:
backwards_compatible_content (dict): The restructured content
"""
def process_parcel_response_into_old_client_format(content: dict):
""" Processes parcel responses in a way that the old client can interpret them
Args:
content (dict): The new API response content
Returns:
backward_compatible_content (dict): The old client input content
"""
backward_compatible_content = {
"count": content["count"],
"data": [
{
"fln": elem["flur"],
"fsn_zae": elem["zaehler"],
"fsn_nen": elem["nenner"],
"fsk": elem["kennzeichen"],
"flaeche": elem["flaeche"],
"geometry": geos.fromstr(json.dumps(elem["geometry"])).transform(DEFAULT_SRID_RLP,
clone=True).wkt,
}
for elem in content["results"]
]
}
return backward_compatible_content
def process_gemarkung_response_into_old_client_format(content: dict):
""" Processes gemarkung responses in a way that the old client can interpret them
Args:
content (dict): The new API response content
Returns:
backward_compatible_content (dict): The old client input content
"""
content = content["results"]
backward_compatible_content = {
"data": [{"gmk_name": element["name"], "gmk_gmn": element["id"]} for element in content]
}
return backward_compatible_content
backwards_compatible_handling = {
"flurstueck_search.php": process_parcel_response_into_old_client_format,
"gemarkung_search.php": process_gemarkung_response_into_old_client_format,
}
backwards_compatible_handling_method = None
for key, method in backwards_compatible_handling.items():
if key in url:
backwards_compatible_handling_method = method
break
if backwards_compatible_handling_method is not None:
content = backwards_compatible_handling_method(content)
return content
class ClientProxyParcelWFS(BaseClientProxyView): class ClientProxyParcelWFS(BaseClientProxyView):
+22 -22
View File
@@ -62,33 +62,33 @@
{ "id": "dtk_farbe", "folder": "bg", "type": "WMS", "order": -1, "title": "DTK5 farbig", "attribution": "LVermGeo", "url": "https://geo4.service24.rlp.de/wms/dtk5_rp.fcgi?", "name": "rp_dtk5", "active": false }, { "id": "dtk_farbe", "folder": "bg", "type": "WMS", "order": -1, "title": "DTK5 farbig", "attribution": "LVermGeo", "url": "https://geo4.service24.rlp.de/wms/dtk5_rp.fcgi?", "name": "rp_dtk5", "active": false },
{ "id": "dtk_grau", "folder": "bg", "type": "WMS", "order": -1, "title": "DTK5 grau", "attribution": "LVermGeo", "url": "https://geo4.service24.rlp.de/wms/dtk5_rp.fcgi?", "name": "rp_dtk5_grau", "active": false }, { "id": "dtk_grau", "folder": "bg", "type": "WMS", "order": -1, "title": "DTK5 grau", "attribution": "LVermGeo", "url": "https://geo4.service24.rlp.de/wms/dtk5_rp.fcgi?", "name": "rp_dtk5_grau", "active": false },
{ "id": "kom", "folder": "kom", "type": "WMS", "title": "KOM", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=kom_recorded&", "name": "kom_recorded" }, { "id": "kom", "folder": "kom", "type": "WMS", "title": "KOM", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=kom_recorded&", "name": "kom_recorded" },
{ "id": "kom_rec", "folder": "kom", "type": "WMS", "title": "KOM - In Bearbeitung", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=kom_unrecorded&", "name": "kom_unrecorded" }, { "id": "kom_rec", "folder": "kom", "type": "WMS", "title": "KOM - In Bearbeitung", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=kom_unrecorded&", "name": "kom_unrecorded" },
{ "id": "kom_rec_unfinished", "folder": "kom", "type": "WMS", "title": "KOM - Unvollständige Altfälle", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=kom_unrecorded_old_entries&", "name": "kom_unrecorded_old_entries" }, { "id": "kom_rec_unfinished", "folder": "kom", "type": "WMS", "title": "KOM - Unvollständige Altfälle", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=kom_unrecorded_old_entries&", "name": "kom_unrecorded_old_entries" },
{ "id": "eiv", "folder": "eiv", "type": "WMS", "title": "EIV", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=eiv_recorded&", "name": "eiv_recorded" }, { "id": "eiv", "folder": "eiv", "type": "WMS", "title": "EIV", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=eiv_recorded&", "name": "eiv_recorded" },
{ "id": "eiv_rec", "folder": "eiv", "type": "WMS", "title": "EIV - In Bearbeitung", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=eiv_unrecorded&", "name": "eiv_unrecorded" }, { "id": "eiv_rec", "folder": "eiv", "type": "WMS", "title": "EIV - In Bearbeitung", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=eiv_unrecorded&", "name": "eiv_unrecorded" },
{ "id": "eiv_rec_unfinished", "folder": "eiv", "type": "WMS", "title": "EIV - Unvollständige Altfälle", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=eiv_unrecorded_old_entries&", "name": "eiv_unrecorded_old_entries" }, { "id": "eiv_rec_unfinished", "folder": "eiv", "type": "WMS", "title": "EIV - Unvollständige Altfälle", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=eiv_unrecorded_old_entries&", "name": "eiv_unrecorded_old_entries" },
{ "id": "oek", "folder": "oek", "type": "WMS", "title": "OEK", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=oek_recorded&", "name": "oek_recorded" }, { "id": "oek", "folder": "oek", "type": "WMS", "title": "OEK", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=oek_recorded&", "name": "oek_recorded" },
{ "id": "oek_rec", "folder": "oek", "type": "WMS", "title": "OEK - In Bearbeitung", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=oek_unrecorded&", "name": "oek_unrecorded" }, { "id": "oek_rec", "folder": "oek", "type": "WMS", "title": "OEK - In Bearbeitung", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=oek_unrecorded&", "name": "oek_unrecorded" },
{ "id": "ema", "folder": "ema", "type": "WMS", "title": "EMA", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=ema_recorded&", "name": "ema_recorded" }, { "id": "ema", "folder": "ema", "type": "WMS", "title": "EMA", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=ema_recorded&", "name": "ema_recorded" },
{ "id": "ema_rec", "folder": "ema", "type": "WMS", "title": "EMA - In Bearbeitung", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=ema_unrecorded&", "name": "ema_unrecorded" }, { "id": "ema_rec", "folder": "ema", "type": "WMS", "title": "EMA - In Bearbeitung", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=ema_unrecorded&", "name": "ema_unrecorded" },
{ "id": "mae", "folder": "mae", "type": "WMS", "title": "MAE", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=mae&", "name": "mae" }, { "id": "mae", "folder": "mae", "type": "WMS", "title": "MAE", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=mae&", "name": "mae" },
{ "id": "nsg", "folder": "schutzgebiet", "type": "WMS", "title": "Naturschutzgebiete", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=naturschutzgebiet&", "name": "naturschutzgebiet" }, { "id": "nsg", "folder": "schutzgebiet", "type": "WMS", "title": "Naturschutzgebiete", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=naturschutzgebiet&", "name": "naturschutzgebiet" },
{ "id": "npz", "folder": "schutzgebiet", "type": "WMS", "title": "Naturparkzonen", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=naturparkzonen&", "name": "naturparkzonen" }, { "id": "npz", "folder": "schutzgebiet", "type": "WMS", "title": "Naturparkzonen", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=naturparkzone&", "name": "naturparkzone" },
{ "id": "lsg", "folder": "schutzgebiet", "type": "WMS", "title": "Landschaftsschutzgebiete", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=landschaftsschutzgebiet&", "name": "landschaftsschutzgebiet" }, { "id": "lsg", "folder": "schutzgebiet", "type": "WMS", "title": "Landschaftsschutzgebiete", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=landschaftsschutzgebiet&", "name": "landschaftsschutzgebiet" },
{ "id": "vsg", "folder": "schutzgebiet", "type": "WMS", "title": "Vogelschutzgebiete", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=vogelschutzgebiet&", "name": "vogelschutzgebiet" }, { "id": "vsg", "folder": "schutzgebiet", "type": "WMS", "title": "Vogelschutzgebiete", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=vogelschutzgebiet&", "name": "vogelschutzgebiet" },
{ "id": "ffh", "folder": "schutzgebiet", "type": "WMS", "title": "FFH Gebiete", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=ffh&", "name": "ffh" }, { "id": "ffh", "folder": "schutzgebiet", "type": "WMS", "title": "FFH Gebiete", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=ffhgebiet&", "name": "ffhgebiet" },
{"id": "ntpz", "folder": "nationalpark", "type": "WMS", "title": "Nationalpark Zonen", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=nationalpark_zonen&", "name": "nationalpark_zonen" }, {"id": "ntpz", "folder": "nationalpark", "type": "WMS", "title": "Nationalpark Zonen", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=nationalparkzonen&", "name": "nationalparkzonen" },
{"id": "ntpg", "folder": "nationalpark", "type": "WMS", "title": "Nationalpark Grenzen", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=nationalpark_grenze&", "name": "nationalpark_grenze" }, {"id": "ntpg", "folder": "nationalpark", "type": "WMS", "title": "Nationalpark Grenzen", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/2d/mapserver/map.php?layers=nationalpark&", "name": "nationalpark" },
{ "id": "natraum_g", "folder": "naturraum", "type": "WMS", "title": "Naturräume Grenzen", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=natraum_lkompvo_grenzen&", "name": "natraum_lkompvo_grenzen" }, { "id": "natraum_g", "folder": "naturraum", "type": "WMS", "title": "Naturräume Grenzen", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/apps/service/wms_getmap.php?mapfile=natraum_lkompvo_grenzen&", "name": "natraum_lkompvo_grenzen" },
{ "id": "natraum_f", "folder": "naturraum", "type": "WMS", "title": "Naturräume Flächen", "url": "https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_ogc/wms_getmap.php?mapfile=natraum_lkompvo&", "name": "natraum_lkompvo" }, { "id": "natraum_f", "folder": "naturraum", "type": "WMS", "title": "Naturräume Flächen", "url": "https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/apps/service/wms_getmap.php?mapfile=natraum_lkompvo&", "name": "natraum_lkompvo" },
{ "id": "lagebezeichnung", "folder": "alkis", "type": "WMS", "title": "Lagebezeichnungen", "url": "https://geo5.service24.rlp.de/wms/liegenschaften_rp.fcgi?", "name": "Lagebezeichnungen" }, { "id": "lagebezeichnung", "folder": "alkis", "type": "WMS", "title": "Lagebezeichnungen", "url": "https://geo5.service24.rlp.de/wms/liegenschaften_rp.fcgi?", "name": "Lagebezeichnungen" },
{ "id": "flurstueck_wms", "folder": "alkis", "type": "WMS", "title": "Flurstücke (WMS)", "url": "https://geo5.service24.rlp.de/wms/liegenschaften_rp.fcgi?", "name": "Flurstueck", "active": true}, { "id": "flurstueck_wms", "folder": "alkis", "type": "WMS", "title": "Flurstücke (WMS)", "url": "https://geo5.service24.rlp.de/wms/liegenschaften_rp.fcgi?", "name": "Flurstueck", "active": true},
@@ -129,8 +129,8 @@
"searchparcel": "searchparcel":
{ {
"open": false, "open": false,
"name_url": "/client/proxy?https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_alkis/gem_search.php?placename={q}", "name_url": "/client/proxy?https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/module/flurstuecksuche/api/gemarkung_search.php?q={q}",
"parcel_url": "/client/proxy?https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_alkis/flur_search.php?gmk_gmn={district}&fln={field}&fsn_zae={parcelA}&fsn_nen={parcelB}&export=json", "parcel_url": "/client/proxy?https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/module/flurstuecksuche/api/flurstueck_search.php?gemarkung={district}&flur={field}&zaehler={parcelA}&nenner={parcelB}&export=json",
"districts_service": "districts_service":
{ {
"type": "WFS", "type": "WFS",
+1 -1
View File
@@ -400,7 +400,7 @@ netgis.Search.prototype.clearResults=function(){this.results.innerHTML="";this.m
netgis.Search.prototype.showClearButton=function(a){!1===a?(this.button.classList.remove("netgis-hide"),this.closer.classList.add("netgis-hide")):(this.button.classList.add("netgis-hide"),this.closer.classList.remove("netgis-hide"))};netgis.Search.prototype.onInputKeyDown=function(a){if(13===a.keyCode)return a.preventDefault(),!1}; netgis.Search.prototype.showClearButton=function(a){!1===a?(this.button.classList.remove("netgis-hide"),this.closer.classList.add("netgis-hide")):(this.button.classList.add("netgis-hide"),this.closer.classList.remove("netgis-hide"))};netgis.Search.prototype.onInputKeyDown=function(a){if(13===a.keyCode)return a.preventDefault(),!1};
netgis.Search.prototype.onInputKeyUp=function(a){switch(a.keyCode){case 13:if(this.autocomplete)a=this.results.getElementsByTagName("button"),0<a.length&&a[0].click();else this.onInputTimeout();break;case 27:this.clearAll();break;default:if(this.autocomplete)this.onInputChange()}};netgis.Search.prototype.onInputChange=function(a){this.timeout&&window.clearTimeout(this.timeout);this.timeout=window.setTimeout(this.onInputTimeout.bind(this),this.debounce)}; netgis.Search.prototype.onInputKeyUp=function(a){switch(a.keyCode){case 13:if(this.autocomplete)a=this.results.getElementsByTagName("button"),0<a.length&&a[0].click();else this.onInputTimeout();break;case 27:this.clearAll();break;default:if(this.autocomplete)this.onInputChange()}};netgis.Search.prototype.onInputChange=function(a){this.timeout&&window.clearTimeout(this.timeout);this.timeout=window.setTimeout(this.onInputTimeout.bind(this),this.debounce)};
netgis.Search.prototype.onInputTimeout=function(){var a=this.input.value;a=a.trim();0<a.length?this.requestSearch(a):this.clearAll()};netgis.Search.prototype.onButtonClick=function(a){this.input.focus()};netgis.Search.prototype.onCloserClick=function(a){this.clearAll();this.input.focus()};netgis.Search.prototype.onResultClick=function(a){a=a.currentTarget;var b=a.getAttribute("data-result");netgis.util.invoke(a,netgis.Events.SEARCH_SELECT,{item:a,data:b})};netgis=netgis||{};netgis.SearchParcel=function(a){this.config=a;this.districtsLayerID="searchparcel_districts";this.fieldsLayerID="searchparcel_fields";this.parcelsLayerID="searchparcel_parcels";this.selected={};this.initElements();this.initEvents();this.initConfig(a)}; netgis.Search.prototype.onInputTimeout=function(){var a=this.input.value;a=a.trim();0<a.length?this.requestSearch(a):this.clearAll()};netgis.Search.prototype.onButtonClick=function(a){this.input.focus()};netgis.Search.prototype.onCloserClick=function(a){this.clearAll();this.input.focus()};netgis.Search.prototype.onResultClick=function(a){a=a.currentTarget;var b=a.getAttribute("data-result");netgis.util.invoke(a,netgis.Events.SEARCH_SELECT,{item:a,data:b})};netgis=netgis||{};netgis.SearchParcel=function(a){this.config=a;this.districtsLayerID="searchparcel_districts";this.fieldsLayerID="searchparcel_fields";this.parcelsLayerID="searchparcel_parcels";this.selected={};this.initElements();this.initEvents();this.initConfig(a)};
netgis.SearchParcel.Config={open:!1,name_url:"./proxy.php?https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_alkis/gem_search.php?placename={q}",parcel_url:"./proxy.php?https://geodaten.naturschutz.rlp.de/kartendienste_naturschutz/mod_alkis/flur_search.php?gmk_gmn={district}&fln={field}&fsn_zae={parcelA}&fsn_nen={parcelB}&export=json",districts_service:{type:"WFS",url:"http://geo5.service24.rlp.de/wfs/verwaltungsgrenzen_rp.fcgi?",name:"vermkv:gemarkungen_rlp",format:"application/json; subtype=geojson", netgis.SearchParcel.Config={open:!1,name_url:"./proxy.php?https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/module/flurstuecksuche/api/gemarkung_search.php?q={q}",parcel_url:"./proxy.php?https://geoportal.naturschutz.rlp.de/kartendienst_naturschutz/module/flurstuecksuche/api/flurstueck_search.php?gemarkung={district}&flur={field}&zaehler={parcelA}&nenner={parcelB}&export=json",districts_service:{type:"WFS",url:"http://geo5.service24.rlp.de/wfs/verwaltungsgrenzen_rp.fcgi?",name:"vermkv:gemarkungen_rlp",format:"application/json; subtype=geojson",
min_zoom:12},fields_service:{url:"http://geo5.service24.rlp.de/wfs/verwaltungsgrenzen_rp.fcgi?",name:"vermkv:fluren_rlp",filter_property:"gmkgnr"}}; min_zoom:12},fields_service:{url:"http://geo5.service24.rlp.de/wfs/verwaltungsgrenzen_rp.fcgi?",name:"vermkv:fluren_rlp",filter_property:"gmkgnr"}};
netgis.SearchParcel.prototype.initElements=function(){this.panel=new netgis.Panel("Flurst\u00fccks-Suche");this.panel.container.style.minWidth="92mm";this.panel.container.addEventListener(netgis.Events.PANEL_TOGGLE,this.onPanelToggle.bind(this));this.container=document.createElement("section");this.container.className="netgis-search-parcel";this.panel.content.appendChild(this.container);this.popup=new netgis.Popup;this.popup.setHeader("Flurst\u00fcck");var a=document.createElement("section");this.top= netgis.SearchParcel.prototype.initElements=function(){this.panel=new netgis.Panel("Flurst\u00fccks-Suche");this.panel.container.style.minWidth="92mm";this.panel.container.addEventListener(netgis.Events.PANEL_TOGGLE,this.onPanelToggle.bind(this));this.container=document.createElement("section");this.container.className="netgis-search-parcel";this.panel.content.appendChild(this.container);this.popup=new netgis.Popup;this.popup.setHeader("Flurst\u00fcck");var a=document.createElement("section");this.top=
a;this.container.appendChild(a);var b=this.createInput("Gemarkungsname:");b.style.position="relative";a.appendChild(b);this.nameInput=b.children[0];this.nameInput.setAttribute("title","ENTER: Ausw\u00e4hlen, ESCAPE: Zur\u00fccksetzen");this.nameInput.addEventListener("keyup",this.onInputNameKey.bind(this));this.nameLoader=document.createElement("div");this.nameLoader.className="netgis-loader netgis-text-primary netgis-hide";this.nameLoader.innerHTML="<i class='fas fa-spinner'></i>";b.appendChild(this.nameLoader); a;this.container.appendChild(a);var b=this.createInput("Gemarkungsname:");b.style.position="relative";a.appendChild(b);this.nameInput=b.children[0];this.nameInput.setAttribute("title","ENTER: Ausw\u00e4hlen, ESCAPE: Zur\u00fccksetzen");this.nameInput.addEventListener("keyup",this.onInputNameKey.bind(this));this.nameLoader=document.createElement("div");this.nameLoader.className="netgis-loader netgis-text-primary netgis-hide";this.nameLoader.innerHTML="<i class='fas fa-spinner'></i>";b.appendChild(this.nameLoader);