def GetMap(self, params): if params['width'] > int(self.conf.get( 'service', 'maxwidth')) or params['height'] > int( self.conf.get('service', 'maxheight')): raise OGCException( 'Requested map size exceeds limits set by this server.') return WMSBaseServiceHandler.GetMap(self, params)
def GetFeatureInfo(self, params): # support for QGIS 1.3.0 GetFeatInfo... if not params.get('i') and not params.get('j'): params['i'] = params.get('x',params.get('X')) params['j'] = params.get('y',params.get('Y')) # support 1.1.1 request that end up using 1.3.0 impl # because the version is not included in GetMap # ArcGIS 9.2 for example makes 1.1.1 GetCaps request # but leaves version out of GetMap if not params.get('crs') and params.get('srs'): params['crs'] = params.get('srs') return WMSBaseServiceHandler.GetFeatureInfo(self, params, 'query_map_point')
def _buildMap(self, params): """ Override _buildMap method to handle reverse axis ordering in WMS 1.3.0. More info: http://mapserver.org/development/rfc/ms-rfc-30.html http://trac.osgeo.org/mapserver/changeset/10459 'when using epsg code >=4000 and <5000 will be assumed to have a reversed axes.' """ # Call superclass method m = WMSBaseServiceHandler._buildMap(self, params) # for range of epsg codes reverse axis as per 1.3.0 spec if params['crs'].code >= 4000 and params['crs'].code < 5000: bbox = params['bbox'] # MapInfo Pro 10 does not "know" this is the way and gets messed up if not 'mapinfo' in params['HTTP_USER_AGENT'].lower(): m.zoom_to_box(Envelope(bbox[1], bbox[0], bbox[3], bbox[2])) return m
def GetFeatureInfo(self, params): params['crs'] = params['srs'] params['i'] = params['x'] params['j'] = params['y'] return WMSBaseServiceHandler.GetFeatureInfo(self, params, 'query_map_point')
def GetMap(self, params): params['crs'] = params['srs'] return WMSBaseServiceHandler.GetMap(self, params)