8/28/2006

Flame War In Rogers Park

Filed under: — Moonglum @ 11:37

So, I have lived in Rogers Park (well, the 49th ward really, but who’s splitting hairs?) for all of a month now and have been learning my way around a bit. One exciting thing about living here though is the active online community. People seem truly involved in what is going on and don’t mind voicing their opinions. The thing that makes it exciting for me is that the political representatives actually seem to get in on the action as well. The problem is when you post to a true believer for the other side trying to explain yourself, you may as well be trolling. Welcome to the internet Mr. Fagus. I haven’t seen a flamewar like that since I was last on Usenet.

I have to admit, I am impressed that he keeps coming back for more, but that could just be because it is an election year.

Sunnis Return Home

Filed under: — Moonglum @ 09:12

I’ve been reading a number of blogs form Lebanon lately. They are mostly from educated employed city dwellers, not so different from you or I. Thus they tend to be Sunni or Christian and not the biggest Hezbollah fans. It was kind of depressing to watch their attitude change during the course of the war from thinking Hezbollah was getting what they deserved, to thinking the Israelis were overreacting, to fleeing for their lives and hating all Jews. Now that they are back home it seems like the anger at the Israelis is still there (understandably) but much more concern is focused at internal politics and a special anger is reserved for Nasrallah.[1] It was interesting to see a NYT article telling a similar story from Sunni village on the border of Israel. The Lebanese government doesn’t have the power to disarm Hezbollah, but hopefully the popular anger will keep Hezbollah in check long enough for the government to build up its power base and take over the Hezbollah territories.

[1] Quick primer for those who don’t know: Lebanon is a multi-cultural country, 40% Shia, the rest are Christian, Sunni and Druze. The Hezbollah are supported by many Shia (more before they started this most recent war) but they get most their money from Syria and Iran. They operate as a separate state within Lebanon, much to the dismay of the other 60%

8/26/2006

Map Simplification On Mac OS X

Filed under: — Moonglum @ 20:10

Have you ever had an excess of GIS vector data, that you just need to simplify? GRASS too confusing? Random CLI tools not fitting the bill? Cartoweb (makers of many fine web GIS tools) has built just the thing, a vertex simplification tool that does all of the hard work of point correspondence for you. Well it turns out, that it actually has a bunch of other programs do that hard work for you, but hey, reuse is king. Unfortunately the instructions are a bit lacking, and I used many online resources to figure out how to do this, so I thought I’d give a little back with instructions for getting all the tools together.

The instructions for the tool say that you need the following:

  • a Python interpreter.
  • a Postgres Database and the Postgis extension.
  • a Python API for Postgres : psycopg
  • a lex/yacc Python module : PLY

Welcome to an exciting adventure, we will look at each of those in order. Fortunately OS X already has a python interpreter, so the first item is complete. There are a number of ways to install postgres. Grass comes with a handy installer for both postgres and postgis unfortunately the versions it installs are 7.4.1 and the tool uses features only found in 8. This led me to search elsewhere. Marc Liyanage has a nice prebuilt version for 10.4, or you can use the instructions provided by apple to install it. Since you will need to download the code anyway, I am going to use that method. (See their web page for more complete instructions, I combined those with those from the GRASS site to get the below.)

Download the tarball. 8.1.4 is the latest version at the time of this writing.
Double click on it to decompress it.
> sudo sh
> cd postgres-8.1.4
> ./configure –with-openssl –with-pam –with-krb5 –with-perl –enable-thread-safety –with-includes=/sw/include/ –with-libraries=/sw/lib
> make
> make install
> chown -R username /usr/local/pgsql
> exit

Now you should have postgresql installed. Next is postgis, but lets take a little breather though and make sure our Postgres installation is working.

> /usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
> /usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l /usr/local/pgsql/postgres.log start -o -i
> /usr/local/pgsql/bin/createdb test
> /usr/local/pgsql/bin/psql test

Heck, lets add a user while we are at it:

test=# create user postgres with password ‘p0stgr3s’;
test=# \q

Before we can install postgis, we need to install geos and proj:

Download geos.
> cd ../geos-2.2.3
> ./configure –man-dir=/usr/local/share/man
> make
> sudo make install-strip

Then you need proj4.

