#mapnik log: Sunday 25, January 2009

2009 | 01

previous | next
02:32:04 <nikq> Mapnik Trac: Ticket #186 (Scons usability improvements) updated | http://trac.mapnik.org/ticket/186#comment:1
03:21:22 *** adakkak_away is now known as adakkak
03:23:56 <nikq> Mapnik Trac: SConstruct_usability_improvements.patch attached to Ticket #186 | http://trac.mapnik.org/attachment/ticket/186/SConstruct_usability_improvements.patch
03:29:23 <nikq> Mapnik Trac: Ticket #186 (Scons usability improvements) updated | http://trac.mapnik.org/ticket/186#comment:2
03:29:54 <nikq> Mapnik Trac: SConstruct_usability_improvements.patch attached to Ticket #186 | http://trac.mapnik.org/attachment/ticket/186/SConstruct_usability_improvements.patch
04:31:50 <nikq> Mapnik Trac: SConstruct_usability_improvements.patch attached to Ticket #186 | http://trac.mapnik.org/attachment/ticket/186/SConstruct_usability_improvements.patch
04:35:35 <nikq> Mapnik Trac: SConstruct_usability_improvements.patch attached to Ticket #186 | http://trac.mapnik.org/attachment/ticket/186/SConstruct_usability_improvements.patch
05:52:25 *** adakkak is now known as adakkak_away
06:39:19 <nikq> Mapnik Trac: Ticket #193 (Bus Error with during render in cairo extract_surface()) created | http://trac.mapnik.org/ticket/193
06:53:40 <nikq> Mapnik Trac: Ticket #193 (Bus Error during Image render at cairo extract_surface()) updated | http://trac.mapnik.org/ticket/193#comment:1
06:56:02 <nikq> Mapnik Trac: Ticket #193 (Bus Error during Image render at cairo extract_surface()) updated | http://trac.mapnik.org/ticket/193#comment:2
06:56:34 *** springmeyer has quit ()
07:23:34 *** __d3f0__ has quit (Read error: 104 (Connection reset by peer))
16:36:21 *** Berteun (i=berteun@berteun.nl) has joined #mapnik
16:37:09 <Berteun> Hello, I'm doing my first steps with mapnik, and the projections are making my head hurt.
16:37:40 <Berteun> I have two data sources, one in Dutch grid, the other a PostGIS database with OSM data for the Netherlands.
16:37:56 <Berteun> I'd like to project them both onto a map in Dutch grid (Amersfoort New).
16:39:11 <Berteun> So, I make an xml file with <Map srs="+proj for dutch grid"> and two layers, the first for the data in the dutch projection, with the same srs as the map element, the second for OSM with srs="+proj merc ....", whatever is relevant for OSM.
16:39:32 <Berteun> But, the image does not show the OSM data.
16:40:06 <Berteun> If I reproject the Dutch data to the OSM format however, it does work.
16:40:29 <Berteun> Since I'm only copy pasting examples together, I don't really have a clue how to start investigating the problem.
16:42:14 *** springmeyer (n=dane@c-24-19-50-92.hsd1.wa.comcast.net) has joined #mapnik
16:44:16 <nikq> Mapnik Trac: Ticket #193 (Bus Error during Image render at cairo extract_surface()) closed | http://trac.mapnik.org/ticket/193#comment:3
16:46:20 <springmeyer> Berteun: you still around? I saw your question in the new logs: http://mapnik.dbsgeo.com/days/2009-01-25
16:46:38 <Berteun> Yes, i'm here.
16:46:53 <springmeyer> cool, your approach seems correct.
16:47:01 <springmeyer> what format is your dutch data in?
16:47:10 <Berteun> They are ESRI shape files.
16:47:28 <Berteun> I'm using Python, I think however that the OSM reprojection goes wrong (just discovered that)
16:47:43 <springmeyer> ok.  and you are sure that your osm postgis db is in mercator?
16:47:44 <Berteun> >>> m.layers[0].envelope()
16:47:46 <Berteun> Envelope(13599.999985,306799.999985,277999.999985,619299.999985)
16:47:55 <Berteun> That makes sense for Dutch coordinates.
16:48:03 <springmeyer> okay
16:48:13 <Berteun> Which should be 0 < x < 300k and 300k < y < 700k or so.
16:48:27 <Berteun> But the OSM data becomes: Envelope(-20037508.0,-19929239.0,20037508.0,19929239.0)
16:48:38 <Berteun> Which is wrong...
16:50:19 <springmeyer> yes, those y coordinates look too big
16:51:52 <springmeyer> so how did you get your OSM db populated? ie, what version of osm2pgsql? and any commandline options?
16:52:31 <Berteun> It's not my database, but I'll ask.
16:53:31 <Berteun> It's version 0.55-20090118
16:53:50 <Berteun> Of osm2pgsl, and it is run with: osm2pgsql --slim -m -c -d osm -S default.style planet-nl-latest.osm.gz
16:55:09 <springmeyer> ah, wait, that extent actually looks okay for the mercator projection...
16:55:31 <springmeyer> Envelope(-20037508,-20037508,20037508,20037508) is the max extents for merc...
16:55:45 <Berteun> Okay.
16:56:08 <springmeyer> thx, so yes the '-m' flags confirms that the proj should be mercator in the db, great
16:57:27 <Berteun> http://tile.openstreetmap.nl/~berteun/cbs_kaart.xml <- That's my mapnik file.
16:57:39 <Berteun> And, as said, if I project onto mercator, it does work.
16:58:00 <Berteun> But if I project onto Dutch grid it does not, maybe there are some projection limitations I'm not aware of?
17:00:55 <springmeyer> hmmm. can you try removing the '<Parameter name="extent">-20037508,-19929239,20037508,19929239</Parameter>'
17:01:09 <springmeyer> and setting estimate_extent = true
17:01:52 <springmeyer> the next thing I would do to debug is to rebuild mapnik in DEBUG mode which will output the exact SQL being sent to PostGIS
17:01:53 <Berteun> It takes longer to draw already!
17:01:56 <springmeyer> :)
17:02:00 <Berteun> Oh yes!
17:02:26 <springmeyer> have you done a source build of mapnik? or packaged?
17:02:48 <Berteun> I've done a SVN checkout and build yesterday.
17:03:15 <springmeyer> okay. so to get debug you can do '$ python scons/scons.py DEBUG=y install
17:03:49 <Berteun> It works though if I let it estimate the extent by itself!
17:04:12 <springmeyer> ah, interesting
17:04:44 <Berteun> And it looks great. :D
17:04:48 * springmeyer wonders whether the "extent" parameter is not being reprojected properly in mapnik then....
17:05:42 <springmeyer> I would assume that the "extent" parameter should be specified in the projection of the data, irregardless of whether it is being reprojected, but maybe that is not the case?
17:06:13 <springmeyer> jburgess or jburgess_ might know when he comes around...
17:06:35 <springmeyer> .PostGIS
17:06:47 <Berteun> Envelope(334105.28125,6555813.5,822429.5625,7118443.5) is the estimated extent.
17:07:21 <springmeyer> ah, and that looks like dutch coordinates, eh?
17:07:53 <Berteun> No, the x is too high for Dutch.
17:09:12 <springmeyer> okay.
17:12:06 <Berteun> If I don't reproject, i.e. project to mercator, I get the same estimated extent.
17:15:47 <Berteun> Could it be that the extent I provide does not make enough sense for the Dutch grid?
17:15:55 <Berteun> Dutch grid only makes sense around the Netherlands.
17:16:04 <Berteun> Not around the whole world, which I first said.
17:19:35 <Berteun> Reducing the fixed extent to a sensible area also works.
17:20:04 <Berteun> So I guess it isn't drawn because it doesn't make sense to want to fit the whole world in the Dutch system.
17:20:09 <Berteun> Thank you!
17:20:47 <springmeyer> interestings. good to hear
17:21:05 <springmeyer> I would assume that specifying the whole worl extent in mercator would work fine.
17:21:24 <Berteun> Yeah, but perhaps it thinks "i cannot reproject this".
17:21:36 <springmeyer> but yet, perhaps you are right that somewhere in the reprojection because those extents do not 'work' for the dutch proj
17:21:39 <springmeyer> ... it borks :)
17:21:45 <springmeyer> yup
17:22:16 <springmeyer> great, well specifying the local Envelope using "extent" is ideal for speed, so sounds like you are good to go!
17:22:24 <Berteun> Indeed!
17:22:28 <Berteun> http://tile.openstreetmap.nl/~berteun/cbs2.png <- I'm happy with it. :)
17:22:36 <Berteun> cbs.png is the one with mercator projection.
17:23:03 <springmeyer> cool, looks nice
17:23:23 <springmeyer> Berteun: making a note of that 'gocha' when using a custom projection would be cool here: http://trac.mapnik.org/wiki/PostGIS
17:25:16 <Berteun> I'll do that after dinner.
17:25:22 <springmeyer> k.
17:25:34 <springmeyer> oh Berteun: do you know if this Dutch proj has an EPSG code?
17:26:17 <Berteun> Yes, it does. EPSG:28992 as far as I know, but I have been told that the definition PROJ has is not completely correct.
17:27:24 <springmeyer> okay, thx!
17:27:28 * springmeyer is looking at: http://spatialreference.org/ref/epsg/28992/
17:27:28 <Berteun> That's why I use the long definition.
17:27:40 <springmeyer> ya, with the towgs params I noticed...
17:27:55 <Berteun> Yes, that's the extra part, but that's still magic for me. :)
17:28:17 <springmeyer> at spatialreference.org we are now keeping (in v2) the extents for each projection, epsg ang user submitted
17:28:27 <springmeyer> so, with a little work I could extent this link: http://spatialreference.org/ref/epsg/28992/mapnik/
17:29:15 <springmeyer> to also output the '<Parameter name="extent">334105.28125,6555813.5,822429.5625,7118443.5</Parameter>
17:33:00 <springmeyer> ah, and it looks like for your projection the http://spatialreference.org/ref/epsg/28992/proj4/ matches exactly with the exception of the toWGS84 params
17:33:08 <springmeyer> and those are planning to be added:  http://trac.spatialreference.org/ticket/1
18:22:26 *** D3f0 (n=defo@190.176.220.222) has joined #mapnik
18:26:24 *** D3f0 has quit (Remote closed the connection)
18:26:52 *** D3f0 (n=defo@190.176.220.222) has joined #mapnik
18:38:17 *** CIA-22 has quit (Remote closed the connection)
18:48:37 *** CIA-22 (n=CIA@208.69.182.149) has joined #mapnik
18:48:53 <nikq> Mapnik Trac: Ticket #117 (Expose proj_transform in python bindings) reopened | http://trac.mapnik.org/ticket/117#comment:6
18:57:35 <scruggs> sweet! mapnik is running on my ARM board!
18:59:35 <springmeyer> scruggs: awesome.
19:02:04 <nikq> Mapnik Trac: PostGIS edited | http://trac.mapnik.org/wiki/PostGIS?version=11
19:02:14 <nikq> Mapnik Trac: Changeset [822]: + added ability to transform Envelopes in addition to Coords in new python  ... | http://trac.mapnik.org/changeset/822
19:02:35 <Berteun> Yeah, I added the note. :)
19:04:31 *** adakkak_away is now known as adakkak
19:04:36 <nikq> Mapnik Trac: Changeset [823]: Fix r # for last commit note | http://trac.mapnik.org/changeset/823
19:06:38 <nikq> Mapnik Trac: Ticket #117 (Expose proj_transform in python bindings) closed | http://trac.mapnik.org/ticket/117#comment:7
19:06:45 <adakkak> is there a site that shows you what a map looks in different coordinates?
19:08:31 <springmeyer> adakkak: I don't think so, but I've been considering adding that to spatialreference.org
19:09:01 <springmeyer> the tricky thing is that you need appropriate data for each projection system in order to properly show what a map would look like
19:09:51 <adakkak> what do the pictures on each projection mean then?
19:10:05 <springmeyer> you can't for example, just take global data and reproject it to any projection, for the reason that Berteun just ran into (see: http://trac.mapnik.org/wiki/PostGIS?action=diff&version=11)
19:10:33 <springmeyer> adakkak: what do you mean by pictures?
19:11:28 <adakkak> there are maps on each page on spacialreference.org ; ex. http://spatialreference.org/ref/epsg/4891/ shows the world map with lines on it
19:14:39 <springmeyer> ah, right on sr.org... those are 'graticules' over the projections extent
19:14:49 <CIA-22> mapnik: dane * r822 /trunk/ (bindings/python/mapnik_proj_transform.cpp CHANGELOG): + added ability to transform Envelopes in addition to Coords in new python ProjTransform, closes #117
19:14:50 <nikq> Ticket #117: Expose proj_transform in python bindings, http://trac.mapnik.org/ticket/117
19:14:50 <CIA-22> mapnik: dane * r823 /trunk/CHANGELOG: Fix r # for last commit note
19:15:01 <springmeyer> so it takes a world map in WGS84/Geographic projection and tries to plot the relevant area
19:15:43 <springmeyer> adakkak: what we need is functionality to generate the pictures like those at the bottom of: http://code.google.com/p/mapnik-utils/
19:16:47 <adakkak> is the extent of the map defined in the projection or not?
19:16:53 <springmeyer> no
19:17:28 <springmeyer> it is stored in a separate database, and is often unknown and spatialreference.org fails when it is unknown
19:18:53 <springmeyer> adakkak: Berteun and I were just chatting about adding the extent of a projection (when available) to the mapnik helper here: http://spatialreference.org/ref/epsg/28992/mapnik/
19:18:53 <Berteun> WIkipedia has a few examples of different map projections, and the way in which they distort areas.
19:19:29 <Berteun> springmeyer: It should be in the coordinates of the source system, shouldn't it?
19:19:41 <Berteun> In that case, the Dutch coordinates.
19:20:33 <springmeyer> Berteun: yes
19:22:22 <adakkak> I want to help, is there a place to start. I know little about coordinate projections other than that they exist. And from my understanding all the is needed is the bbox for each projection, right?
19:22:48 <adakkak> btw. does mapnik call the bbox the envelope?
19:23:54 <CIA-22> mapnik-utils: dane.springmeyer * r506 /example_code/proj_transform: Add folder to demo new python reprojection support between two projected systems (see https://trac.mapnik.org/ticket/117)
19:27:02 <Berteun> -3000, 300000,289000,629000 is the extent for the Dutch coordinates (well actually the area is defined by a 11-point polygon, but those are the extremes)
19:27:04 *** __d3f0__ (n=defo@190.176.206.57) has joined #mapnik
19:29:31 *** jburgess_ has quit (Remote closed the connection)
19:32:37 <scruggs> is there anything I need to do in my mapfile to have mapnik know I've run shapeindex, or does it automagically do that check?
19:38:38 <springmeyer> ah Berteun: were you noticing that spatialreference.org on the main page of a projection shows the printed 'Bounds' in WGS84? I though you were talking about the mapnik xml snippet thing...
19:39:33 <springmeyer> adakkak: you want to help with spatialreference.org? sure, its written in django so if you are into python checkout the source code from http://svn.spatialreference.org/trunk/
19:39:58 <springmeyer> we've also got a TODO list on the main page: http://trac.spatialreference.org/
19:40:31 <springmeyer> adakkak: what do you mean by 'does mapnik call the bbox the envelope?' can you explain more?
19:41:21 <springmeyer> Berteun: fyi: http://code.google.com/p/mapnik-utils/source/detail?r=507
19:41:52 <adakkak> in the example code they do lyr.envelope() , what is the function of the envelope?
19:42:46 <springmeyer> the Envelope object in mapnik is used both to set the desired area that a map will show and also to 'clip' layers to that area
19:43:26 <springmeyer> all zooming of the map AOI (area of interest) is down using Envelopes...
19:43:33 <springmeyer> down/done :)
19:44:15 <Berteun> springmeyer: I see the WGS 84 borders, do you know how those have been defined? I think they're a bit off.
19:44:35 <adakkak> so it's like an automatic bounding box
19:44:46 *** D3f0 has quit (Read error: 110 (Connection timed out))
19:46:17 <springmeyer> Berteun: yes they came from the postgresql inserts from: http://info.ogp.org.uk/geodesy/CurrentDB.html
19:46:57 <Berteun> Sounds official enough...
19:46:59 <springmeyer> Berteun: they *should* be unmanipuled by spatialreference.org, but I should probably reconfirm that if you think they are off...
19:48:02 <CIA-22> mapnik-utils: dane.springmeyer * r507 /example_code/proj_transform/nl_merc_transformation.py: Adding test script for epsg:28992 to epsg:900913 reprojection
19:48:59 <Berteun> springmeyer: I've found this PDF (through the Dutch wikipedia) http://www.ncg.knaw.nl/Publicaties/Groen/pdf/43Referentie.pdf (bilingual), on page 105 it has the corners of the validity region for the dutch coordinates.
19:49:59 <cmarqu> Does it make a difference to mapnik whether I give it multiple little GeoTIFFs or a big combined one? If I only use a small area that would be covered by one of the little ones, would it still hold the other ones in memory?
19:50:01 <springmeyer> okay, if you think we're off you could register here: http://trac.spatialreference.org/register and I'll take a closer look at some point
19:50:31 <Berteun> Should I file a ticket?
19:52:43 <springmeyer> scruggs: mapnik should find any shapefile index with the same name but an 'index' extention
19:52:47 <springmeyer> scruggs: see https://trac.mapnik.org/browser/trunk/plugins/input/shape/shape.cpp#L133
19:53:07 <springmeyer> Berteun: please do
19:54:46 <springmeyer> Berteun: perhaps we should allow users to make addendums to projections in some way.... we'd keep the epsg 'official' info intact but find some way to allow folks improve the metadata
19:54:59 *** __d3f0__ has quit (Remote closed the connection)
20:15:01 <scruggs> springmeyer: thanks. thats what I was looking for
21:32:40 *** Mrfo has quit ("(Deviant 1.0)")
21:55:53 <springmeyer> Berteun: thanks for the ticket, also fyi, I've added the projected coordinates to the spatialreference.org display: http://spatialreference.org/ref/epsg/28992/
21:59:29 <Berteun> Ah, I see.
21:59:31 <Berteun> Nice.
22:04:16 *** adakkak is now known as adakkak_away
22:09:10 *** D3f0 (n=defo@190.176.206.57) has joined #mapnik
23:23:28 *** djully4 (n=djully4u@dyn-86.106.34.129.tm.upcnet.ro) has joined #mapnik
23:25:51 *** djully4 has quit (Client Quit)
23:41:47 <nikq> Mapnik Trac: Ticket #191 (PolygonPatternSymbolizer broken with Cairo) updated | http://trac.mapnik.org/ticket/191#comment:6