cbick / osmviz Goto Github PK
View Code? Open in Web Editor NEWAn OpenStreetMap Visualization Toolkit for Python
Home Page: http://cbick.github.com/osmviz
License: MIT License
An OpenStreetMap Visualization Toolkit for Python
Home Page: http://cbick.github.com/osmviz
License: MIT License
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 the API html pages refer to absolute local file path, instead of relative online file path.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.