[MapProxy] error with WMS source

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[MapProxy] error with WMS source

Burkhardt, Glenn B        Collins
I'm using MapProxy 1.11, and am trying to configure a single layer with a WMS source.  But I get this error:


Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mapproxy/wsgiapp.py", line 193, in __call__
    resp = self.handlers[handler_name].handle(req)
  File "/usr/lib/python2.7/dist-packages/mapproxy/service/ows.py", line 38, in handle
    return self.services[service].handle(req)
  File "/usr/lib/python2.7/dist-packages/mapproxy/service/base.py", line 30, in handle
    return handler(parsed_req)
  File "/usr/lib/python2.7/dist-packages/mapproxy/service/wms.py", line 142, in map
    bbox=query.bbox, bbox_srs=params.srs, coverage=coverage)
  File "/usr/lib/python2.7/dist-packages/mapproxy/image/merge.py", line 84, in merge
    img = mask_image(img, bbox, bbox_srs, layer_coverage)
  File "/usr/lib/python2.7/dist-packages/mapproxy/image/mask.py", line 33, in mask_image
    geom = mask_polygons(bbox, SRS(bbox_srs), coverage)
  File "/usr/lib/python2.7/dist-packages/mapproxy/image/mask.py", line 42, in mask_polygons
    return flatten_to_polygons(coverage.geom)
  File "/usr/lib/python2.7/dist-packages/mapproxy/util/geom.py", line 248, in flatten_to_polygons
    if geometry.type == 'Polygon':
AttributeError: 'NoneType' object has no attribute 'type'
[info] 127.0.0.1 - - [11/Feb/2019 16:19:10] "GET /service?service=WMS&request=GetMap&version=1.3.0&crs=EPSG:4326&layers=CIB-NY&styles=&transparent=TRUE&format=image/png&width=512&height=512&bbox=44.15625,-75.09375,44.4375,-74.8125 HTTP/1.1" 500 -

A brief look at the code indicates that this result is guaranteed, since 'coverage' passed to merger.merge at line 142 of wms.py will be 'None' unless authorization settings are available (I haven't configured them).

My configuration is fairly simple:

layers:
  - name: CIB-NY
    title: CIB-NY
    sources: [cibny_source]
sources:
  cibny_source:
    type: wms
    wms_opts:
      featureinfo: True
    req:
      url: http://localhost/cgi-bin/mapserv?
      layers: CIBNYI7k
      transparent: true
      format: image/tiff
    coverage:
      clip: true
      bbox: [-75.5086294, 43.9872123, -74.9969543, 44.5120205]
      srs: 'EPSG:4326'
    supported_srs: ['EPSG:4326']

What am I missing?   ...tia
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy
Reply | Threaded
Open this post in threaded view
|

Re: [MapProxy] error with WMS source

Burkhardt, Glenn B        Collins
This is due to a bug:

        https://github.com/mapproxy/mapproxy/issues/397

-----Original Message-----
From: Burkhardt, Glenn B Collins
Sent: Monday, February 11, 2019 16:37
To: '[hidden email]' <[hidden email]>
Subject: error with WMS source

I'm using MapProxy 1.11, and am trying to configure a single layer with a WMS source.  But I get this error:


Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/mapproxy/wsgiapp.py", line 193, in __call__
    resp = self.handlers[handler_name].handle(req)
  File "/usr/lib/python2.7/dist-packages/mapproxy/service/ows.py", line 38, in handle
    return self.services[service].handle(req)
  File "/usr/lib/python2.7/dist-packages/mapproxy/service/base.py", line 30, in handle
    return handler(parsed_req)
  File "/usr/lib/python2.7/dist-packages/mapproxy/service/wms.py", line 142, in map
    bbox=query.bbox, bbox_srs=params.srs, coverage=coverage)
  File "/usr/lib/python2.7/dist-packages/mapproxy/image/merge.py", line 84, in merge
    img = mask_image(img, bbox, bbox_srs, layer_coverage)
  File "/usr/lib/python2.7/dist-packages/mapproxy/image/mask.py", line 33, in mask_image
    geom = mask_polygons(bbox, SRS(bbox_srs), coverage)
  File "/usr/lib/python2.7/dist-packages/mapproxy/image/mask.py", line 42, in mask_polygons
    return flatten_to_polygons(coverage.geom)
  File "/usr/lib/python2.7/dist-packages/mapproxy/util/geom.py", line 248, in flatten_to_polygons
    if geometry.type == 'Polygon':
AttributeError: 'NoneType' object has no attribute 'type'
[info] 127.0.0.1 - - [11/Feb/2019 16:19:10] "GET /service?service=WMS&request=GetMap&version=1.3.0&crs=EPSG:4326&layers=CIB-NY&styles=&transparent=TRUE&format=image/png&width=512&height=512&bbox=44.15625,-75.09375,44.4375,-74.8125 HTTP/1.1" 500 -

A brief look at the code indicates that this result is guaranteed, since 'coverage' passed to merger.merge at line 142 of wms.py will be 'None' unless authorization settings are available (I haven't configured them).

My configuration is fairly simple:

layers:
  - name: CIB-NY
    title: CIB-NY
    sources: [cibny_source]
sources:
  cibny_source:
    type: wms
    wms_opts:
      featureinfo: True
    req:
      url: http://localhost/cgi-bin/mapserv?
      layers: CIBNYI7k
      transparent: true
      format: image/tiff
    coverage:
      clip: true
      bbox: [-75.5086294, 43.9872123, -74.9969543, 44.5120205]
      srs: 'EPSG:4326'
    supported_srs: ['EPSG:4326']

What am I missing?   ...tia
_______________________________________________
MapProxy mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapproxy