#mapnik log: Saturday 30, January 2010

2010 | 01

previous | next
00:00:02 <StormTide> its too bad the regex engine doesnt seem to do captures
00:00:13 <StormTide> that'd be really powerful
00:00:31 <Ldp__> what would you capture?
00:00:51 <StormTide> matched strings
00:01:05 <StormTide> like (\d+\d\d)
00:01:06 <StormTide> ;)
00:01:13 <StormTide> . in there
00:01:20 <Ldp__> ah wait, current regex only matches
00:01:59 <Ldp__> or replaces
00:02:09 <StormTide> hrm
00:02:14 <StormTide> replace might work
00:02:19 <Ldp__> http://www.mapnik.org/news/2009/dec/16/mapnik_regex_replace/
00:02:43 <StormTide> oh replace takes self captures eh
00:02:53 <StormTide> interesting
00:02:54 <StormTide> tries
00:03:21 <Ldp__> could you try more than 1 capture? that would be interesting
00:07:06 <StormTide> hrm
00:07:16 <StormTide> whatever's screwing up the normal rendering of floats
00:07:24 <StormTide> reeeeeeally messess up the regexp engine
00:07:54 <StormTide> <TextSymbolizer avoid_edges="1" face_name="DejaVu Sans Bold" fill="rgb(0,0,0)" name="([DEPTH]).replace('^([0-9]+.[0-9])*', '$1')" size="40"/>
00:08:07 <StormTide> results in those entries that were buggy now being 0000000000001
00:08:13 <StormTide> or 99999999999999
00:09:37 <StormTide> www.stormtide.ca/floatfun.png
00:10:24 <StormTide> too bad theres no way to force the float to a string before the regexp runs on it or something
00:10:38 <StormTide> i would have thought it would have had to do that... but i guess not
00:12:20 <StormTide> for the record, the 00001 in that pic would normally render as 9.300000000000000001 but should render as a plain 9.3
00:12:42 <springmeyer> StormTide: so...
00:12:55 <springmeyer> we commented out the regex support, remember? :)
00:13:03 <springmeyer> it requires latest ICU
00:13:12 <StormTide> if you say so?
00:13:13 <StormTide> it works
00:13:25 <StormTide> on my low-icu version heh
00:13:30 <springmeyer> yep
00:13:49 <StormTide> ... so... commented out?
00:14:01 <StormTide> appears to still be running... and working
00:14:16 <StormTide> eg if i change the 2nd param to $1 1234 ... all my data points change to 1.2 1234
00:14:21 <springmeyer> okay
00:14:25 <springmeyer> great then
00:14:48 <StormTide> ya... im not sure what the icu part was doing
00:15:00 <springmeyer> I would have thought that r1597 would have nuked support for regex overall
00:15:01 <nikq> http://trac.mapnik.org/changeset/1597, at , by dane: quick fix to allow compiling without unicode regex support to enable builds against ICU &lt;4.2
00:15:10 <springmeyer> but I guess only for unicode regex
00:16:45 <StormTide> i dunno... pretty sure im running 1597..
00:16:49 <StormTide> how would i check that
00:17:03 <springmeyer> you are
00:17:06 <springmeyer> thats how you got it to compile
00:17:15 <StormTide> ya
00:17:17 <StormTide> owell
00:17:38 <StormTide> does it try to cast it back to float for rendering or something?
00:17:52 <StormTide> im totally confused as to why i could be getting 0000001 once the regexp is applied
00:18:59 <StormTide> <TextSymbolizer avoid_edges="1" face_name="DejaVu Sans Bold" fill="rgb(0,0,0)" name="([DEPTH]).replace('^([0-9]+.[0-9])*', '$1 ft')" size="40"/>
00:19:04 <StormTide> www.stormtide.ca/withft.png
00:19:10 <Ldp__> StormTide: . is a special character. You would need \. to match a literal .
00:19:27 <StormTide> oh crap right
00:19:51 <StormTide> LOL!
00:19:53 <StormTide> even better
00:19:55 <StormTide> sec
00:20:36 <StormTide> www.stormtide.ca/notbetter.png
00:21:05 <StormTide> it puts the 00001 float issue _after_ the regex'd value that looks right
00:21:43 <springmeyer> StormTide: http://trac.mapnik.org/browser/trunk/include/mapnik/value.hpp#L586
00:21:45 <Ldp__> eh
00:21:54 <springmeyer> std::setprecision(4)
00:22:12 <Ldp__> ^([0-9]+\.[0-9])
00:22:24 <Ldp__> why do you need the *?
00:22:31 <StormTide> Ldp__, shouldnt the replace be the only part matched
00:22:36 <StormTide> hrm
00:22:37 <StormTide> tries
00:23:04 <StormTide> ya pulling the * changes nothing
00:23:20 <StormTide> springmeyer, i can try that... but seems odd that its even being called now with the regex firing
00:23:33 <Ldp__> ah wait, sure, replace not a straight capture
00:23:40 <Ldp__> ^([0-9]+\.[0-9])[0-9]*
00:23:49 *** springmeyer has quit (Read error: 104 (Connection reset by peer))
00:23:55 <Ldp__> keeping every one but the single digit after the . out of the capture
00:24:05 *** springmeyer (n=springme@c-76-28-156-154.hsd1.wa.comcast.net) has joined #mapnik
00:24:17 <StormTide> aha!
00:24:21 <StormTide> Ldp__, you rule
00:24:23 <StormTide> works now
00:24:34 <StormTide>             <TextSymbolizer avoid_edges="1" face_name="DejaVu Sans Bold" fill="rgb(0,0,0)" name="([DEPTH]).replace('^([0-9]+\.[0-9])[0-9]*', '$1')" size="40"/>
00:24:38 <StormTide> the solution to #430
00:24:39 <nikq> Ticket #430: Label of float8 data shows to many digits, http://trac.mapnik.org/ticket/430
00:24:52 <Ldp__> [0-9] could be \d probably
00:25:48 <StormTide>             <TextSymbolizer avoid_edges="1" face_name="DejaVu Sans Bold" fill="rgb(0,0,0)" name="([DEPTH]).replace('^([\d]+\.[\d])[\d]*', '$1')" size="40"/>
00:25:48 <StormTide>  works too
00:27:02 <Ldp__> don't need the [] :)
00:27:17 <Ldp__> ^(\d+\.\d)\d*
00:27:19 <StormTide> oh right
00:27:52 <StormTide> (should know his regex better)
00:28:04 <StormTide>             <TextSymbolizer avoid_edges="1" face_name="DejaVu Sans Bold" fill="rgb(0,0,0)" name="[DEPTH].replace('^(\d+\.\d)\d*', '$1')" size="40"/>
00:28:10 <StormTide> there, works wonderfully
00:28:40 <Ldp__> still doesn't help you much with 11.999999999999, assuming you would want that rounded to 12.0 ?
00:29:13 <Ldp__> so I wouldn't call it a solution to #430, more a workaround
00:29:14 <nikq> Ticket #430: Label of float8 data shows to many digits, http://trac.mapnik.org/ticket/430
00:30:01 <StormTide> Ldp__, really, the rounding doesnt matter
00:30:12 <StormTide> for my purposes .1th of a ft is more than precise enough
00:30:24 <Ldp__> that depends entirely on your data
00:30:26 <Ldp__> right :0
00:31:02 <StormTide> www.stormtide.ca/success.png
00:31:17 <StormTide> works like a charm now, even if the render is painfully slow
00:31:40 <Ldp__> did you run shapeindex on your shapefile?
00:31:53 <StormTide> since i dont know what that is... nope
00:32:42 <Ldp__> shapeindex is part of mapnik, and creates an index to your shapefile
00:33:08 <StormTide> docs/example?
00:33:25 <Ldp__> shapeindex yourshapefile.shp
00:33:59 <Ldp__> this creates yourshapefile.index, which mapnik uses to speed up shapefile access
00:34:30 <springmeyer> Ldp__: shapeindex is buggy for his data
00:34:36 <springmeyer> or for points at least
00:34:39 <Ldp__> springmeyer: ok
00:34:43 <StormTide> ran it... didnt make much of a difference
00:34:49 <StormTide> (unnoticible)
00:35:00 <StormTide> (ran it on the points file)
00:35:09 <springmeyer> StormTide: is panning, zooming slow?
00:35:12 <StormTide> yes
00:35:13 <StormTide> very
00:35:48 <springmeyer> hmm, still slow without regex?
00:36:00 <StormTide> dont think so... but lemme try
00:36:30 <StormTide> hrm
00:36:37 <StormTide> now ive done it and its core dumping
00:36:38 <StormTide> sigh
00:37:34 <StormTide> i think that index might have done it on reload
00:37:38 <StormTide> cuz this file worked like this before
00:37:41 <springmeyer> yep
00:37:43 <StormTide> attaching a debugger
00:37:47 <springmeyer> remove the index
00:37:57 <StormTide> how do you do that?
00:38:07 <springmeyer> rm *index
00:38:26 <Ldp__> springmeyer: is shapeindex documented anywhere?
00:38:37 <StormTide> /usr/bin/qgis.bin: symbol lookup error: /usr/local/lib/mapnik/input/ogr.input: undefined symbol: _ZN5boost9iostreams18mapped_file_source4initEv
00:38:43 <springmeyer> not that I am aware of
00:38:44 <Ldp__> StormTide: are you labels slow to render, or the polygons?
00:39:03 <StormTide> Ldp__, whole thingy
00:39:05 <Ldp__> you=your
00:39:12 <springmeyer> ah, hold on!
00:39:22 <springmeyer> okay....
00:39:23 <Ldp__> what if you disable the labels layer?
00:39:43 <springmeyer> so what is happening is that I switched Qnik to use OGR to read the shapefiles
00:39:58 <springmeyer> or, be be specific PointZ shapefiles
00:40:01 <StormTide> springmeyer, ya ok without the index and without the regexp
00:40:03 <StormTide> its very fast
00:40:16 <springmeyer> and OGR is slower that using the native shape driver
00:40:18 <StormTide> i see numbers
00:40:29 <StormTide> moving the map takes about 1s to redraw
00:41:19 <springmeyer> so StormTide - switch you datasource to 'shape' for all layers pointing at shapefiles
00:41:25 <springmeyer> and remove the 'ogr' reference
00:42:26 <StormTide> thats faster
00:44:41 <nikq> Mapnik Trac: Changeset [1600]: fix formatting | http://trac.mapnik.org/changeset/1600
00:44:44 <springmeyer> good
00:45:32 <nikq> Mapnik Trac: Changeset [1601]: fix formatting | http://trac.mapnik.org/changeset/1601
00:47:13 <nikq> Mapnik Trac: Changeset [1602]: repair serialization of XML filters and Text/ShieldSymbolizer 'name'  ... | http://trac.mapnik.org/changeset/1602
00:50:52 <StormTide> btw springmeyer i think there might be a mem leak or something in the reload mechanism in qnic, cuz by the time ive reloaded 4 or 5 times the performance is garbage
00:51:02 <StormTide> comes right back with a reboot of qgis tho
00:51:44 <springmeyer> StormTide: okay, not good
00:52:07 <nikq> Mapnik Trac: Ticket #505 (Unicode symbol on osx with libicucore.dylib errors in mapnik_feature.cpp) created | http://trac.mapnik.org/ticket/505
00:53:39 <nikq> Mapnik Trac: Ticket #505 (Unicode undefined symbol errors on osx when linking to libicucore.dylib) updated | http://trac.mapnik.org/ticket/505#comment:1
00:54:17 *** jctull has quit ()
00:54:45 <StormTide> www.stormtide.ca/navmap.png .... looking good tho... quite happy with the quality of this rendering
00:56:03 <springmeyer> nice
00:56:09 <springmeyer> more color's all of a sudden?
00:56:18 <StormTide> yep, playing with it
00:56:22 <StormTide> trying to come up with a nice set
00:56:38 <StormTide> its scary how easy this is to control from the xml
00:56:43 <StormTide> as compared to from qgis
00:57:46 <StormTide> have any tips for making lines look smoother/sexier?
00:58:11 <springmeyer> make them thinner?
00:58:45 <StormTide> tries that
00:59:45 <nikq> Mapnik Trac: Changeset [1604]: scons: fix up libicucore support, adding ability to pass entire path to  ... | http://trac.mapnik.org/changeset/1604
01:00:08 <StormTide> www.stormtide.ca/navmap2.png awesome
01:02:07 <nikq> Mapnik Trac: Changeset [1605]: improve shapeindex support for pointz | http://trac.mapnik.org/changeset/1605
01:03:01 <springmeyer> yep, very nice
01:06:15 *** aude_ (n=chatzill@128.241.235.189) has joined #mapnik
01:06:54 *** aude has quit (Nick collision from services.)
01:07:06 *** aude_ is now known as aude
01:09:51 *** jctull (n=jctull@adsl-75-0-13-129.dsl.renocs.sbcglobal.net) has joined #mapnik
01:35:09 <StormTide> DejaVu Sans Bold ... is there a list of valid fonts somewhere?
01:35:49 <Ldp__> http://trac.mapnik.org/wiki/UsingCustomFonts
01:36:05 <Ldp__> step 2)
01:36:19 <StormTide> danke
01:37:01 * Ldp__ is not German
01:37:36 <StormTide> ;)
01:37:53 <StormTide> im really quite impressed with what this renderer can do
01:38:01 <StormTide> this is looking so good
01:38:58 <Ldp__> great, isn't it :)
01:39:29 <StormTide> www.stormtide.ca/navmap3.png
01:39:31 <StormTide> it really is
01:41:40 <Ldp__> springmeyer: http://forum.openstreetmap.org/viewtopic.php?id=6197
01:42:54 <springmeyer> thx Ldp__
01:43:55 <Ldp__> springmeyer: the issue keeps popping up. I think I'll place a small note inside the osm.xml next time I make a commit, as they're more likely to see that than other $random_associated_documentation
01:44:02 <springmeyer> Ldp__: I happened upon that post via a google alerts post
01:44:27 <springmeyer> do you subscribe somehow?
01:44:41 <Ldp__> you can use your OSM account to login
01:45:05 <Ldp__> oh, how I found this thread? I login and just browse the new/changed threads
01:45:22 <springmeyer> oh, okay
01:45:38 <Ldp__> you can also subscribe to a thread if you want to keep informed of new comments
01:45:39 <springmeyer> I don't :)
01:45:42 <springmeyer> k
01:46:21 <Ldp__> the traffic there, except the German forum, is not that high. I usually login once or twice a day and am done in a few minutes
01:46:42 * Ldp__ is not a forum geek. Gimme a mailing list any day
01:51:53 <springmeyer> StormTide: tried semi-transparent lines yet?
01:52:03 <StormTide> oooOooo no?
01:52:06 <StormTide> dotell
01:52:13 <springmeyer> or placement="line" to wrap the text along the lines?
01:52:46 <springmeyer> `LineSymbolizer
01:52:46 <nikq> http://trac.mapnik.org/wiki/LineSymbolizer
01:52:53 <StormTide> i have not... that might be cool tho, not for this data but for later
01:53:00 <springmeyer> stroke-opacity=".5"
01:54:27 <StormTide> niiice
01:54:32 <StormTide> keeps gettin better
01:56:39 *** tcb has quit (Read error: 104 (Connection reset by peer))
01:57:00 <StormTide> its awesome that theres opensource that does this stuff so well
01:57:04 *** tcb (n=tcarobru@adsl-75-10-247-30.dsl.pltn13.sbcglobal.net) has joined #mapnik
02:03:23 *** cgs_bob has quit (Read error: 110 (Connection timed out))
02:05:10 <nikq> Mapnik Trac: Changeset [1606]: restore pretty printing of xml output (indent=4) now that we are using the  ... | http://trac.mapnik.org/changeset/1606
02:05:11 <springmeyer> I agree :)
02:06:00 *** cgs_bob (n=bob@122.135-78-65.ftth.swbr.surewest.net) has joined #mapnik
02:20:50 *** Ldp__ has quit (Remote closed the connection)
02:21:09 *** Ldp__ (n=thid@osm.xs4all.nl) has joined #mapnik
02:22:39 *** tcb has quit ()
02:31:12 *** jctull has quit ()
02:39:06 <StormTide> hrm... just my luck, placenames dont seem to be in the encs
02:50:34 *** PhurlIpv4 has quit (calvino.freenode.net irc.freenode.net)
02:50:34 *** CIA-24 has quit (calvino.freenode.net irc.freenode.net)
02:50:34 *** crust has quit (calvino.freenode.net irc.freenode.net)
02:50:39 *** crust (n=crust@vobster.nepharia.org) has joined #mapnik
02:50:52 *** PhurlIpv4 (n=mdupont@ip-81-210-245-60.unitymediagroup.de) has joined #mapnik
02:52:04 *** CIA-24 (n=CIA@208.69.182.149) has joined #mapnik
03:04:20 <StormTide> springmeyer, if there are labels within an area shpfile... is there any data usually around to dictate how those labels should be rendered.. like orientation etc
03:08:07 <nikq> Mapnik Trac: Changeset [1607]: reenamble python access to TextSymbolizer 'name' expression | http://trac.mapnik.org/changeset/1607
03:08:33 <springmeyer> StormTide: ya, sometimes
03:09:01 <springmeyer> but pretty rarely. usually you'll only find that in datasets that cost alot
03:09:30 <springmeyer> like teleatlas or navteq road data that have in-data labeling directives
03:09:55 <StormTide> if it wasnt in here, how else would all the other marine navs decide where to draw names
03:10:00 <StormTide> they all do it identically too
03:10:13 <StormTide> what field would it likely be?
03:10:34 <StormTide> theres an LNAM property that could be some sort of data...
03:10:56 <springmeyer> I've not worked with raw ENC so I don't know
03:13:57 <springmeyer> I'm going to see this guy tomorrow: http://bitbucket.org/dhelfman/maproom/
03:14:00 <springmeyer> he might know
03:14:35 <StormTide> cool
03:15:05 <springmeyer> seems like a lot of the label placement may be manual, yes
03:15:36 <StormTide> im pretty sure it cant be, cuz a lot of these gps apps can load enc files directly
03:15:39 <StormTide> and they seem to get it right
03:16:02 <StormTide> so might be some algorithm like regarding lines and overlaps
03:16:06 <StormTide> but im skeptical of that
03:16:58 <springmeyer> I would assume the GPS apps are loading RNC
03:17:12 <springmeyer> and not doing any rendering at all
03:17:25 <StormTide> some do
03:17:34 <StormTide> lemme see if i have an example handy
03:18:52 <StormTide> http://www.fugawi.com/web/products/chs_index.htm
03:19:01 <StormTide> they offer both s57 encs and bsb charts
03:22:02 <springmeyer> yep, I see
03:22:03 <springmeyer> http://www.fugawi.com/web/images/products/macenc_navionics_hr.jpg
03:22:26 <springmeyer> that would be and enc getting rendered it seems
03:22:56 <StormTide> ya, and it seems to be getting the placement right
03:23:03 <StormTide> whereas what ive got is all over the place for some reason
03:23:33 <StormTide> owell i'll have to play with it some more later
03:23:42 <StormTide> really have to go have a weekend now ;)
03:24:03 <StormTide> maybe i'll try tiling some of the raster maps, but, i was hoping to create my own basemaps so that i could customize the app more from the object catalog
03:24:15 <StormTide> if you take the raster, its kinda wysiwyg
03:24:58 <springmeyer> yep, same here. later
03:25:03 *** springmeyer has quit ()
03:34:52 *** Ldp__ has quit (Read error: 113 (No route to host))
08:32:44 *** PhurlIpv4 has quit (calvino.freenode.net irc.freenode.net)
08:32:44 *** cgs_bob has quit (calvino.freenode.net irc.freenode.net)
08:32:44 *** twain47_ has quit (calvino.freenode.net irc.freenode.net)
08:33:03 *** CIA-24 has quit (calvino.freenode.net irc.freenode.net)
08:33:03 *** crust has quit (calvino.freenode.net irc.freenode.net)
08:33:03 *** mapnikbuild_ has quit (calvino.freenode.net irc.freenode.net)
08:33:03 *** avar has quit (calvino.freenode.net irc.freenode.net)
08:33:32 *** aude has quit (calvino.freenode.net irc.freenode.net)
08:33:32 *** tomhughe` has quit (calvino.freenode.net irc.freenode.net)
08:33:32 *** racicot has quit (calvino.freenode.net irc.freenode.net)
08:33:32 *** dukeku has quit (calvino.freenode.net irc.freenode.net)