Wednesday, March 25, 2009

Problem with PostGIS ST_Buffer

Seems like I'm not getting back all of the geometry from a query.

select name, Buffer(the_geom, .12) from coastlines where iso_3_code = 'PNG';



After a bit of screwing around, the solution I found is to blow up the MULTIPOLYGON that is Papua New Guinea with ST_Dump, then ST_Buffer each of the individual polygons, and finally return those buffered polygons as a subquery result to the geomunion function. Like this:

SELECT c.name, geomunion(the_geom) FROM (SELECT name, ST_Buffer((ST_Dump(the_geom)).geom, .12) AS the_geom FROM coastlines) c WHERE c.name LIKE 'Papua%' GROUP BY c.name;

The results look like this:


Works, but it doesn't seem like this should be necessary.

Sunday, March 22, 2009

Mapserver does Dynamic Charting

Pie and bar charts from attribute data. Who knew?

http://mapserver.org/output/dynamic_charting.html

Wednesday, March 4, 2009

How to avoid partial labels with Mapserver and Tilecache

Found this in a Mapserver list message. Authored by Thomas Bonfort, so ought to be accurate.

To summarize, here is the way to *completely* avoid truncated labels
and edge artifacts:

* use a 10 pixel metabuffer in your tilecache config (the number of
metatiles is irrelevant, but as Chris points out, there'll be more
labels included if you use a 3x3 (or more) metatiling scheme than a
1x1 one :

metaTile=true
metaSize=3,3
metaBuffer=10

* set a 10 pixel edge buffer in mapserver (so no labels are rendered
in the 10 pixels on the edges of the image) :
WEB
METADATA
labelcache_map_edge_buffer "-10"
END
END

* use PARTIALS FALSE in all your label blocks

Monday, March 2, 2009

Continuous Build System head-bashing

Not really sure why I agreed to help setup our continuous build system, but here I am. Had initially started to look at Cruisecontrol, and got it to do 80% of what we needed. However, due to its java-centric nature, getting the last 20% was proving to be a bear. And then Tomcat started to be flaky and that was the straw that broke the camel's back.

Took a look at Buildbot today. It seems like a much better option for us, as it is Python based and has very few dependencies. Unfortunately, the documentation isn't very good, and although I have the skeleton of a system built, I still haven't figured out how to do a basic SVN checkout and build with it.

Reminds me of a conversation I recently had with some GIS professionals who had tried to do something with open source applications. Every single one of them complained about how many of the training resources they had looked at contained "8 different ways to do the same thing". They said they would have preferred being shown one, solid way of doing something, and then building upon that example.

Seems like a good idea to me.

9 - 28 Feb 2009

Rode to work last week in a steady, driving rain for the first time. Had purchased some fenders and clipless pedals over the weekend, and this was a good test of the new gear. Everything worked well, with the exception of some slight rubbing from the front fender when turning and going over bumps. Should be easy to get that adjusted properly. Did find out why everyone seems to have add-on mud flaps though. The spray from the front tire comes off at the perfect height to get all over your shoes. Heard that the way to deal with that is to use the plastic from a cut up water bottle. Will have to try that this weekend.

Also deleted my Twitter account last week. This is the 2nd time I've done that, and this time I think it's final. While I think the idea of sending out frequent status messages is neat, it implies a certain level of ego that I'm not willing to maintain. I'm sure someone out there cares about what I have to say, but I'm not sure I want them to read about it on Twitter. So I'm going to try the "blog thing" and will see how that works instead.