[Openstreetmap-dev] CSV transport encoding scheme

Immanuel Scholz immanuel.scholz at gmx.de
Fri Jan 27 20:05:57 GMT 2006


Hi,

First: THANKS DAVID! ;-).


> Oh I should have added, I havn't made it live so please test it on your
> dev account(s) or mine...

Does not work here. :-(

[Fri Jan 27 20:56:47 2006] [error] mod_ruby: error in ruby
[Fri Jan 27 20:56:47 2006] [error] mod_ruby: ./osm/ox.rb:41:in `dump': need an 
IO object (TypeError)
[Fri Jan 27 20:56:47 2006] [error] mod_ruby:   from ./osm/ox.rb:41:in `dump'
[Fri Jan 27 20:56:47 2006] [error] mod_ruby:   
from /home/imi/src/osm/deploy/ruby/api/0.2/map.rb:83
[Fri Jan 27 20:56:47 2006] [error] mod_ruby:   
from /usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `handler'

This error is the same for gzipped and normal transfer. Looks like neither 
Apache::Request nor ZLip::GZipWriter is subclassed from IO...?

For quick fix, you could use "puts ox.to_s" instead of 
"ox.dump($stdout)" (which will be another step away from my progress bar ;)

> Imi: The dump function doesn't close the stream and only works with IO

Thats what the out.close in map.rb was for. And you could flush the stream, if 
it is not a gzip'ed on.


> objects with libxml it seems. So sometimes apache thinks theres nothing
> more to output because it's caught waiting in the zlib stream, and sends
> incomplete gz encoded documents back. Hence the stringbuffer I tolled
> back to.

Thats bad news. Anyway, even then Apache seem not to start transfer to client 
until the complete ruby script is executed. This means, there will be no 
progress bar possible anyway.


> Also, whats install_testserver do that install_www doesn't?

Instead of copy the whole stuff, it creates a directory and symlinks every 
file there in the current needed structure. This means, you don't have to do 
anything to reinstall the scripts. You can continue to edit your files (I 
have an auto-save every 2 seconds ;) and your developer site will be updated 
immediatly. I thought maybe someone likes this too.

(You can do a "watch bash install_www myname" to achieve almost the same 
effect, so remove the install_testserver if you don't like it.)

Ciao, Imi




More information about the dev mailing list