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

Python Error when selecting dataset in Search Tab #63

Closed palmerj closed 10 years ago

palmerj commented 10 years ago

I get the following error when selecting at searched dataset in Search Tab

Traceback (most recent call last): File "/usr/share/qgis/python/plugins/MetaSearch/dialogs/maindialog.py", line 548, in record_clicked geom.transform(ctr) Exception: unknown

I was using the LINZ Data Service service.

tomkralidis commented 10 years ago

@palmerj thanks for the info. Looks like a projection issue. What search did you do to get the search results causing this error? Is QGIS in a certain projection?

palmerj commented 10 years ago

I have one layer added in EPSG:3857 without OTF re-projection enabled. I did a mapcanvas extents query.

tomkralidis commented 10 years ago

@palmerj I was able to reproduce this issue. The problem looks like the LINZ CSW is returning swapped coordinates mismatched against the crs it declares:

      <ows:BoundingBox crs="urn:ogc:def:crs:EPSG:6.6:4326">
        <ows:LowerCorner>-156.8374237 -78.3520774</ows:LowerCorner>
        <ows:UpperCorner>158.6967171 -7.3167891</ows:UpperCorner>
      </ows:BoundingBox>

The crs attribute axis order should be y x.

tomkralidis commented 10 years ago

Furthermore, some records from the LINZ CSW return invalid crs attributes:

      <ows:BoundingBox crs="urn:ogc:def:crs:::urn:ogc:def:crs:EPSG::2193">
        <ows:LowerCorner>177.992964135 -45.5189597448</ows:LowerCorner>
        <ows:UpperCorner>168.914923752 -34.7674506956</ows:UpperCorner>
      </ows:BoundingBox>
palmerj commented 10 years ago

Hi Tom,

Do you have the URLs that produce those invalid bounding boxes?

Thanks Jeremy

tomkralidis commented 10 years ago

@palmerj example: http://data.linz.govt.nz/feeds/csw?outputFormat=application%2Fxml&service=CSW&outputSchema=http://www.opengis.net/cat/csw/2.0.2&request=GetRecordById&version=2.0.2&elementsetname=full&id=2889d885-ebf0-3e1d-d598-12545cb0fbb4

palmerj commented 10 years ago

Thanks Tom. I will get the CSW feed fixed.