Archive for February, 2008

Thursday Tip Day: Using openstreetmap data in postgis

I was quite excited to find that you can use openstreetmap data in your own GIS environment by loading it into PostgreSQL. To me, this makes it much more useful, as I can now begin to use it as an alternative to costly data from the Ordnance Survey. The procedure took some time (mainly due to trial and error), but the following worked for me in Ubuntu:

  1. Install osm2pgsql by downloading it from here using subversion
  2. The readme.txt file that accompanies it suggests installing a selection of libraries too, which you should be able to install using apt, with the exception of geos
  3. Check to see if you have an existing copy of libgeos and download and install from source from here
  4. To ensure that libgeos is reachable, find out where it is installed using which geos-config and edit /etc/ld.conf as root to include the path to it (run ldconfig as root afterwards)
  5. Install osm2pgsql by running make from the source directory that you downloaded in step 1
  6. As your postgresql user, create a new database called “gis”
  7. Download the latest planet dump (for UK users, try here for the UK extract)
  8. As the postgresql user go to the osm2pgsql source directory from step 1 and run ./osm2pgsql -d gis /path/to/planet/dump.osm.bz2
  9. In psql create a spatial index on each of the tables in the gis database using: create index index_name on table.name using gist (geom_column); where you need to find the table names and the name of the geometry column in each case (it’s probably “way”)
  10. Some gis will need a primary key and an oid column for each table too.

Note 1: This is a work in progress. I am now trying to figure out how to use this data in both my desktop and web-based GIS. So far I have been able to make a connection to the data using pgarc in Arcmap, but it seems to fail because it wants an ansi encoded database rather than utf8. I can’t make a connection with ziggis at all at the moment. I can make a connection using ogr in mapguide opensource, but it fails when I try and visualise the data, and I couldn’t get the postgis connector to work when I tried it. I have, however, recently found some more information about this so I will keep trying…

Note 2: I couldn’t get the standard osm2pgsql package for ubuntu to work at all, only the source package worked. I think this is to do with the geos library…

Thursday Tip Day: Postgis geometry transforms

How to transform the geometry of a postgis table from one projection to another:

postgisdbf=# UPDATE your_table SET the_geom = TRANSFORM(the_geom, 4326);

Where the_geom is the name of the field holding the geometry, and 4326 is the EPSG code you wish to transform to

Archaeogeek’s January round-up

Again, better late than never are a couple of links I’ve seen over the last month that are worth having a look at:

  1. A History of Visual Communication, from cave painting to computer design, via Kottke. I especially liked the earliest sections from cro-magnon cave painting to the Nazca Lines. I’m still working through the later sections!
  2. What happens to your blog post when you click publish, from Wired. An interesting article, though the image itself is very hard to navigate around.
  3. A new aggregator for archaeology and ‘digital antiquity’-related blogs: Electra Atlantis. Much reduced productivity now expected…

CAA UK 2008

As the title kind of gives away, it was the annual Computing Applications in Archaeology UK Chapter annual conference over the last few days. It was held in York this time, rather than Southampton, as it has been for the last few years, heralding, I hope, a plan to move around the country from now on.

Normally I like to blog daily from these conferences, whilst it’s all fresh in my mind, and because it’s easier to blog about one day’s papers than two, but guest houses with wifi in York are a little difficult to come by (gotta get me one of those mobile broadband thangs).

Soooo… where to start…

Duh, with the thanks and acknowledgements of course! So, thanks to the ADS and the University of York for hosting the conference at the gorgeous King’s Manor, arranging lots of yummy food, a great visit to Dig (the only musuem about actually doing archaeology, as far as I know) and a conference meal at possibly the largest and grandest pizza restaurant in the world.

Friday kicked off with sessions on collaboration- mainly heritage agencies getting together to put their data on the web and provide better access to their sites and collections. Leif, however, threw us all a googly with a great talk on assessing the veracity of different historical maps in an empirical and logical manner, and figuring out whether they are suitable for the job you want them to do (in a geospatial sense, mostly). Really, this is just a way of formalising a process we should all go through when choosing datasets to use, but we rarely do. For example, is the map complete or incomplete, are the boundaries of the entities fuzzy or hard (eg formalised boundaries or best guesses), does it represent a period of time (like the Roman empire), or a snapshot, are the entities markers (like point data, mostly) or an accurate depiction of a location, is the map observed or derived (like a model). Then , what happens when you combine two maps? Which of the above are incompatible? I thought about this for a while afterwards, and got to wondering a few things- mainly that definitions of completeness depend entirely on what the user of the map needs it to do- in fact every map is incomplete up to a point (because it can’t depict everything) but if it contains all the entities you need then that’s fine. I am hoping Leif is going to post his powerpoint (hint, hint) to make it all a bit clearer to follow (and so that you don’t miss the great map at the end and Leif’s description of its genesis).

Other sessions attempted to address an issue that has been bubbling under for a while now- how to address issues of uncertain in virtual reconstructions. How do you separate what is real from what is conjecture without adding artificial intrusions into the image? Previous discussions have suggested varying levels of transparency, whereas the ideas suggested here were to create different models for each of your conjectures, or to embed links to images, discussion, interpretation within the model.

The afternoon sessions on day one were varied, but mostly pretty techy. In particular I loved the final paper, on the archaeology of Jodrell Bank, complete with archive recordings of 1950’s astronomers bouncing echoes of their voices off the moon. Like last year, the idea of acoustic modelling came up. Can acoustic modelling help us interpret buildings or spaces? The answer seems to be yes, but I don’t think we’ve yet addressed how you add the large crowds of people into your model and what effect they might have.

Saturday’s sessions included work on predictive modelling and other statistical models for discovering patterns in archaeological data. This is quite controversial in archaeology because it tends to assume that all human activity is environmentally determined rather than socially. This is mainly because the social effects are so hard to model. It is also prey to issues arising from flawed or incomplete datasets (back to Leif’s talk) and biases in the data collection strategy. However, I thought today’s talks tried to address some of these issues, or at least acknowledge that there was a problem. I’m all for using the technique myself, but as one element in the model, not the whole thing.

I should give Joseph a plug- he talked about Oxford’s One Laptop per Archaeologist plan (actually it’s now one openmoko smartphone per archaeologist, but who’s being picky) and our over-arching plans for openness- open data, open access and open standards. It made me quite glad to be working there!

Props in the final session must go to Nicola Schiavottiello for his “Magic Tour”, using clever little hand-helds and tablet pcs to superimpose 3D models of objects over the actual scene in front of you. Nicola sees it as being used for historic tours, showing you what a place was really like and I think it’s a fantastic idea!

Finally the Antiquist crowd got together for a “show and tell” about what cool things we’re all working on or need help with. I should say that if you’re doing archaeological computing of any sort and want help, or just to bounce ideas off people then it’s a good place to go.

Throw in some biting cold, some strong winds, a little snow, a large church building, and there you have it. Roll on next year…

« Previous Page