#mapnik log: Saturday 14, February 2009

2009 | 02

previous | next
00:18:50 *** cremaster (i=blotanic@vpn-wireless-client-pool-245-11.cpmc.columbia.edu) has joined #mapnik
01:15:16 *** D3f0 (n=defo@190.176.194.151) has joined #mapnik
03:19:33 *** cremaster has quit (Read error: 110 (Connection timed out))
03:40:56 *** cremaster (i=blotanic@vpn-wireless-client-pool-245-4.cpmc.columbia.edu) has joined #mapnik
03:46:08 *** matt_c (n=mcroydon@137.147.45.66.cm.sunflower.com) has joined #mapnik
04:22:50 *** Mrfo (i=Mrfo@pool-96-231-166-17.washdc.fios.verizon.net) has joined #mapnik
04:45:02 *** nikq has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** ser has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** racicot has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** aled has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** jburgess has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** Berteun has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** dodobas has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** jbglaw has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** crschmidt has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** D3f0 has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** cmarqu has quit (kubrick.freenode.net irc.freenode.net)
04:45:02 *** TomH1 has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** scruggs_ has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** jbronn has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** dreamil has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** stamf has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** ChanServ has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** springmeyer has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** Mrfo has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** dukeku has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** CIA-23 has quit (kubrick.freenode.net irc.freenode.net)
04:45:03 *** JeLuF has quit (kubrick.freenode.net irc.freenode.net)
04:45:32 *** Mrfo (i=Mrfo@pool-96-231-166-17.washdc.fios.verizon.net) has joined #mapnik
04:45:32 *** D3f0 (n=defo@190.176.194.151) has joined #mapnik
04:45:32 *** TomH1 (n=tom@gate.compton.nu) has joined #mapnik
04:45:32 *** nikq (n=nikq@li21-121.members.linode.com) has joined #mapnik
04:45:32 *** racicot (n=chatzill@dsl-209-166-85-189.whidbey.net) has joined #mapnik
04:45:32 *** scruggs_ (n=chris@72-161-105-25.dyn.centurytel.net) has joined #mapnik
04:45:32 *** crschmidt (i=crschmid@helios.crschmidt.net) has joined #mapnik
04:45:32 *** jbglaw (n=jbglaw@lug-owl.de) has joined #mapnik
04:45:32 *** ser (n=ser@sergiusz.pawlowicz.name) has joined #mapnik
04:45:32 *** aled (n=chatzill@socksgw1.ncl.ac.uk) has joined #mapnik
04:45:32 *** cmarqu (i=colin@oemcomputer.oerks.de) has joined #mapnik
04:45:32 *** jbronn (n=jbronn@70-138-113-15.lightspeed.hstntx.sbcglobal.net) has joined #mapnik
04:45:32 *** jburgess (n=jburgess@bb-87-80-234-70.ukonline.co.uk) has joined #mapnik
04:45:32 *** CIA-23 (n=CIA@208.69.182.149) has joined #mapnik
04:45:32 *** dreamil (n=swapnil@freemap.in) has joined #mapnik
04:45:32 *** Berteun (i=berteun@berteun.nl) has joined #mapnik
04:45:32 *** dodobas (n=dodobas@open.geof.hr) has joined #mapnik
04:45:32 *** stamf (n=antstam@nat/yahoo/x-f1013e020f8aa8a4) has joined #mapnik
04:45:32 *** JeLuF (i=jf@mormo.org) has joined #mapnik
04:45:32 *** dukeku (i=dukeku@adhd.irule.net) has joined #mapnik
04:45:55 *** springmeyer (n=dane@c-24-19-50-92.hsd1.wa.comcast.net) has joined #mapnik
04:45:55 *** ChanServ (ChanServ@services.) has joined #mapnik
05:27:00 *** cremaster has quit ()
06:03:53 *** D3f0 has quit (Read error: 54 (Connection reset by peer))
11:23:11 *** aba (n=aba@2001:a60:f006:deb:0:0:0:1) has joined #mapnik
11:24:10 <aba> Hi. Have there been any news in the recent months on "easy" definitions of maps (except the css-mapping, that I already know of)?
11:35:49 *** matt_c has quit ()
11:36:14 <aba> and how can I generate an svg-file with mapnik?
11:39:07 <jburgess> aba: using what language? The C++ demo creates an SVG version http://trac.mapnik.org/browser/trunk/demo/c%2B%2B/rundemo.cpp
11:39:57 <aba> jburgess: python.
11:40:25 <jburgess> I'm afraid the python run demo does not do svg, but it can be done in python
11:40:40 <aba> jburgess: I'll take a look and comeback with questions :)
11:41:11 <jburgess> actually I was wrong, the python rundemo does do SVG too: http://trac.mapnik.org/browser/trunk/demo/python/rundemo.py
11:41:26 <jburgess> see line 328+
11:41:35 <aba> oh, better.
11:41:40 <aba> then generate_image doesn't
11:41:44 <Berteun> You need pycairo support.
11:43:16 <jburgess> generate_image could be enghanced to produce SVG, it was originally written before a lot of these additional formats were added
11:44:37 <jburgess> If you want an example of using all the different formats, try looking at the code from the OSM export tab: http://trac.openstreetmap.org/browser/sites/tile.openstreetmap.org/cgi-bin/export
11:44:47 <aba> Boost.Python.ArgumentError: Python argument types in mapnik._mapnik.render(Map, cairo.SVGSurface)
11:44:50 <aba> did not match C++ signature: render(mapnik::Map, mapnik::Image32 {lvalue}) render(mapnik::Map, mapnik::Image32 {lvalue}, unsigned int, unsigned int)
11:45:06 <aba> puh. that error tells me nothing
11:45:14 <jburgess> that suggests you have mixed up install
11:45:16 <aba> jburgess: great, cool
11:45:35 <jburgess> do you have both a pre-compiled & custom compiled versions installed?
11:45:37 <aba> jburgess: how "mixed up install"
11:45:45 <aba> shouldn't, but possible.
11:46:08 <jburgess> the C++ mapnik library it is using isn't built from the same code as the python bindings
11:47:27 <jburgess> actually, forget that, I think there is a mistake in your code
11:47:42 <jburgess> it looks like you are asking it to render SVG output to a bitmap buffer
11:47:45 <aba> bah, couldn't I detect that two days earlier with the chance to binNMU the files?
11:48:14 <Berteun> Well, if you start python and type from mapnik import render
11:48:37 <Berteun> And then help(render), it should list one C++ signature with a PycairoSurface* .
11:48:48 <jburgess> aba: chances are that you're trying to use the agg renderer, you need to switch to using cairo
11:50:21 <aba> it only lists:
11:50:21 <aba>     C++ signature:
11:50:22 <aba>         render(mapnik::Map, mapnik::Image32 {lvalue}, unsigned int, unsigned int) -> void*
11:50:24 <jburgess> see lines 101 - 104 in the 'export' code I posted earlier
11:50:25 <aba>     C++ signature:
11:50:27 <aba>         render(mapnik::Map, mapnik::Image32 {lvalue}) -> void*
11:50:44 <jburgess> right, SVG output doesn't uses Image32's
11:50:58 <jburgess> your trying to use the AGG render
11:51:12 <aba> hm.
11:51:19 <aba> so that's a compile-time setting?
11:51:59 <aba> and what's the downside of changing that?
11:52:03 <jburgess> sort of. Hold on a sec. It will be quicker for me to rewrite generate_image.py for you
11:53:14 <aba> http://paste.debian.net/28337/ is what I have now (and what gives the error)
11:55:14 <Berteun> I reckon Pycairo support or cairo support was not detected during configuration.
11:58:08 <jburgess> what you posted works for me
11:58:17 <jburgess> what problem do you see?
11:58:17 <aba> http://buildd.debian.org/fetch.cgi?&pkg=mapnik&ver=0.5.1-3&arch=amd64&stamp=1218308719&file=log indicates so, yes.
11:58:29 <aba> jburgess: the exception I pasted above.
11:58:42 <aba> seems to be that build-requirements were missing
11:58:48 <jburgess> I think you posted more than one
11:59:59 <Berteun> That build log doesn't show any cairo related lines...
12:00:11 <aba> http://paste.debian.net/28339/
12:00:43 <aba> Berteun: does adding cairo as build-dep and removing agg solve the issues? or anything more?
12:00:57 <Berteun> There's no need to remove agg, those can coexist.
12:01:03 <aba> even better.
12:01:03 <jburgess> I'm not sure that mapnik-0.5.1 had any cairo support?
12:01:24 <Berteun> I don't know either, I use the SVN version.
12:01:33 <aba> so it might be only in the svn version?
12:02:02 <jburgess> as you said, there is no mention of cairo in the 0.5.1 build log you posted
12:03:20 <aba> there is no mention of cairo in the source either.
12:03:34 <aba> ok, that settles it.
12:03:48 <aba> thanks for your support, I'll get a newer version of mapnik first.
12:48:02 *** cytrinox (n=cyx@Ya34d.y.pppool.de) has joined #mapnik
13:09:32 *** jburgess has quit (Remote closed the connection)
13:34:33 *** jburgess (n=jburgess@bb-87-80-234-70.ukonline.co.uk) has joined #mapnik
13:38:11 *** D3f0 (n=defo@190.176.232.63) has joined #mapnik
13:44:59 *** jburgess has quit (Read error: 104 (Connection reset by peer))
13:56:23 *** Berteun has quit (kubrick.freenode.net irc.freenode.net)
13:56:23 *** aled has quit (kubrick.freenode.net irc.freenode.net)
13:56:23 *** dodobas has quit (kubrick.freenode.net irc.freenode.net)
13:56:42 *** aled (n=chatzill@socksgw1.ncl.ac.uk) has joined #mapnik
13:56:42 *** dodobas (n=dodobas@open.geof.hr) has joined #mapnik
13:56:42 *** Berteun (i=berteun@berteun.nl) has joined #mapnik
14:08:14 *** jburgess (n=jburgess@bb-87-80-234-70.ukonline.co.uk) has joined #mapnik
15:36:46 *** D3f0 has quit (Remote closed the connection)
16:00:57 *** D3f0 (n=defo@190.176.194.151) has joined #mapnik
17:49:16 *** aled has quit (Remote closed the connection)
19:45:44 *** KAeL (n=KAeL@withinthebox.net) has joined #mapnik
19:45:59 <KAeL> hi
19:46:40 <KAeL> i'm trying to compile mapnik svn with cairo support
19:47:04 <KAeL> but i don't understand how it is possible
19:47:33 <KAeL> cairo includes freetype-foo.h that uses setjmp.h
19:47:57 <KAeL> bah libpng checks if _SETJMP_H_ is already defined than raise an error...
20:06:26 <jburgess> KAeL: I vaguely remember running into this about a year ago, a fix then was to make sure that libpng was included first, e.g. http://trac.mapnik.org/changeset/642
20:07:44 <jburgess> In this case I think it was the boost/python.hpp which was including setjmp.h
20:16:30 <jburgess> KAeL: in case you are wondering, I just recompiled the SVN code withouut issue. What are you compiling it on?
20:21:29 <KAeL> debian etch
20:21:44 <KAeL> + latest cairo (from tgz)
20:22:39 <KAeL> it seems cairo is included before libpng
20:23:05 <jburgess> you can probably apply a very similar fix to what was done before, add a #include for ing.h before the cairo include
20:23:13 <jburgess> s/ing.h/png.h/
20:23:31 <KAeL> i'm going to try that
20:29:16 <jburgess> I don't see any includes of setjmp.h inside the cairo-1.8.6 or pycairo-1.8.2 code, but it must getting getting pulled in via something else.
20:29:56 <jburgess> the only way to be sure is to look at the preprocessor output
20:29:59 <KAeL> here is where setjmp.h is included from :
20:30:01 <KAeL> In file included from /usr/include/freetype2/freetype/config/ftstdlib.h:169, from /usr/include/freetype2/freetype/config/ftconfig.h:43, from /usr/include/freetype2/freetype/freetype.h:41, from /home/kael/microbuilder/local/include/cairo/cairo-ft.h:48, from /home/kael/microbuilder/local/include/cairomm-1.0/cairomm/fontoptions.h:26,
20:30:06 <KAeL>  from /home/kael/mcrobuilder/local/include/cairomm-1.0/cairomm/surface. h:36, from include/mapnik/graphics.hpp:40, from include/mapnik/image_util.hpp:30, from src/image_util.cpp:26:
20:30:10 <KAeL> hum :)
20:30:54 <KAeL> http://friendpaste.com/5k7Z0ktkPKem6g8XCRRykE
20:31:14 <jburgess> thats right, you did mention it was via freetype.
20:33:57 <KAeL> but i can't move #include mapnik/png_io.hpp before mapnik/image_util.hpp
20:35:11 <jburgess> have you tried a patch like changeset 642 which just includes png.h? http://trac.mapnik.org/changeset/642
20:35:12 <nikq> http://trac.mapnik.org/changeset/642, at , by artem: setjmp png patch from JonB
20:35:38 <jburgess> I think I tried to do the same as you and move png_io.hpp and found that wouldn't work
20:36:52 <jburgess> provided the png.h gets to include the setjmp header in its own special way, before anyone else does, then I think everything is happy
20:41:04 <KAeL> i'll try something similar to changeset 642
20:41:05 <nikq> http://trac.mapnik.org/changeset/642, at , by artem: setjmp png patch from JonB
20:43:46 <jburgess> For reference, this was my post about this patch to mapnik-devel: http://lists.berlios.de/pipermail/mapnik-devel/2008-January/000456.html
20:53:24 <KAeL> similar thing (in src/image_util.cpp)  seems to fix the problem
20:53:44 <KAeL> i'll try to reproduce the problm on another debian install (lenny)
20:59:39 *** springmeyer has quit ()
21:02:12 *** springmeyer (n=dane@c-24-19-50-92.hsd1.wa.comcast.net) has joined #mapnik
21:15:18 <KAeL> seems to works fine (without patch) on my lenny (with every dpendencies taken from debian packages)
21:16:04 <KAeL> i'll run the same test on etch
21:17:31 <KAeL> I really have no clue why it fails on etch with some dependencies compiled by hand
21:18:20 <springmeyer> anyone have a sense what it would take to add a mapnik::Image.fromstring() method?
21:19:09 <jburgess> springmeyer: what format of image are you proposing it should take? png, raw bytes etc?
21:19:56 <jburgess> I wrote one routine to create an Image32 from a cairo image but that was for a specific bitmap format only
21:19:56 <springmeyer> hmm. good question. probably raw bytes
21:20:24 <springmeyer> I have a collegue who would like to integrate in-memory numpy arrays
21:20:25 <jburgess> unfortunately there are several common formats, RGBA, ARGB, other ones which aren't 32bit
21:22:12 <jburgess> for generated data, you might only want an 8bit greyscale image, where you have 1 byte per pixel
21:23:11 <springmeyer> okay, hence Image32
21:23:19 <springmeyer> essentially the big picture goal would simply to be able to read-in an in memory raster ( and he is working with GeoTiff/numpy types)
21:23:58 <springmeyer> short of a Memory datasource provider for rasters I figured working directly with Image32 might be another route
21:27:41 <jburgess> the code I wrote for creating an Image32 from a cairo imageSurface is in grapics.cpp, you could perhaps derive something similar for a numpy image format, but I'm not familiar with them.
21:27:53 <jburgess> make that graphics.cpp
21:28:22 <springmeyer> cool
21:28:26 <jburgess> It is quite easy to do for specific cases but harder to implement generically
21:28:27 * springmeyer was just peeking at: http://code.activestate.com/recipes/498278/
21:28:42 <springmeyer> okay, great to know, thx jburgess
21:29:09 <springmeyer> the fellow is not a mapnik user so he just needs to suss out whether to jump over from mapserver to do what he needed
21:29:15 <jburgess> of course, if you can convert numpy image to a Cairo ImageSurface, then you can convert that to an Image32
21:32:21 *** aub (n=aubrey@cpe-72-227-134-148.nyc.res.rr.com) has joined #mapnik
21:35:48 <jburgess> from the looks of things, images in numpy are simply an aribtrary array of a given x, y & element size.
21:36:58 <jburgess> There don't appear to be any limits or conventions on how you store the data, though many people seem to use a 32bit int and store RGBA in it.
21:38:56 <jburgess> The lack of a defined image format in numpy makes it hard to do in a generic way.
21:39:45 <jburgess> One thing we could consider is making a method of creating an Image to/from a PIL image, that is likely to be the most common interchange format for python programs
21:41:17 <springmeyer> yes. yes
21:41:51 <springmeyer> I think he was thinking he could turn the numpy array into a geotiff in memory and then read that into mapnik
21:42:18 <springmeyer> maybe he could just convert numpy to png and then read in an Image32
21:42:29 <jburgess> That might be possible, but you'd need to consult the gdal docs to see where it will read the geotiff from
21:43:05 <jburgess> geotiff obviously implies it is geo-referenced which a basic Image32 won't be
21:43:28 <springmeyer> yes
21:43:46 <springmeyer> I'll need to check with him on the exact requirements.
21:44:14 <springmeyer> the reason I was thinking of an Image.fromstring() method is that potentially for standard tiling schemes that would be fine
21:44:56 <springmeyer> I know that migurski is after a function in that way so he does not need to use PIL.Image.fromstring() for some mapnik blending stuff
21:46:02 <jburgess> it would be fairly straight forward to create an image from a standardised bitmap format like png
21:46:28 <jburgess> the code obviously does that already when rendering png based symbols
21:46:38 <springmeyer> cool.
21:46:51 * springmeyer noticed migurski's idea at #184
21:47:10 <springmeyer> nikq: hello ?
21:47:30 <springmeyer> nikq: tell springmeyer if you are awake :)
21:47:30 <nikq> You can tell yourself that.
21:47:40 <springmeyer> #184
21:47:40 <nikq> Ticket #184: Prevent initialization of mapnik.Image prior to mapnik.Render, http://trac.mapnik.org/ticket/184
21:49:08 <jburgess> I think Artem agreed with me that it works OK as it is at the moment, the image does not get filled if you don't specify a background colour for the map.
21:50:20 <jburgess> migurski wanted a setting of 'transparent' to do the same thing, which currently sets the whole image to transparent erasing any existing image
21:51:04 <jburgess> I know it isn't well documented that the bgcolor is an optional setting on the map object, I did not realise until I read the source code
21:51:09 <springmeyer> ya, right I'm only mentioning the fromstring reference
21:51:28 <springmeyer> but ya I was also unclear that the bgcolor was optional :)
21:51:45 <springmeyer> which is clear from my floundering on this one: #167 :)
21:51:46 <nikq> Ticket #167: Map pickling failure due to mapnik.Color object, http://trac.mapnik.org/ticket/167
21:54:31 <jburgess> a tostring method which takes width, height and a fixed RGBA format would be quite simple to implement
23:45:52 *** aub has quit ()