Sunday, May 10, 2009

Why does Twitter suck so badly?

Kind of ironic that the reason I'm writing about Twitter's lameness is because I want to read some of my friend's tweets and post a few of my own. See, a few months ago I signed up for an account, decided I wasn't really all that thrilled with how Twitter was broadcasting all my private messages to specific individuals to every single person who had subscribed to my feed, and canceled it. After a while I kinda started to miss the connectivity it gave me to people that I don't see very often, and last week I decided to try and reactivate my account. Only its not that simple.

I logged into the Twitter site with my old user-name and password and was told, "Hi Roger, click here if you want to reactivate your account." I did, received an email that said, "Click on this link to reactivate you account." and proceeded to be unimpressed. The link to me to the login page, with a banner that told me it couldn't verify that I had requested an account restoration. WTF? I mean, they sent me the confirmation email, right?

Frankly, I really have a hard time understanding how a site like Twitter can have such piss-poor account management. I mean stuff like you can only have an email address or mobile phone number linked to a single account is weak. Combined with the inability to delete and reactivate your account means that you essentially sign up with a single account once, for life.

Google, please buy Twitter out, or provide similar functionality via Gmail chat, so that we don't have to keep dealing with idiots who can't manage a database.

Friday, April 10, 2009

Subquery of subquery PostGIS SQL

Had to create some polygons that represented the dissolved and buffered outlines of a region, that were then clipped to an artificial extent. Came up with the following SQL, which still makes me scratch my head when I look at it.

SELECT ST_Intersection(c1.diss_buff_geom, m.the_geom) AS intersection_geom, 
        c1.name AS name
    FROM (SELECT geomunion(the_geom) AS diss_buff_geom, name
        FROM (SELECT name, ST_Buffer((ST_Dump(the_geom)).geom, .12) AS the_geom 
            FROM coastlines) c
        WHERE c.name LIKE 'India' GROUP BY c.name) c1, 
            global_land_mask_v5 m
        WHERE ST_Intersects(c1.diss_buff_geom, m.the_geom) 
            AND c1.name = 'India';

Honestly... still hurts to look at this now.

Monday, April 6, 2009

Working with GDAL in C

Baby steps. Find the "ogr_capi_test.c" test program and compile it. Comes with GDAL library and is found in $GDAL_ROOT/ogr.

Compile with these flags: "gcc -g ogr_capi_test.c `gdal-config --libs` `gdal-config --cflags` -o ogr_capi_test"

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.