Skip to content

Commit

Permalink
Fixed problem showing temporal slider bars with activated interface t…
Browse files Browse the repository at this point in the history
…heme "Night Mapping"

Removed unavailable download products
  • Loading branch information
icgcaadell committed Sep 9, 2024
1 parent e847a80 commit 70e5e95
Show file tree
Hide file tree
Showing 10 changed files with 613 additions and 559 deletions.
551 changes: 285 additions & 266 deletions i18n/openicgc_ca.ts

Large diffs are not rendered by default.

551 changes: 285 additions & 266 deletions i18n/openicgc_es.ts

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ email=qgis.openicgc@icgc.cat

qgisMinimumVersion=2.99
qgisMaximumVersion=3.99
version=1.1.20
changelog=v1.1.20 (2024-09-02)
version=1.1.21
changelog=V1.1.21 (2024-09-09)
- Fixed problem showing temporal slider bars with activated interface theme "Night Mapping"
- Removed unavailable download products

v1.1.20 (2024-09-02)
- Added current orthophoto (color, irc and gray) layers
- Updated geological map 250.000 and added new download formats
- Fixed problem showing photograms with undefined GSD value
Expand Down
12 changes: 12 additions & 0 deletions openicgc.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,19 @@ def initGui(self, check_qgis_updates=True, check_icgc_updates=False):
lambda:self.layers.add_wms_layer(self.tr("Andorra orthophoto 1:5,000 2003"), "http://www.ideandorra.ad/Serveis/wmsorto2003/wms", ["Orto5000_2003"], [], "image/png", 27573, '', self.backgroup_map_group_name, only_one_map_on_group=False, set_current=True),
QIcon(":/lib/qlib3/base/images/andorra_orto2003.png")),
]),
(self.tr("France"), None, QIcon(":/lib/qlib3/base/images/france_topo.png"), [
(self.tr("France topographic"),
lambda:self.layers.add_wms_layer(self.tr("France topographic"), "http://mapsref.brgm.fr/wxs/refcom-brgm/refign", ["FONDS_SCAN"], [], "image/png", 23031, '', self.backgroup_map_group_name, only_one_map_on_group=False, set_current=True),
QIcon(":/lib/qlib3/base/images/france_topo.png")),
"---",
(self.tr("France orthophoto 20cm"),
lambda:self.layers.add_wms_layer(self.tr("France orthophoto 20cm"), "https://data.geopf.fr/annexes/ressources/wms-r/ortho.xml", ["HR.ORTHOIMAGERY.ORTHOPHOTOS"], ["normal"], "image/png", 23031, '', self.backgroup_map_group_name, only_one_map_on_group=False, set_current=True, ignore_get_map_url=False),
QIcon(":/lib/qlib3/base/images/france_ortho.png")),
]),
(self.tr("World"), None, QIcon(":/lib/qlib3/base/images/world.png"), [
(self.tr("OpenStreetMap"),
lambda:self.layers.add_wms_layer(self.tr("OpenStreetMap"), "http://ows.terrestris.de/osm/service", ["OSM-WMS"], [], "image/png", 4326, '', self.backgroup_map_group_name, only_one_map_on_group=False, set_current=True),
QIcon(":/lib/qlib3/base/images/world.png")),
(self.tr("NASA blue marble"),
lambda:self.layers.add_wms_layer(self.tr("NASA blue marble"), "http://geoserver.webservice-energy.org/geoserver/ows", ["gn:bluemarble-2048"], [], "image/png", 4326, '', self.backgroup_map_group_name, only_one_map_on_group=False, set_current=True),
QIcon(":/lib/qlib3/base/images/world.png")),
Expand Down
Binary file added qlib3/base/images/france_ortho.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added qlib3/base/images/france_topo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 8 additions & 6 deletions qlib3/base/pluginbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -4036,7 +4036,7 @@ def get_wms_t_time_series(self, url, layer_id, ts_regex=None, version="1.1.1", t

return time_series_list, default_time

def add_wms_layer(self, layer_name, url, layers_list, styles_list, image_format, epsg=None, extra_tags="", group_name="", group_pos=None, only_one_map_on_group=False, only_one_visible_map_on_group=True, collapsed=True, visible=True, transparency=None, saturation=None, set_current=False, resampling_bilinear=False, resampling_cubic=False):
def add_wms_layer(self, layer_name, url, layers_list, styles_list, image_format, epsg=None, extra_tags="", group_name="", group_pos=None, only_one_map_on_group=False, only_one_visible_map_on_group=True, collapsed=True, visible=True, transparency=None, saturation=None, set_current=False, resampling_bilinear=False, resampling_cubic=False, ignore_get_map_url=True):
""" Afegeix una capa a partir de la URL base, una llista de capes WMS, una llista d'estils i un format d'imatge.
Retorna la capa.
Opcionalment es pot especificar:
Expand All @@ -4061,10 +4061,10 @@ def add_wms_layer(self, layer_name, url, layers_list, styles_list, image_format,
- collapsed: Indicates whether we want to load the layer with collapsed legend
- visible: Indicates whether we want to load the layer by leaving it visible or not
"""
uri = self.generate_wms_layer_uri(url, layers_list, styles_list, image_format, epsg, extra_tags)
uri = self.generate_wms_layer_uri(url, layers_list, styles_list, image_format, epsg, extra_tags, ignore_get_map_url)
return self.add_raster_uri_layer(layer_name, uri, "wms", group_name, group_pos, only_one_map_on_group, only_one_visible_map_on_group, collapsed, visible, transparency, saturation, set_current, resampling_bilinear, resampling_cubic)

def generate_wms_layer_uri(self, url, layers_list, styles_list, image_format, epsg=None, extra_tags=""):
def generate_wms_layer_uri(self, url, layers_list, styles_list, image_format, epsg=None, extra_tags="", ignore_get_map_url=True):
""" Retorna el string uri a partir dels paràmetres WMS
---
Return WMS uri string from WMS paràmeters
Expand All @@ -4084,18 +4084,20 @@ def generate_wms_layer_uri(self, url, layers_list, styles_list, image_format, ep
uri = "url=%s&crs=EPSG:%s&format=%s&styles=%s&layers=%s" % (url, epsg, image_format, "&styles=".join(styles_list), "&layers=".join(layers_list))
if extra_tags:
uri += "&%s" % extra_tags
uri += "&IgnoreGetMapUrl=1"
if ignore_get_map_url:
uri += "&IgnoreGetMapUrl=1"
return uri

def add_wms_url_query_layer(self, layer_name, url_query, group_name="", group_pos=None, only_one_map_on_group=False, only_one_visible_map_on_group=True, collapsed=True, visible=True, transparency=None, saturation=None, set_current=False):
def add_wms_url_query_layer(self, layer_name, url_query, group_name="", group_pos=None, only_one_map_on_group=False, only_one_visible_map_on_group=True, collapsed=True, visible=True, transparency=None, saturation=None, set_current=False, ignore_get_map_url=True):
""" Afegeix una capa WMS a partir d'una petició WMS (URL). Retorna la capa.
Veure add_wms_layer per opcions
---
Adds a WMS layer from a WMS request (URL). Returns the layer
See add_wms_layer for options
"""
uri = "url=%s" % url_query.lower().replace("epsg:", "epsg:").replace("srs=", "crs=").replace("?", "&")
uri += "&IgnoreGetMapUrl=1"
if ignore_get_map_url:
uri += "&IgnoreGetMapUrl=1"
return self.add_raster_uri_layer(layer_name, uri, "wms", group_name, group_pos, only_one_map_on_group, only_one_visible_map_on_group, collapsed, visible, transparency, saturation, set_current)

def update_wms_layer(self, layer, wms_layer=None, wms_time=None, wms_style=None):
Expand Down
27 changes: 15 additions & 12 deletions qlib3/base/qtextra.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,27 @@

class QtExtra:
@staticmethod
def changeStyle(widget, style_or_style_list, overwrite_style=None):
def changeStyle(widget, style_or_style_list): #, overwrite_style=None):
""" Change style widget from style name o style name list. overwrite_style filter current style to do change """
# Gets desired style
desired_style_list = style_or_style_list if type(style_or_style_list) is list else [style_or_style_list]

# ATENCIÓ SI INTENTO OBTENIR L'ESTIL ACTIU SI ALGÚ ACTIVA EL "MODE FOSC" DE QGIS LA CRIDa app.style().baseStyle().objectName() PETA!!
# Gets current style (Gets widget style or default app style)
app = QApplication.instance()
app_default_style = app.style().objectName() if app.style() is QCommonStyle else app.style().baseStyle().objectName()
widget_style = widget.style().objectName()
current_style = widget_style or app_default_style
#app = QApplication.instance()
#app_default_style = app.style().objectName() if type(app.style()) is QCommonStyle else app.style().baseStyle().objectName()
#widget_style = widget.style().objectName()
#current_style = widget_style or app_default_style
# if not overwrite_style or current_style == overwrite_style.lower():

# Apply new style if it is available
if not overwrite_style or current_style == overwrite_style.lower():
available_styles_list = QStyleFactory.keys()
for desired_style in desired_style_list:
if desired_style in available_styles_list:
widget.setStyle(QStyleFactory.create(desired_style))
return True
available_styles_list = QStyleFactory.keys()
for desired_style in desired_style_list:
if desired_style in available_styles_list:
widget.setStyle(QStyleFactory.create(desired_style))
return True
return False

@staticmethod
def forceQSliderArrowStyle(slider):
return QtExtra.changeStyle(slider, ["windowsvista", "Windows"], "Fusion")
return QtExtra.changeStyle(slider, ["windowsvista", "Windows"]) #, "Fusion")
2 changes: 2 additions & 0 deletions qlib3/base/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<file>images/andorra_shadows.png</file>
<file>images/andorra_topo25k.png</file>
<file>images/andorra_topo50k.png</file>
<file>images/france_ortho.png</file>
<file>images/france_topo.png</file>
<file>images/spain_cadastral.png</file>
<file>images/spain_orto.png</file>
<file>images/spain_topo.png</file>
Expand Down
7 changes: 0 additions & 7 deletions resources3/fme.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,6 @@
("met2", "MET 2m", 200, 800000000, None, None, None, None, ["", "pol", "mu", "co"], "met2.tif", "5k_limits", "%s/fmedatastreaming/Descarrega_basica/geotiff2format_clip_coor.fmw?SW_X=%s&SW_Y=%s&NE_X=%s&NE_Y=%s&poligon=%s&DEF_NAME=met2&Format=GEOTIFF&Projecte=met2&Codi=%s&piramide=True", None),
("met5", "MET 5m", 500, 5000000000, None, None, None, None, ["", "pol", "mu", "co"], "met5.tif", "5k_limits", "%s/fmedatastreaming/Descarrega_basica/geotiff2format_clip_coor.fmw?SW_X=%s&SW_Y=%s&NE_X=%s&NE_Y=%s&poligon=%s&DEF_NAME=met5m&Format=GEOTIFF&Projecte=met5&Codi=%s&piramide=True", None),

("elevacions-franja-litoral", "Model d’elevacions topobatimètric de la franja litoral", 200, 200000000, None, None, None, None, ["", "pol"], "elevacions-franja-litoral.tif", "cat_limits", "%s/fmedatastreaming/Descarrega_basica/geotiff2format_clip_coor.fmw?SW_X=%s&SW_Y=%s&NE_X=%s&NE_Y=%s&poligon=%s&DEF_NAME=met2&Format=GEOTIFF&Projecte=elevacions-franja-litoral&Codi=%s&piramide=True", None),
("batimetria", "Mapa d’isòbates", None, 200000000 , None, None, None, None, ["", "pol", "tot"], "batimetria.gpkg", "cat_limits", "%s/fmedatastreaming/batimetries/ICGC_batimetria_gpkg_clip.fmw?xMin=%s&yMin=%s&xMax=%s&yMax=%s&poligon=%s&Codi=%s", None),
#("linia-costa", "Línia de costa", None, 200000000 , None, None, None, get_coastline_years(), ["", "pol", "tot"], "linia-costa.gpkg", "cat_limits", "%s/fmedatastreaming/batimetries/ICGC_linia-costa_gpkg_clip.fmw?xMin=%s&yMin=%s&xMax=%s&yMax=%s&poligon=%s&Codi=%s", None),
] + [
("linia-costa %s" % "-".join(coastline_filename.split('-')[3:]), "Línia de costa",
None, 200000000 , None, None, None, None, ["", "pol", "tot"], coastline_filename + ".gpkg", "cat_limits", "%s/fmedatastreaming/batimetries/ICGC_linia-costa_gpkg_clip.fmw?xMin=%s&yMin=%s&xMax=%s&yMax=%s&poligon=%s&Codi=%s&geopackage_out=linia_costa&geopackage_in=" + coastline_filename, None) \
for coastline_filename in get_coastline_filenames()
] + [
("mggt1", "GT I. Mapa geològic 1:25.000", None, None, None, None, None, None, ["tot"], "gt1.shp-zip", None, "%s/fmedatastreaming/Descarrega_basica/descarrega_shape_coor.fmw?SW_X=%s&SW_Y=%s&NE_X=%s&NE_Y=%s&poligon=%s&Projecte=gt125m&Codi=%s", None),
("mg50m", "Mapa Geològic 1:50.000", None, None, None, None, None, None, ["tot"], "mg50m.shp-zip", None, "%s/fmedatastreaming/Descarrega_basica/descarrega_shape_coor.fmw?SW_X=%s&SW_Y=%s&NE_X=%s&NE_Y=%s&poligon=%s&Projecte=mg50m&Codi=%s", None),
Expand Down

0 comments on commit 70e5e95

Please sign in to comment.