Coder Social home page Coder Social logo

osmviz's People

Contributors

cbick avatar robertjd avatar sethoscope avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

osmviz's Issues

Caches broken tiles even if tile server returns 500 Internal Server Error

When using osm.createOSMImage with an OSM server with broken tiles (such as Stamen tiles at the moment), it cannot create the image (as expected?) and saves an HTML error text file as the cached .png file.

For example with London:

bbox = (51.505272562570596, 51.50927923742941, -0.13315286427556772, -0.12216653572443227)
zoom = 17

osm = OSMManager(image_manager=PILImageManager('RGB'),
                 server='http://d.tile.stamen.com/watercolor')
img, bnds = osm.createOSMImage(bbox, zoom)

Output:

  File "C:\Python27\lib\osmviz\manager.py", line 333, in createOSMImage
    self.manager.paste_image_file( fname, (x_off,y_off) )
  File "C:\Python27\lib\osmviz\manager.py", line 108, in paste_image_file
    raise Exception, "Could not load image "+str(imagef)+"\n"+str(e)
Exception: Could not load image C:\DOCUME~1\Hugo\LOCALS~1\Temp\osmviz-68701-17_65491_43585.png

And:

C:\Python27\Lib\osmviz>cat C:\DOCUME~1\Hugo\LOCALS~1\Temp\osmviz-68701-17_65491_43585.png

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>500 Internal Server Error</title>
  </head>
  <body>
    <h1>Error 500 Internal Server Error</h1>
    <p>Internal Server Error</p>
    <h3>Guru Meditation:</h3>
    <p>XID: 912655379</p>
    <hr>
    <p>Varnish cache server</p>
  </body>
</html>

Expected result:
Doesn't save the fake png, so I don't need to manually inspect and delete them afterwards, as the cached file would prevent later, re-generated tiles be saved.
Exception should be raised earlier in retrieveTileImage() rather than later in paste_image_file().

(Possibly osm.createOSMImage() could still return a generated image with some blank tile instead of the broken one, but still it shouldn't save broken tiles to disk.)

Code links in API docs

Code links in the API html pages refer to absolute local file path, instead of relative online file path.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.