Skip to content

Commit

Permalink
Added product information links on map layers and download tool
Browse files Browse the repository at this point in the history
Added sort columns option to geofinder dialog
Fixed compatibility problems with QGIS v3.30
Fixed problem searching coordinates without loaded map
Fixed problem showing save PDF options in products list
  • Loading branch information
icgcaadell committed Mar 22, 2023
1 parent c9af242 commit c79162e
Show file tree
Hide file tree
Showing 14 changed files with 1,344 additions and 670 deletions.
6 changes: 6 additions & 0 deletions geofinder3/geofinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import re
import logging
import math
from importlib import reload
from osgeo import ogr, osr

Expand Down Expand Up @@ -298,6 +299,9 @@ def find_point_coordinate(self, x, y, epsg, add_point_if_empty=True, show_log=Tr
# We convert the coordinates to ETRS89 UTM31N to do the query
nom = "Point: %s %s (EPSG:%s)" % (x, y, epsg),
query_x, query_y = self.transform_point(x, y, epsg, 25831)
if query_x is None or query_y is None:
self.log.exception("Coordinates error: %s %s EPSG:%s", x, y, epsg)
raise(Exception("Coordinates error: %s %s EPSG:%s" % (x, y, epsg)))

# We execute the query
self.log.debug("Geoencoder URL: %s", self.get_icgc_geoencoder_client().wsdl.url)
Expand Down Expand Up @@ -351,6 +355,8 @@ def transform_point(self, x, y, source_epsg, destination_epsg):

ct = osr.CoordinateTransformation(source_crs, destination_crs)
destination_x, destination_y, _h = ct.TransformPoint(x, y)
destination_x = None if math.isinf(destination_x) else destination_x
destination_y = None if math.isinf(destination_y) else destination_y
return destination_x, destination_y

def find_road(self, road, km):
Expand Down
Loading

0 comments on commit c79162e

Please sign in to comment.