From kipfer at logiball.de Tue May 15 17:27:23 2001 From: kipfer at logiball.de (Anja Kipfer) Date: Tue, 15 May 2001 17:27:23 +0200 Subject: [Mapit] WG: NT, IIS and png Message-ID: <01C0DD64.4E115240.kipfer@logiball.de> Hi Bernhard, here's the description of the problem installing Mapit on IIS 4.0. The SIG "image-sig at python.org" is actually a good place to get some assistance for PIL issues. I had written "c:\Program Files\Python\python.exe -u %s %s" in the Registry and thought this is okay but when I looked under HomeDirectory -> Configuration the "u" was missing. Everything just work fine now... Regards, Anja -----Urspr?ngliche Nachricht----- Von: Clover Andrew [SMTP:aclover at 1value.com] Gesendet am: Donnerstag, 10. Mai 2001 18:37 An: image-sig at python.org Betreff: Re: [Image-SIG] NT, IIS and png Anja Kipfer wrote: > Do I need a certain environment-variable or similar to be > able to write in sys.stdout? No, the problem is most likely that you're not writing to stdout as a binary file. LFs are probably being changed into CRLFs, making the file invalid. Check your IIS Python-script-handler in 'Home directory-> Configuration' - if I remember correctly, you need the '-u' switch to get a binary stdout, so the command should probably be something like X:\Program Files\Python\python.exe -u "%s" "%s" Does that fix it? -----Urspr?ngliche Nachricht----- Von: Anja Kipfer [SMTP:kipfer at logiball.de] Gesendet am: Donnerstag, 10. Mai 2001 15:20 An: 'image-sig at python.org' Betreff: NT, IIS and png Hiya, there's a problem with displaying png-data when the script runs in IIS 4.0 on NT. Using Apache on NT the same code /png-files just work fine! The error occurs a follows: Image.save is called: apply(image.save, (sys.stdout, format), params) this calls PngImagePlugin._save(im, fp, filename, chunk=putchunk, check=0) this calls ImageFile._save(...) Here, the script crashes at line fh=fp.fileno(), whereby fp is the passed-through parameter sys.stdout If I call image.save with a filename instead, a correct png-file gets created - but I have it in the file system and not on the screen where I want it to be! Do I need a certain environment-variable or similar to be able to write in sys.stdout? Does anyone have an idea of how to solve that problem??? With many thanks in advance, Anja From Frank.Schumacher at t-online.de Tue May 22 00:35:39 2001 From: Frank.Schumacher at t-online.de (Frank Schumacher) Date: Tue, 22 May 2001 00:35:39 +0200 Subject: [Mapit] BoundingBoxes | TileSets | Coordinates Message-ID: <000701c0e246$5d5e8ec0$0601a8c0@org> Hallo, vor kurzem habe ich MapIt heruntergeladen und noch einige Fragen offen, die ich mir selbst noch nicht beantworten konnte, da ich im Code noch nicht so zu Hause bin. Au?erdem ist Python noch ziemlich neu f?r mich. Aber zur Sache. 1. Herstellung eines Tile-Sets aus einer EPS: Ich habe schon gesehen, dass es funktioniert. a) Wie kann ich einen Offset vom Ursprung der BoundingBox definieren, ab dem das Tileset beginnt. Oder besser noch: eine InnerBoundingBox als Untermenge der BoundingBox definieren, die die erlaubte und gew?nschte Region des Tilesets definiert? b) Was ist, wenn das aus einer EPS-Datei generierte Tileset nicht aufgeht. Soll heissen: Bei definierter Tilegr??e in Pixeln gibt es Randtiles, die entweder ?ber die BoundingBox ins Niemandslands hinausragen (oder die Grenze der BBox nicht ganz erreichen)? Wird hinzugedichtet oder abgeschnitten? Wie? Wo im Code stehts? 2. Beziehung zwischen Pixelgr??e der Tiles und den Koordinaten (EPSCUT) a) Wie genau ergeben sich die Koordinaten aus den Pixelgr??en des Tilesets bei der Verwendung von EPSCUT? Wo im Code steht das? Und ist das an vorhandene Koordinatensysteme anzupassen (etwa in der Weise, dass ich den Markern, die ich schon Gau?-Kr?ger-koordiniert habe, auf diese Weise eine passende Karte unterschieben kann)? Ich h?tte noch mehr zu fragen, aber ich glaube, das hebe ich f?r sp?ter auf. Vielen Dank! Freundliche Gr??e aus Berlin Frank Schumacher From bh at intevation.de Tue May 22 15:21:33 2001 From: bh at intevation.de (Bernhard Herzog) Date: 22 May 2001 15:21:33 +0200 Subject: [Mapit] BoundingBoxes | TileSets | Coordinates References: <000701c0e246$5d5e8ec0$0601a8c0@org> Message-ID: <6qzoc5ldsy.fsf@abnoba.intevation.de> Frank.Schumacher at t-online.de (Frank Schumacher) writes: > Hallo, > > vor kurzem habe ich MapIt heruntergeladen und noch einige Fragen offen, die > ich mir selbst noch nicht beantworten konnte, da ich im Code noch nicht so > zu Hause bin. Au?erdem ist Python noch ziemlich neu f?r mich. > Aber zur Sache. I'm replying in English for the mailing list participants who don't know German. First of all, the epscut script was created as a quick hack to render the europe sample map (http://www.mapit.de/mapit/europe.de/) because we wanted to have free example data set. The map was generated from PDF files from the CIA World Factbook. Any usefulness beyond this is more or less accidental :) > 1. Herstellung eines Tile-Sets aus einer EPS: > Ich habe schon gesehen, dass es funktioniert. > a) Wie kann ich einen Offset vom Ursprung der BoundingBox definieren, ab dem > das Tileset beginnt. Oder besser noch: eine InnerBoundingBox als Untermenge > der BoundingBox definieren, die die erlaubte und gew?nschte Region des > Tilesets definiert? [is there a way to select a subregion of the eps for rendering with epscut instead of the whole BoundingBox?] Well, there isn't one at the moment. The easiest solution is probably to edit the EPS file by hand so that the BoundingBox comment describes your region of interest. > b) Was ist, wenn das aus einer EPS-Datei generierte Tileset nicht aufgeht. > Soll heissen: Bei definierter Tilegr??e in Pixeln gibt es Randtiles, die > entweder ?ber die BoundingBox ins Niemandslands hinausragen (oder die Grenze > der BBox nicht ganz erreichen)? Wird hinzugedichtet oder abgeschnitten? Wie? > Wo im Code stehts? [What happens at the border of the Tilesets (in case the tiles don't fit the region exactly)?] If the BoundingBox is accurate and you use only integers for the factors argument to the make_tile_hierarchy function the generated tiles should fit exactly. However, since the BoundingBox comment describes the bounding box with integers it's possible that there's a thin white border. > 2. Beziehung zwischen Pixelgr??e der Tiles und den Koordinaten (EPSCUT) > a) Wie genau ergeben sich die Koordinaten aus den Pixelgr??en des Tilesets > bei der Verwendung von EPSCUT? Wo im Code steht das? [In epscut, where does the tilesets coordinate system come from?] The unit of the coordinate system is one pixel in the tileset for the highest magnification factor. The origin is the lower left corner of the lower left tile (1x1.png), x increases to the right, y increases upwards. The relevant code is in make_tile_hierarchy. The coordinate system is derived from the bounding box, the overview_size and the highest magnification factor. The scaling factors are chosen so that the bounding box fits exactly into overview_size while preserving the aspect ratio. The sizes of the tile larger tile sets are basically just multiples of overview_width and overview_height. > Und ist das an > vorhandene Koordinatensysteme anzupassen (etwa in der Weise, dass ich den > Markern, die ich schon Gau?-Kr?ger-koordiniert habe, auf diese Weise eine > passende Karte unterschieben kann)? [How do I convert between the MapIt! internal coordinate system and other coordinate systems?] MapIt! itself only deals with the coordinate system used for the tiles and markers. However, if you know how to convert your coordinates to the standard postscript coordinate system, i.e. the one which BoundingBox comment uses, you can add the following lines to make_tile_hierarchy to make epscut print the transformation from the standard postscript coordinate system to the internal coordinate system. With that information you should be able to transform your makers. # Print the transformation from EPS coordinates to MapIt internal # coordinates llx, lly, urx, ury = eps.bbox print "Transformation from EPS-coordinates (px, py)" print "to MapIt! coordinates (mx, my):" print "mx = %.17g * (px - %.17g)" % (reference_size[0] / float(eps.width), llx) print "my = %.17g * (py - %.17g)" % (reference_size[1] / float(eps.height), lly) Bernhard -- Intevation GmbH http://intevation.de/ Sketch http://sketch.sourceforge.net/ MapIt! http://mapit.de/ From bernhard at intevation.de Tue May 22 16:10:30 2001 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 22 May 2001 16:10:30 +0200 Subject: [Mapit] New German MapiIt! list Message-ID: <20010522161030.E31639@intevation.de> Hello, there is a new mailinglist for MapIt! geard towards German speakers: mapit-de at intevation.de http://intevation.de/mailman/listinfo/mapit-de This makes it much easier for people interested in MapIt! to ask and contribute if they have a list dedicated to only one language. We will subscribe all members of mapit having a mailaddress which let us assume that they speak German additionall yto mapit-de. Everybody is of course free to use the web interface to unsubscribe or subscribe to both lists on personal preferance. Best Regards, Bernhard -- Professional Service around Free Software (intevation.net) The FreeGIS Project (freegis.org) Association for a Free Informational Infrastructure (ffii.org) FSF Europe (fsfeurope.org) -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 248 bytes Desc: not available Url : http://www.intevation.de/pipermail/mapit/attachments/20010522/8df3910d/attachment.bin From Frank.Schumacher at t-online.de Sun May 27 12:33:24 2001 From: Frank.Schumacher at t-online.de (Frank Schumacher) Date: Sun, 27 May 2001 12:33:24 +0200 Subject: [Mapit] MAKING IT WORK on NT4 Message-ID: <000701c0e698$75eba990$0601a8c0@org> Hi, I am having some weird problems in getting showmap to run under NT. It simply does not work. Maybe someone is able to help. I want to use the Personal WebServer instead of mapitserver.py. What works: I am using NT's personal webserver, setup a new virtual directory with the appropriate rights. Everything works fine. I can call cgi-scripts (a personal *.exe-one) that are executed, but when I call http://localhost/cgi-map/src/frontends/showmap.py from the same directory the server gets busy starts the interpreter but after a couple of minutes stops with this error message: ||CGI Timeout ||The specified CGI application exceeded the allowed time for processing. The server has deleted the process After which the server kicks the python-interpreter out of the memory as it said in the error message. So I tried to figure out if something was wrong with the script itself and started it from the command line and redirected its output to a file. All went as expected. Nothing to worry about. This is the script that gets called but never executes: showmap.py (I added the extension to the showmap file in order not to irritate NT with a missing file extension ) #! d:\mapit\python\python -u -o __version__ = "$Revision: 1.8 $" import os, sys import cgi sys.path.insert(0, '../base') import pagetemplate, tileinfo, markerinfo, common, mapconfig def main(): print 'Content-type: text/html' print template = pagetemplate.TemplateProcessor(mapconfig.template_file) map = tileinfo.MapInfo(mapconfig.tile_dir, mapconfig.tile_ext) marker = markerinfo.MarkerInfo(mapconfig.marker_locations, mapconfig.marker_dir, mapconfig.marker_ext) parameters = common.Parameters(cgi.FieldStorage(), showmap = "showmap", map = map, marker = marker) template.generate_html(parameters, sys.stdout) main() Maybe someone, can give me an idea of where and how to find a solution. Thank you. Frank From bernhard at intevation.de Sun May 27 20:50:42 2001 From: bernhard at intevation.de (Bernhard Reiter) Date: Sun, 27 May 2001 20:50:42 +0200 Subject: [Mapit] MAKING IT WORK on NT4 In-Reply-To: <000701c0e698$75eba990$0601a8c0@org>; from Frank.Schumacher@t-online.de on Sun, May 27, 2001 at 12:33:24PM +0200 References: <000701c0e698$75eba990$0601a8c0@org> Message-ID: <20010527205042.D21662@intevation.de> On Sun, May 27, 2001 at 12:33:24PM +0200, Frank Schumacher wrote: > I am having some weird problems in getting showmap to run under NT. It > simply does not work. Maybe someone is able to help. I want to use the > Personal WebServer instead of mapitserver.py. I do not know the "Personal WebServer". Mapit is known to run with ISS and apache on NT, so in principle I believe that this must be a problem on your webserver's configuration side. > showmap.py (I added the extension to the showmap file in order not to > irritate NT with a missing file extension ) > #! d:\mapit\python\python -u -o > __version__ = "$Revision: 1.8 $" Can you make sure that showmap.py is called with the "-u" option set to the python interpreter? This could be an extra configuration part somewhere in your webserver. Apard from that maybe the manual of your webserver has some hints on debugging it? Best, Bernhard -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 248 bytes Desc: not available Url : http://www.intevation.de/pipermail/mapit/attachments/20010527/2976d7f7/attachment.bin From Frank.Schumacher at t-online.de Mon May 28 00:19:20 2001 From: Frank.Schumacher at t-online.de (Frank Schumacher) Date: Mon, 28 May 2001 00:19:20 +0200 Subject: [Mapit] MAKING IT WORK on NT4 References: <000701c0e698$75eba990$0601a8c0@org> <20010527205042.D21662@intevation.de> Message-ID: <001c01c0e6fb$148c1b40$0601a8c0@org> Hi Bernhard, >>On Sun, May 27, 2001 at 12:33:24PM +0200, Frank Schumacher wrote: >>> I am having some weird problems in getting showmap to run under NT. It >> simply does not work. Maybe someone is able to help. I want to use the >> Personal WebServer instead of mapitserver.py. >I do not know the "Personal WebServer". >Mapit is known to run with ISS and apache on NT, so in principle I believe >that this must be a problem on your webserver's configuration side. The Personal Web Server is Microsoft' Freeware Version of IIS that became available in NT's so-called Option Pack. Its features should be roughly equivalent to those of Internet Information Server (apart from being a low volume server). Needless to say, there are some drawbacks, but there is also an advantage. Your system doesn't need to be NT Server. That way it runs on NT workstations and W9x machines. My system identifies the Personal Webserver as IIS. >> showmap.py (I added the extension to the showmap file in order not to >> irritate NT with a missing file extension ) >> #! d:\mapit\python\python -u -o >> __version__ = "$Revision: 1.8 $" >Can you make sure that showmap.py is called with the "-u" option set >to the python interpreter? This could be an extra configuration >part somewhere in your webserver. As follows clearly from the above, I now ask: How do you do this on your NT-machine? And what is this supposed to change? >Apard from that maybe the manual of your webserver has some hints on >debugging it? >Best, >Bernhard Bye from Berlin Frank ----- Original Message ----- From: "Bernhard Reiter" To: Sent: Sunday, May 27, 2001 8:50 PM Subject: Re: [Mapit] MAKING IT WORK on NT4 From bernhard at intevation.de Tue May 29 10:33:02 2001 From: bernhard at intevation.de (Bernhard Reiter) Date: Tue, 29 May 2001 10:33:02 +0200 Subject: [Mapit] MAKING IT WORK on NT4 In-Reply-To: <001c01c0e6fb$148c1b40$0601a8c0@org>; from Frank.Schumacher@t-online.de on Mon, May 28, 2001 at 12:19:20AM +0200 References: <000701c0e698$75eba990$0601a8c0@org> <20010527205042.D21662@intevation.de> <001c01c0e6fb$148c1b40$0601a8c0@org> Message-ID: <20010529103302.R7027@intevation.de> On Mon, May 28, 2001 at 12:19:20AM +0200, Frank Schumacher wrote: > >Mapit is known to run with ISS and apache on NT, so in principle I believe > >that this must be a problem on your webserver's configuration side. > > The Personal Web Server is Microsoft' Freeware Version of IIS that > became available in NT's so-called Option Pack. > >Can you make sure that showmap.py is called with the "-u" option set > >to the python interpreter? This could be an extra configuration > >part somewhere in your webserver. > > As follows clearly from the above, I now ask: How do you do this > on your NT-machine? And what is this supposed to change? From the last update of the installation instructions: | For IIS the configuration for running python scripts is located | under 'Home directory-> Configuration' where an "-u" is also needed. The flag tells the python interpreter to do two things: - run the script as unbuffered - do not change line endings The first might change the behaviour of your Webserver. Apard from that I do not know what the problem of running python scripts with "Personal Webserver" could be. Can you run other scripts? You might want to ask in python and IIS related newsgroups or mailinglists if somebody encounters similiar differences. Bernhard -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 248 bytes Desc: not available Url : http://www.intevation.de/pipermail/mapit/attachments/20010529/c9e35a7a/attachment.bin