Saturday 25 February 2012

MGIS 2012

I'm just back from the field course for the collaborative MGIS.  It was a great week and Kaikoura is a wonderful location to get to grips with the programme and to present an introduction to the courses we'll be covering over the year.  


We carried out a number of field exercises as well as covered a number of different GISc topics.  The students in the photograph below are calibrating some indoor navigation tools.

We were also lucky enough to include a visit to Ngai Tahu's marae in Kaikoura.  Ngai Tahu provided a very informative afternoon discussing the GIS data they've been collecting and their future plans. 

This year, 10 students across the two campuses (University of Canterbury in Christchurch and Victoria University of Wellington) started their Masters or Postgraduate Diploma during the field course. It looks like it could be a great year!


Wednesday 15 February 2012

Arcpy Code: Find duplicate values in an ArcGIS feature class field

I'm finding coding in arcpy a little more frustrating than I would like and decided to share useful code here in case it helps anyone else trying to the same or similar things.


###########################################
# identifyduplicates.py
# Created by: Mairead de Roiste, Victoria University of Wellington
# Date: 16 Feb 2012
# What does it do?: prints to screen a list of the values that are

# duplicates in a particular field in an ArcGIS feature class
###########################################


# Import arcpy module
import arcpy

# set up variables
# the feature class you want to sort then search

fc = "D:\\ISCR_transport\\code\\data\\NZTA_workhomepoints\\workhomepoints.gdb\\workloc"

# field to sort in ascending order
fieldname = "FIRST_uniquePerson"fieldascend = fieldname + " A"

# create UpdateCursor to search through the rows, field above sorted in ascending order
rows = arcpy.SearchCursor(fc,"","","", fieldascend)

#Create an empty list
dupValuesList = []

# the code needs to be updated for the name of the field
i = -1
for row in rows:
    if i == -1: #first time around       

        value = row.FIRST_uniquePerson
        i += 1
        print value, i
    elif row.FIRST_uniquePerson != value: #if a new ID       

        value = row.FIRST_uniquePerson
        i = 0
    else:
        dupValuesList.append(value)

print dupValuesList

Thursday 2 February 2012

Linking data to geography - the demise of privacy?


A rather grand title, but a topic which constantly comes up when I get into rather too detailed discussions with friends and random strangers at parties.

I'm woeful with names so the Whitepages Neighbors site sounds like a good idea.  They've launched an app which lists names and numbers for your neighbours overlaid on a map of your local area.  But my cynical side can already see particularly unsavoury uses for this - phoning to check if someone is at home before you break into their house.

Joining data to geographic locations, which was possible for individuals previously on a manual and labourious basis, can release a lot more information about individuals and families than they might care to make public.  The power of joining through geography is a double edged sword.