Getting to know PostGIS Part II

So its been over six months since I made my first tutorial post about PostGIS. I now use PostGIS on a regular basis and thought it would be good to update the tutorial with some meat on how to use PostGIS.

Get some data and import it

Grab populated places points

wget http://edcftp.cr.usgs.gov/pub/data/nationalatlas/citiesx020.tar.gz

Grab US counties map:

wget http://edcftp.cr.usgs.gov/pub/data/nationalatlas/countyp020.tar.gz

Lots more data available in the National Atlas
Continue reading ‘Getting to know PostGIS Part II’

Install MacPorts in Local Home Directory

I was needing to install MacPorts on a multi-user system where I didn’t have root access. Here is what I did.

mkdir ${HOME}/macports
cd ${HOME}/macports
wget http://svn.macports.org/repository/macports/downloads/MacPorts-1.6.0/MacPorts-1.6.0.tar.gz
tar -xzvf MacPorts-1.6.0.tar.gz
cd MacPorts-1.6.0
./configure --prefix=${HOME}/macports --with-tclpackage=${HOME}/macports/tcl \
--with-install-user=${USER} --with-install-group=${USER}
make
make install

You will now have a macports directory in your home directory:

$ ls macports
bin     etc     include lib     libexec man     sbin    share   src     tcl     var     www

Add ${HOME}/macports/bin to your path and you’ll be able to run “port install *portname*” ports you install will get installed in your home directory. Handy for any little tools you need to have available that might not be built on the system you’re using.

Using OGR to convert GIS Vector formats

OGR is a part of GDAL and is very useful for converting between geospatial vector formats. What does that mean? When storing Vector GIS data there are a dizzying number of formats it can be stored in, some of the more popular of late, or at least well known are KML and SHP. A friend of a friend was looking to convert some SHP (Shapefiles) into KML so that he could make a Google Maps mashup and I helped him out. Here is a workflow for how I went about performing the conversion.
Continue reading ‘Using OGR to convert GIS Vector formats’

Antrhopogenic RF Interference

Was looking at raw AMSR-E data (a passive microwave radiometer flying on board Aqua). Can you tell where the cities are?

pmtbeqn29d016y080308v06sa.png

Hmmm…I wonder what one can do with this? A development indicator, surrogate for population? Very interesting. This anthropogenic interference gets in the way of soil moisture detection over land, but I wonder if it can be used creatively for something else.

Small houses

I have a dream of having one of these buildings (slideshow at Wired.com) in my back yard as a home office someday. Another dream is to get an acreage and scatter several of these buildings around with some paths connecting them together.

5 Dangerous things you should let your kids do.

Gever Tulley has a great video about the sort of dangerous things kids need to do when growing up. It is nice to see this kind of thing. Its a breath of fresh air from the fear society we live in. On a related note, kids don’t get the freedom to go out walking and exploring much anymore.

Scanning with sane’s scanimage from an ADF scanner to PDF and OCRed Text

Using libsane and tesseract, you can scan from an ADF (or non ADF) scanner in Ubuntu 7.10 to a PDF and OCR’ed text document with a few easy steps.

First we need to make sure we have the necessary packages installed.

apt-get install tesseract-ocr sane-utils

Continue reading ‘Scanning with sane’s scanimage from an ADF scanner to PDF and OCRed Text’

ntfsundelete

Just did a stupid thing and deleted a whole tree of file on a windows partition. Never fear…ntfsundelete is here.

sudo ntfsundelete -u -d /destination/directory -f -m *.jpg /dev/sda1

Run without the -u option and -d options to show what can be recovered.

On ubuntu/debian to install it do:

apt-get install ntfsprogs

Getting to know PostGIS

I am making the plunge to get more informed with how to use PostGIS. It is pretty impressive so far. Here is a quick tutorial which shows you how to get started and loading in a shapefile to play around with some fun SQL querying. I assume a basic understanding of the linux command line and some basic SQL skills.

To get started in ubuntu 7.04 (should work in 7.10 and debian too):

$ sudo apt-get install postgis postgresql-8.1-postgis

Next we’ll start setting up the PostGIS environment.
Continue reading ‘Getting to know PostGIS’

A bundle of links…

Some neat things found on the web recently:

  • Ponoko – Custom Laser cutting of Plexiglas and plywood.
  • Make your circuit boards in china for cheap
  • CouchDB simple database for content management systems.
  • Mabel’s Labels – Got kids? Need to label their stuff, these look neat.