hotosm / oam-dynamic-tiler

Dynamic tiling of raster data for OpenAerialMap + others
Other
35 stars 12 forks source link

Tiles rendering differently (may be related to 16-bit + alpha mask) #34

Closed smit1678 closed 7 years ago

smit1678 commented 7 years ago

Tiles are oddly rendering differently in tiles.staging.openaerialmap vs tiles.openaerialmap.org.

Scaled image is what is used in the two links below:

Production: http://tiles.staging.openaerialmap.org/58d406a593d49b0010c0a646/0/7f209334-bd88-4a2c-b2d1-ada02c3770b2/preview#17/19.64804/-101.22717

Staging: http://tiles.openaerialmap.org/58d40857ca8ed70011209f62/0/e3274e5b-f5d0-4f89-bac6-6ec143ef6249/preview#15/19.6481/-101.2277

Unclear where the issue is coming from so not sure how to describe the issue better.

cc @mojodna

mojodna commented 7 years ago

Apparent underlying error:

An error occurred during JSON serialization of response: 'utf8' codec can't decode byte 0xe1 in position 5: invalid continuation byte
Traceback (most recent call last):
  File "/usr/lib64/python2.7/json/__init__.py", line 251, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib64/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib64/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xe1 in position 5: invalid continuation byte

Metadata:

{
  "name": "Campus Morelia UNAM",
  "bounds": [
    -101.23227776812207,
    19.644859313964844,
    -101.22273276812207,
    19.651613235473633
  ],
  "minzoom": 9,
  "meta": {
    "width": 9545,
    "acquisitionEnd": "2016-06-22T15:35:00+00:00",
    "acquisitionStart": "2016-06-22T15:26:00+00:00",
    "mask": "http://oin-hotosm.s3.amazonaws.com/58d40857ca8ed70011209f62/0/e3274e5b-f5d0-4f89-bac6-6ec143ef6249_warped_mask.vrt",
    "height": 6753,
    "source": "http://oin-hotosm.s3.amazonaws.com/58d40857ca8ed70011209f62/0/e3274e5b-f5d0-4f89-bac6-6ec143ef6249_warped.vrt",
    "platform": "uav",
    "provider": "Nicolás Vargas Ramírez",
    "footprint": "http://oin-hotosm.s3.amazonaws.com/58d40857ca8ed70011209f62/0/e3274e5b-f5d0-4f89-bac6-6ec143ef6249_footprint.json",
    "approximateZoom": 21,
    "uploadedAt": "2017-03-23T17:39:36.946000+00:00"
  },
  "maxzoom": 24,
  "tilejson": "2.1.0",
  "center": [
    -101.22750526812207,
    19.64823627471924,
    15
  ]
}
mojodna commented 7 years ago

Or:

No module named logging: ImportError
Traceback (most recent call last):
  File "/var/task/main.py", line 15, in handle
    return awsgi.response(tiler, event, context)
  File "/var/task/awsgi.py", line 38, in response
    output = app(environ(event, context), sr)
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1994, in __call__
  File "/tmp/pip-build-V25ydt/werkzeug/werkzeug/wsgi.py", line 659, in __call__
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1985, in wsgi_app
  File "/tmp/pip-build-V25ydt/flask-cors/flask_cors/extension.py", line 161, in wrapped_function
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1544, in handle_exception
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1557, in log_exception
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 622, in logger
ImportError: No module named logging
mojodna commented 7 years ago
ERROR in app: Exception on /58d40857ca8ed70011209f62/0/e3274e5b-f5d0-4f89-bac6-6ec143ef6249/15/7170/14561.png [GET]
Traceback (most recent call last):
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1982, in wsgi_app
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1614, in full_dispatch_request
  File "/tmp/pip-build-V25ydt/flask-cors/flask_cors/extension.py", line 161, in wrapped_function
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1517, in handle_user_exception
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1612, in full_dispatch_request
  File "/tmp/pip-build-V25ydt/flask/flask/app.py", line 1598, in dispatch_request
  File "/var/task/app.py", line 46, in tile
    meta = get_metadata(id, **kwargs)
  File "/tmp/pip-build-V25ydt/cachetools/cachetools/func.py", line 58, in wrapper
  File "/var/task/tiler.py", line 52, in get_metadata
    return rsp.json()
  File "/tmp/pip-build-V25ydt/requests/requests/models.py", line 866, in json
  File "/tmp/pip-build-V25ydt/requests/requests/models.py", line 826, in text
  File "/tmp/pip-build-V25ydt/requests/requests/models.py", line 696, in apparent_encoding
  File "/tmp/pip-build-V25ydt/requests/requests/packages/chardet/__init__.py", line 27, in detect
ImportError: cannot import name universaldetector