Download the tarball. Don’t forget the extra datum grid either.
> cd ../proj-4.4.9
> cp ../proj-datumgrid-1.3/* nad/
> ./configure –mandir=/usr/local/share/man
> make
> sudo make install
> sudo cp -f nad/nzgd2kgrid0005.gsb /usr/local/share/proj/

Now we are finally ready to install Postgis. This is a little tricky, you may want to check out the instructions again. You need to make two changes to the existing Makefile.config.in. Set USE_PROJ=1 and USE_GEOS=1. Then set PROJ_DIR=/usr/local and GEOS_DIR=/usr/local. Finally set USE_ICONV=1. Then open loader/Makefile and set override CFLAGS += -DUSE_ICONV -liconv.

Download the tarball. 1.1.3 as of this writing.
> cd ../postgis-1.1.3
> export PGSQL_SRC=../postgresql-8.1.4/src/
> make
> sudo make install

Now you need to stick the new functionality into your database:

> /usr/local/pgsql/bin/createdb gisdata
> /usr/local/pgsql/bin/createlang plpgsql gisdata
> /usr/local/pgsql/bin/psql -d gisdata -f /usr/local/pgsql/share/contrib/lwpostgis.sql
> /usr/local/pgsql/bin/psql -d gisdata -f /usr/local/pgsql/share/contrib/spatial_ref_sys.sql

OK, now you have postgres and postgis running on your system. Now you need to get all the different layers of map data into your database. I’m going to assume your maps are in .shp format. If not, download GRASS and use the whatever2ogr command line tools to get it in the correct format. Then do:

> /usr/local/bin/shp2pgsql -w layer.shp layer | /usr/local/pgsql/bin/psql gisdata

for each of your data layers. You should probably use: alter table table owner to postgres; to change the owner to be your postgres owner so you can log in. At this point you can check to see if you did everything correctly by grabbing qgis and connecting to your postgis server and downloading a couple layers.

OK, two steps down, next is psycopg. Unfortunately this is a bit tricky to install. An overview is given here. We can’t just dig in though, because there are some header files that we sill need. Also we need the mxDateTime python extension, so…

Download mxBase
> cd ../egenix-mx-base-2.0.6/
> sudo python setup.py install
> cp -R ../postgresql-8.1.4/src/include/catalog /usr/local/pgsql/include/
Download psycopg.
> cd ../psycopg-1.1.20/
> ./configure –with-postgres-libraries=/usr/local/pgsql/lib –with-postgres-includes=/usr/local/pgsql/include –with-mxdatetime-includes=/sw/lib/python2.4/site-packages/mx/DateTime/mxDateTime
> make MACOSX_DEPLOYMENT_TARGET=10.4
> sudo make install

OK, we are getting there. Now we need to do PLY. Fortunately this is just the usual download and install:

Download PLY.
> cd ../ply-1.8
> python setup.py install

Woot! We have all of the precursors installed! Now we need a smoke.

So we should be good to go. Only one problem: the helpful instructions don’t really give you a good example of input, so simplified: install vertex simplifier, build the vertex list, simplify that list. Note that you need to fully qualify the layer name or won’t work. Also the layer must be the layer with the most points if you want to use the same simplification table for multiple layers.

Download vertex simplification program
> cd ../Vertex-Simplification-Program-2.0
> /usr/local/pgsql/bin/psql -f func.sql gisdata
> python vertex.py -H localhost -u postgres -p p0stgr3s -d gisdata -t ‘public.layer’ -v ‘public’ -i ‘gid’ -g ‘the_geom’ -m 1

M is the minimum distance, make it higher for more reduction in size. Go have another smoke. This is going to take a while. It does about one poly every couple seconds. 3,000 polys… 50 minutes! I’ll be back later.

OK, that was a nice break, now you can actually generate the simplified data for each of your layers:

> python simplify.py -H localhost -u postgres -p p0stgr3s -d gisdata -t ‘public.layer’ -v ‘public.vertex1′ -i ‘gid’ -g ‘the_geom’ -m 1

Do that for each layer, and it will make a new geometry column in your layer. Finally you can export your new data using pgsql2shp if you need it in .shp format. Don’t forget to use the -g tag to give it the name of your new data row!

And now you have a nice, simplified map that holds onto its contiguous borders! How cool is that?

8/25/2006

How To Take Good Pictures

Filed under: — Moonglum @ 19:29

I don’t know why this caught my eye, but some CNN photographers posted an article on how to take good pictures. The hints are quite straightforward, and simple enough that I might actually be able to remember them the next time I am taking pictures. I particularly like how basic they are, yet clearly state what it is you need to do, none of this worrying about how to get all ten shades in your frame.

Meta Question

Filed under: — Moonglum @ 18:51

I realize I’ve had a couple longer posts recently. Do people who read this off of an offline news reader (including people who get it through the LJ syndication) prefer that those long articles get truncated, or do you like having the whole thing? I just tried changing the setting, so we will see how well it work for a few days.

Let me know what you think.

8/22/2006

All Your Snake Are Belong To Us

Filed under: — Moonglum @ 13:02

For great justice, take off every snake.

8/17/2006

Things That Suck

Filed under: — Moonglum @ 17:19

Cicadas landing just outside your window. While you are trying to work.

Fortunately I heard him doing his little warmup routine and was able to close my window before he kicked into truly high gear. Man those things are loud.

8/15/2006

Cook County = Banana Republic

Filed under: — Moonglum @ 13:18

Why is it that third world dictatorships like Cuba can let the people know the state of their leaders with videos from the hospital and statements, but Cook County can’t? Stroger was in and out of the hospital so many times, but we were assured that he was still running the government from cryptic statements from interested parties, but no video from Stroger himself letting us know that he was still in charge. It is just embarrassing to be a democrat in Chicago right now.

I think Suffredin said it best in the first line from his Trib editorial, “Cook County Democratic committeemen are free to further trash their party’s reputation by treating public office as a cheap bauble to be bequeathed and inherited.” I am going to have a hard time deciding how to vote in this next election.

8/14/2006

2004 Election Discrepancies

Filed under: — Moonglum @ 19:07

Did you know that in the 2004 presidential election the difference between the exit polls and the actual results of the elections were up to 10% in some precincts? Did you know that in emerging democracies, when that disparity is under 3% it is considered a good election, but when it is over 5% there is cause for concern?

Robert Kennedy has a rather breathless, but well cited, article in rolling stone about this discrepancy. I was going to post a bunch of links up here, talking about all of the different issues involved, but you can go read that article and find them for yourself. One in particular that I want to point out though is a rebuttal to a rebuttal by the author of a book often cited in the Kennedy article. I like that article because it is less concerned with the outcome and more concerned with the methodology. I am less concerned with the idea that the Republicans could have won an election illegitimately, and much more concerned with the idea that there could be so much doubt about the results of an election from a scientific perspective within the US an have there be so little scrutiny.

I am thinking about getting Freeman’s book and seeing if the math holds up for myself. The hope is that with research like this we would at least be able to eventually know if the election was fraudulent. The one thing that makes me think there might actually be something to the breathless report: “On November 2nd of this year, on the second anniversary of the election, state officials will be permitted under Ohio law to shred all ballots from the 2004 election.” Less than three months. Maybe we won’t be able to find out after all.

8/10/2006

Level Red

Filed under: — Moonglum @ 23:51

I know what we need. We need to raise the threat level to red. That will protect us. Fortunately the Brits and Pakistanis are on top of things, and stopped this threat before it got to us. Now all we need to do is watch out for liquids on a plane.

V For Vendetta

Filed under: — Moonglum @ 09:00

The comic book, not the movie. And yes there are spoilers.

Remember remember the fifth of november,
the gunpowder treason and plot.
I know of no reason why the gunpowder treason
should ever be forgot.

A friend lent me the collected issues, and I just finished reading it. I have to say I was shocked at how good it was. There were plenty of items I took issue with, and parts that were there in order to make it fit the expected “comic book” mold of the time, but overall the story was good and the characters were interesting, definitely a worthwhile read. Perhaps the most interesting item though is the setting.

The story is set Set in the distant future of 1997. I have to wonder when it was written. The collection I was reading has a number of copyright dates, but wikipedia tells us it was written in the early 80s. Suffice it to say, the world is a dystopian future where the government has eyes and ears everywhere. Of course it has muscle too, but it seems like most of the bad stuff it did was in the past, reminding a bit of Fatherland.

Rant: I find the whole thing quite interesting because looking at the world today I see how easy it would be for any country which feels threatened to allow the government to take that kind of power and then just sit by idly while it happens. Don’t think it can happen here? How do these things start? By giving up small rights. By instilling fear in the populace. By the government deciding they know better than you, how to rule your life. I’m not saying that we are heading towards a totalitarian government, but it is something we need to be aware of. After winning World War 2, one of the first things we did was to warn our kids that “it could happen here“. End rant.

Having said that, the despotism that the UK finds itself in is actually much less insidious than that. It comes after a period of chaos and turmoil following a nuclear war. The threat of world wide nuclear war is much lower now than in the 80s, however the threat of a totalitarian government taking over is still there. In any case, it is an all too real and possible world that our characters find themselves in.

The characters are what makes the book so enjoyable for me. The entire book is basically the process of one of the characters, V, educating the other characters in self reliance. The rhetoric comes straight out of The Anarchist’s Cookbook, which is a little dated at this point, but the lessons still hold. What is a life where you don’t get to make any decisions for yourself. What is a life where you always do what the people in charge tell you to do? When you do that your entire life, you loose track of yourself. You don’t even know what your desires are, so how are you able to follow up on them. Evey is the obvious pupil, but the entire rest of the UK is getting a lesson in self reliance as well.

Evey is an interesting character from my perspective because she is the typical comic book female foil: prostitute, helpless, needs a man to save her. I HATE that. The interesting thing is, by the end of the book, I found her character to be the one I liked the most. She did take to her lessons, and did do what she was told, but she did them her own way. How do you tell someone what to do, when the thing that you want them to do is do what they want? In the end she realizes that she doesn’t like V’s methodology, but she likes what he is doing. So she will continue doing the work he instructed her to do, but she will do it her own way. I don’t know if that makes up for her standard comic book portrayal at the start of the book, but it is something.

The story itself is good as well, but I have already spoiled enough. If you can get over the datedness of it, it is definitely worth a read. Especially now, as the reigns of power get more and more centralized in our own country, it is good to remember that there has to be a point at which we say, enough. The earlier we say it, the easier it is to say.

8/9/2006

Stand and Deliver

Filed under: — Moonglum @ 13:31

So, I have lived in my new place for less than a month, and have already received my first official communication from the local government. It begins, “Dear Cpt. Peril, Stand and deliver, etc…” OK, maybe not quite that bad.

I understand that Chicago works by collecting parking tickets and using arcane parking regulations to collect those tickets, but to have NO SIGNS WHATSOEVER anywhere on the street seems a little weak to me. Allow me to present my evidence:

No signs.

Notice that where I was parking there were no signs letting me know that today was street cleaning. In fact, if you look down the entire street there are no signs.

No cars.

More interestingly, there are no cars. This leads me to believe that my neighbors know things that they aren’t letting me in on. The parking is always good up here, but not that good. Another item of interest, and the thing that made me not worry about my car at first is that the other side of the street is quite well marked.

Other side of the street.

Oh well. I suppose the city needs the money after kicking all the big box stores out.

8/3/2006

Apple Newton vs Samsung Q1

Filed under: — Moonglum @ 09:21

I’m a little behind on posting thanks to both being busy and a lack of being online. But with the speed at which the world has been moving these past few weeks, most of my posts seem outdated at this point. So instead of going political, I will bring you something random: a comparison of handheld devices. And yes, these devices do have ten years between. And yes, the one that is ten years old wins. People sometimes forget that if you want something to be in someone’s pocket and useful to them, the usability of the interface is much more important than the glitz of what it can do. This is why I will stick to my PalmOS powered devices for as long as I can.

Moved! Owned!

Filed under: — Moonglum @ 09:00

We have moved a few miles north and are now members of a new neighborhood. It is a little bit unclear which neighborhood we are in now, but I call it “Rogers Park”. I have been told that I live in “West Ridge” or “West Rogers Park”, but since Joe Moore is my alderman, I think that puts me in Rogers Park for all meaningful purposes.

Also, we just paid our first mortgage payment ever. Only slightly higher than our rent, so that is good. If you take out the principal portion of the payment it is actually lower than rent. Once I get my first full month’s worth of bills I will have to do a rent vs. own comparison and stick it up here. Of course to do that for real you also have to include taxes, but my bet is that the property taxes will wash out with the reduction in income tax from owning.

I also have a new address and phone number, but the same e-mail. I’m not sticking my new contact info up here, so e-mail me if you want it.

8/1/2006

Back On-Line

Filed under: — Moonglum @ 09:50

Hey All, sorry for the month offline. There were some… problems… with my new isp, RCN. I believe that they have been fixed now, by application of threat of leaving and some quantities of cash. I won’t really be able to tell if all the problems are fixed though, until I get my next bill. Thus if you can read this post, feel free to make a comment so I can tell that it is actually working again.

Also, I have a whole slew of posts backed up from when it was down, which I will hopefully be posting in the next week or so.

Powered by WordPress