geopython / MetaSearch

*** We have moved! MetaSearch is now a core QGIS plugin! (2014-11-30). See QGIS repository
https://hub.qgis.org/wiki/quantum-gis/MetaSearch
Other
4 stars 12 forks source link

Search error on CSW catalog - Qgis 2.6 #70

Closed LukeGIS closed 9 years ago

LukeGIS commented 9 years ago

Hello, I received this error when I do a search on a CSW catalog (Qgis version 2.6 - Metasearch Version 0.3.2 (11/04/2014)):

Traceback (most recent call last): File "C: /Users/lucafore/.qgis2/python/plugins \ MetaSearch \ dialogs \ maindialog.py", line 471, in search self.display_results () File "C: /Users/lucafore/.qgis2/python/plugins \ MetaSearch \ dialogs \ maindialog.py", line 483, in Display_results 's' [self.catalog.results ['matches'] == 1:]) TypeError: not all arguments converted During string formatting

The same error occurs if I use Qgis 2.4 with the same Metaserarch version.

It seems that everything works fine if I select the English language instead of the Italian language. It may be only a language problem?

How can I fix this?

Thanks in advance. Luca

tomkralidis commented 9 years ago

@LukeGIS can you outline the steps taken so I can try to reproduce? Which catalogue are you searching against? What are the search parameters (Map extent, Keywords)

LukeGIS commented 9 years ago

Hi Tom, thanks for the reply. I think the problem is the same as discussed here: http://web.archiveorange.com/archive/v/igTge39F0yCnQs7yYcj5

I get the same error on all catalogs (default services and new catalogs). I get the same error with or without search parameters (the issue cannot be related to the search words or extension research).

You can try this CSW Catalogs:

CSW ARPA: http://webgis.arpa.piemonte.it/geoportalserver_arpa/csw? CSW PCN: http://www.pcn.minambiente.it/geoportal/csw? LINZ Data services: http://data.linz.govt.nz/feeds/csw Data.gov CSW: http://catalog.data.gov/csw-all

To reproduce the errors I tink that you need to select italian languages.

On my PC (windws seven professional Qgis version Bringhton 2.6.0 64 bit) everything seems to work well if I select the English language (setting -> options -> Override system locale-> US Inglese) after Qgis reboot.

Thanks.

Luca

rduivenvoorde commented 9 years ago

Mmm, confirmed here on my master build (see attached screenshot).

ONLY when I use italian: qgis --lang it NOT when using english language then I get results back (searching for 'aqua' on data.gov in both languages) error

tomkralidis commented 9 years ago

cc @pcav. @LukeGIS: digging deeper, this issue is due to string formatting / placeholder error in the Italian translations. The string Showing %d - %d of %d result%s is translated in Italian to Mostrando %d - %d di %d risultato/i causing the error.

83b88f67abb679501a238e4ab4ee344c3cdbf55d fixes this by simplifying the string in English to Showing %d - %d of %n result(s) given plurals are expressed differently across spoken languages. I've also backported this fix to QGIS master the 2.6 branch which should be out soon.

In the meantime, it would be great to update the modified string accordingly.

pcav commented 9 years ago

Thanks a lot Tom, doing it now. Sorry about the mistake.

pcav commented 9 years ago

could you please enable me to fix it?