ckan / ckanext-geoview

CKAN Geospatial ResourceView
MIT License
43 stars 60 forks source link

Fixes https://github.com/ckan/ckanext-geoview/issues/10 #15

Closed mattfullerton closed 2 years ago

mattfullerton commented 9 years ago

At least for my test data. We still will have a problem when no square-pixel WMS layer is provided by the server; in this case the base layer shouldn't be shown as it doesn't make sense.

amercader commented 9 years ago

I think this might be related with the WMS server not handling correctly the 3857 SRS that is defined when Mercator = True. I'm not sure, I've tried to leave my past life of pain with OGC standards and projections behind.

If you can make sure that other WMS services are displayed properly with this change (check data.gov.uk, data.gov, or other sites) I'm happy to merge it if it helps.

Good (EPSG 900913):

http://geodienste-hamburg.de/HH_WMS_BWVI_opendata?LAYERS=bab_novkl&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A900913&BBOX=1048613.4832904,7043553.4334799,1184671.393619,7135277.8674093&WIDTH=890&HEIGHT=600

Bad (EPSG 3857):

http://geodienste-hamburg.de/HH_WMS_BWVI_opendata?LAYERS=bab_novkl&TRANSPARENT=TRUE&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT=image%2Fpng&SRS=EPSG%3A3857&BBOX=1048613.4832904,7043553.4334799,1184671.393619,7135277.8674093&WIDTH=890&HEIGHT=600

mattfullerton commented 9 years ago

I suppose when the server states that it supports 3857, we get something sensible back when we ask for 3857 which happens when Mercator=True. Otherwise trying to coerce it to do 3857 doesn't work as well as coercing it to do 900913, even though these are theoretically the same thing. I think the other problem also exists; if the server states it supports 3857, we may need to make sure we explicitly ask for it otherwise we will ask for 900913 and a very 'correct' server will refuse it. But this doesn't cover the case of conversion being needed (i.e. 3857=False and 900913=False) but 900913 not being supported. I don't know what is the most-likely-to-work parameter, but I guess an obtuse solution would be to try again with the other if the first one fails :s

I think the change as proposed is safe enough assuming 900913 is the safer bet. I will test with other sources as you propose and if need be adjust the change.

categulario commented 2 years ago

PR 7 years old and with conflicts, probably can be closed. (Checked the differences and they are too big)