Polishing (#9)
* colors and materials * traverse for colors * fix multipolygons in 3d * prioritize attributes by default, less geometry divisions * fix multipolygons * split polygons in leaflet * ensure speckleURL argument * avoid multiple loops * URL exceptions handling * add bbox per feature * leaflet controls to the right * html syntax
This commit is contained in:
@@ -574,61 +574,6 @@ def get_collection_items(
|
||||
if isinstance(url_saved_as_data, str):
|
||||
url_props = url_saved_as_data.lower().split("&")
|
||||
|
||||
content['missing_url'] = content['missing_url_href'] = ""
|
||||
content['requested_data_type'] = "polygons (default)"
|
||||
content['preserve_attributes'] = "false (default)"
|
||||
content['speckle_url'] = content['speckle_project_url'] = content['crs_authid'] = content['lat'] = content['lon'] = content['north_degrees'] = content['limit'] = "-"
|
||||
crsauthid = False
|
||||
for item in url_props:
|
||||
# if CRS authid is found, rest will be ignored
|
||||
if "speckleurl=" in item:
|
||||
content['speckle_url'] = item.split("speckleurl=")[1]
|
||||
if content['speckle_url'][-1] == "/":
|
||||
content['speckle_url'] = content['speckle_url'][:-1]
|
||||
content['speckle_project_url'] = content['speckle_url'].split("/models")[0]
|
||||
elif "datatype=" in item:
|
||||
content['requested_data_type'] = item.split("datatype=")[1]
|
||||
if content['requested_data_type'] not in ["points", "lines", "polygons", "projectcomments"]:
|
||||
content['requested_data_type'] = "polygons (default)"
|
||||
elif "preserveattributes=" in item:
|
||||
content['preserve_attributes'] = item.split("preserveattributes=")[1]
|
||||
if content['preserve_attributes'] not in ["true", "false"]:
|
||||
content['preserve_attributes'] = "false (default)"
|
||||
elif "crsauthid=" in item:
|
||||
content['crs_authid'] = item.split("crsauthid=")[1]
|
||||
crsauthid = True
|
||||
elif "lat=" in item:
|
||||
try:
|
||||
content['lat'] = float(item.split("lat=")[1])
|
||||
except:
|
||||
content['lat'] = f"Invalid input, must be numeric: {item.split('lat=')[1]}"
|
||||
elif "lon=" in item:
|
||||
try:
|
||||
content['lon'] = float(item.split("lon=")[1])
|
||||
except:
|
||||
content['lon'] = f"Invalid input, must be numeric: {item.split('lon=')[1]}"
|
||||
elif "northdegrees=" in item:
|
||||
try:
|
||||
content['north_degrees'] = float(item.split("northdegrees=")[1])
|
||||
except:
|
||||
content['north_degrees'] = f"Invalid input, must be numeric: {item.split('northdegrees=')[1]}"
|
||||
elif "limit=" in item:
|
||||
try:
|
||||
content['limit'] = float(item.split("limit=")[1])
|
||||
except:
|
||||
content['limit'] = f"Invalid input, must be integer: {item.split('limit=')[1]}"
|
||||
|
||||
if content['speckle_url'] == "-":
|
||||
content['missing_url'] = "true"
|
||||
|
||||
if crsauthid:
|
||||
content['lat'] += " (not applied)"
|
||||
content['lon'] += " (not applied)"
|
||||
content['north_degrees'] += " (not applied)"
|
||||
|
||||
if content['limit'] == "-":
|
||||
content['limit'] = f"{api.config['server']['limit']} (default)"
|
||||
|
||||
# Set response language to requested provider locale
|
||||
# (if it supports language) and/or otherwise the requested pygeoapi
|
||||
# locale (or fallback default locale)
|
||||
|
||||
Reference in New Issue
Block a user