Sabtu, 31 Januari 2009
flickr promoting the commons / creative commons
The confusingly similarly named "The Commons" and "Creative Commons" parts of the website apparently don't reference each other. Odd.
Jumat, 09 Januari 2009
Excellent stuff from New Zealand Geographic Board Ngā Pou Taunaha o Aotearoa
While they haven't produced what I/we want/need, in the last couple of months they've made huge progress in an unambiguously right direction.
Their primary work is the New Zealand Gazetteer of Official Geographic Names, a list of all official place names in New Zealand. It uses have a peculiar definition of "official" (= mentioned in legislation or a Treaty of Waitangi settlement), they have very few names of inhabited places (and no linking with the much larger ones maintained by official bodies such as the police and fire service), They have no elevation data for mountains and pass (which are defined by their height) and they define some things as points when they appear to be areas (such as Arthur Pass National Park), but it's much better than the New Zealand Place Names Database since:
- It has a statutory reference for every place, given the source of the officialness of the name
- It fully support Macrons
- It has a machine readable-list of DoC administered lands --- I can imagine this being used for all sorts of interesting things, getting people out in other scenic and marine reserves.
Macrons in Maori names have posed problems for electronic databases. Nevertheless they are part of the orthography, recommended by the Maori Language Commission, and the Board endorses their use. The Gazetteer will include macrons where they are formalised as part of the official name. When Section 32 of the new Act comes into force, official documents will be required to show official names, and these will need to include macrons where they have been included as part of the official name (unless the proviso is used). A list of those official names which have macrons is at http://www.linz.govt.nz/
Rabu, 08 Oktober 2008
fuzzziness
I tried to approach fuzzzy with an open mind, but the increasingly stumbling on really annoying (mis-)features.
- This is the first bookmark engine I've ever used hat doesn't let users migrate their bookmarks with them. This is perhaps the biggest single feature fuzzzy could add to attract new users, since it seems that most people who're likely to use a bookmark engine have already played with another one long enough to have dozens or hundreds of bookmarks they'd like to bring with them. I know this is non-ideal from the point of view of the social bookmark engine they're migrating too, since it makes it hard to do things completely differently, but users have baggage.
- While it'd possible to vote up or vote down just about everything (bookmarks, tags, bookmark-tags, users, etc), very little is actually done with these votes. If I've viewed a bookmark once and voted it down, why is it added to my "most used Bookmarks"? Surely if I've indicated I don't like it the bookmark should be hidden from me, not advertised to me.
- For all the topic map goodness on the site, there is no obvious way to link from the fuzzzy topic map to other topic maps.
- There doesn't seem to be much in the way of interfacing with other semantic web standards (i.e. RDF).
- The help isn't. Admittedly this may be partly because many of the key participants have English as a second language.
- There's a spam problem. But then everywhere has a spam problem.
- It's not obvious that I can export my bookmarks out of fuzzzy in a form that any other bookmark engine understands.
Sabtu, 04 Oktober 2008
Place name inconsistencies
Coming to the data I was aware of a number of issues:
- Unlike most geographical data users, I'm primarily interested in the names rather than the relative positions
- New Zealand is currently going through an extended period of renaming of geographic features to their original Māori names
- The names in the dataset are primarily map labels and are subject to cartographic licence
- Names can differ only by punctuation. There is a "No. 1 Creek" and a "No 1 Creek".
- Names can differ only by presentation. There is a "Crook Burn or 8 Mile Creek", an "Eight Mile Creek or Boundary Creek" and an "Eight Mile Creek" (each in a different province).
- There is no consistent presentation of alternative names. There is "Saddle (Mangaawai) Bivouac", "Te Towaka Bay (Burnside Bay)", "Queen Charlotte Sound (Totaranui)", "Manawatawhi/Three Kings Islands", "Mount Hauruia/Bald Rock", "Crook Burn or 8 Mile Creek" and "Omere, Janus or Toby Rock"
- There is no machine-readable source of the Māori place names with macrons, and the human readable version has contains subtle difference to the machine-readable database (which contains no non-ASCII characters). For example "Franz Josef Glacier/Kā Roimata o Hine Hukatere (Glacier)" and "Franz Josef Glacier/Ka Roimata o Hine Hukatere" differ by more than the macrons. There appears to be no information on which are authoritative.
(grammar edit)
Selasa, 02 September 2008
Does anyone publish the Dataset of New Zealand Geographic Place Names already in XML form?
I've been playing with the Dataset of New Zealand Geographic Place Names which is a set of CSV files published by Toitū te whenua / Land Information New Zealand (LINZ). The data takes quite a bit of massaging, and I was wondering whether anyone else had already done the work of making acceptable XML out of the data rather than doing all the work myself.
I've attached the script I have so far, but it's not perfect. In particular:
- It doesn't include place names with Macrons
- It makes lots of ASCII-type assumptions
- Many of the element names are poorly named and map non-obviously to fields in the CSV files.
- The script isn't very generic and does little or no checking
Anyway, here's he script, hopefully it's successfully escaped. The basics are that it creates an sqlite database and streams the CSV files into it direct from the zip (which it expects to have been downloaded into the current directory). It then streams each point out using awk to transform it to XML.
#!/bin/bash
# script to import data from
# http://www.linz.govt.nz/placenames/search/place-names-dataset-download/index.aspx
# into an XML file.
# this script licensed under the GPL/BSD/Apache 2 licences
echo \(re\)creating the database, expect DROP errors the first time you run this
sqlite nzgeonames.db << EOF
DROP TABLE name;
CREATE TABLE name (id, name, east, north, pdescription, district, sheet, lat, long);
DROP TABLE district;
CREATE TABLE district (district, description);
DROP TABLE pdescription;
CREATE TABLE pdescription (pdescription, short, description);
DROP TABLE sheet;
CREATE TABLE sheet (edition, map, sheet);
VACUUM;
EOF
echo importing the names
unzip -p nznames_6Aug08.zip namedata.txt | sed 's/\r//' | sed 's/`/","/g' | awk -F^ '{print "INSERT INTO name VALUES (\"" $0 "\");"}' | sqlite nzgeonames.db
echo importing the districts
unzip -p nznames_6Aug08.zip landdist.txt | sed 's/\r//' | sed 's/`/","/g' | awk -F^ '{print "INSERT INTO district VALUES (\"" $0 "\");"}' | sqlite nzgeonames.db
echo importing the point descriptions \(expect two lines of errors\)
unzip -p nznames_6Aug08.zip pointdes.txt | sed 's/\r//' | sed 's/`/","/g' | awk -F^ '{print "INSERT INTO pdescription VALUES (\"" $0 "\");"}' | sed 's/:/","/' | sqlite nzgeonames.db
echo importing the sheet names
unzip -p nznames_6Aug08.zip sheetnam.txt | sed 's/\r//' | sed 's/`/","/g' | awk -F^ '{print "INSERT INTO sheet VALUES (\"" $0 "\");"}' | sqlite nzgeonames.db
# pick up the ugly duckling
sqlite nzgeonames << EOF
INSERT INTO pdescription VALUES ("MRFM","MARINE ROCK FORMATION","Marine Rock Formation");
EOF
echo exporting points as xml
echo "<document source=\"Sourced from Land Information New Zealand, [date]. Crown copyright reserved.\">" > nzgeonames.xml
sqlite nzgeonames.db "SELECT name.id, name.name, name.east, name.north, name.pdescription, name.district, name.sheet, name.lat, name.long, district.description, pdescription.short, pdescription.description AS descriptionA, sheet.edition, sheet.map FROM name, district, pdescription, sheet WHERE name.district = district.district AND name.pdescription = pdescription.pdescription AND name.sheet = sheet.sheet;" | awk -F\| '{print "<point><id>" $1 "</id><name>" $2 "</name><east>" $3 "</east><north>" $4 "</north><pdescription>" $5 "</pdescription><district>" $6 "</district><sheet>" $7 "</sheet><lat>" $8 "</lat><long>" $9 "</long><description>" $10 "</description><short>" $11 "</short><descriptionA>" $12 "</descriptionA> <edition>" $13 "</edition> <map>" $14 "</map> </point>"}' | sed 's/&/&/' >> nzgeonames.xml
echo "</document>" >> nzgeonames.xml
echo formatting the points nicely
xmllint --format nzgeonames.xml > nzgeonames-formatted.xml
Senin, 01 September 2008
Library of Congress flickr experiment
While processing the photos from my parent's ruby wedding anniversary, I ran into the Library of Congress's flickr experiment.
I probably shouldn't have been, but I was astounded. It looks the the bastion of old-school cataloguing is coming to bathe in the fountain of social tagging.
This is part of a larger effort described at http://www.flickr.com/commons/
Selasa, 26 Agustus 2008
Saxon joy!
Not only does saxon run take much less memory, it also speaks XSLT 2.0.