Archive for November, 2007

Thursday Tip Day: Keyboard shortcut for windows command prompt

The windows key + R opens the run command in windows, which leads to an easy way of quickly opening a dos prompt and running a command.

In the “open box”, type:

cmd /k your command

to run the command and keep the window open, or:

cmd /c your command

to run the command and close the window.

eg cmd /k ping google.com

Ordnance Survey Grid Convertor Database

I had some interest in the Access module for converting Ordnance Survey NGRs to Eastings and Northings (and vice versa) so I thought I’d risk putting the database on the site for download. It’s in Access 97 but should translate up to newer versions without much trouble.

I should also add that several people commented last week about an online NGR converter that looks really handy, and this excel spreadsheet full of handy vba functions for conversion offline.

Obviously this database is offered with no warranty: it has been scanned for viruses but I won’t be responsible for any damage done to you, your computer, pets, family, work colleagues, friends etc whilst using it. Other than that, you can share it, alter it or otherwise hack it to pieces. A little linkage back to here would be appreciated if it’s useful though!

Where is it? Here

Thursday Tip Day: Converting OS Grid Squares for GIS

After last week’s post I was asked in the comments to explain how to convert British Ordnance Survey Grid Squares to sensible Eastings and Northings, for use in a GIS. So here goes…

Firstly- to quote from the Ordnance Survey website:

The National Grid, like its military predecessors, consists of a systematic breakdown of the Grid area into progressively smaller squares identified first by letters and then numbers. The largest unit of the grid is 500km squares each designated by a prefix letter alphabetically from A-Z omitting I – the first letter to be quoted in today’s National Grid Reference. Great Britain is covered only by four of these squares – H, N, S and T. The 500km squares are then further broken down in to twenty-five 100km squares which are identified by a letter, again A – Z omitting I ( the second letter quoted in a reference).
On Ordnance Survey maps these squares are divided into smaller squares by grid lines representing 10 km spacing each numbered 0 – 9, from the South West Corner in an Easterly and Northerly direction.

The upshot of this is that there is a grid of 7×13 100KM squares superimposed over England, Scotland and Wales (Ireland has it’s own grid), each of which can be referenced either by two letters, or two numbers (counting from left to right, bottom to top, starting with 0). Traditionally, grid references in the UK have the two letter code, then the grid reference, eg SD 481 616 is the grid reference of my house.

To use these references in a GIS, ie to display point data by easting and northing coordinates do the following:

  1. Find out the numbers representing the grid letters (SD is 3,4),
  2. The column number is prefixed in front of the easting (eg 3481),
  3. The row number is prefixed in front of the northing (eg 4616),
  4. Add enough zeroes to have 6 digits in both the easting and the northing (348100 461600) *,
  5. The number of zeroes tells you how accurate the reference is- the above reference is accurate to 100m.

* The far North of Scotland has 7 digits in the northing

Ah, but how do you know the numbers to represent each grid square? Well, there are complicated formulae for it but I find it easiest to print out this map and number the squares up starting with 0,0 in the bottom left corner.

It is possible to find php modules online to do this automatically for a web site, and I also created a visual basic module to do this in microsoft access. I won’t post the module as my web host will probably think it’s spyware or a virus, but feel free to contact me in the comments if you’d like it.

Hope this helps!

Thursday Tip Day: Creating an access 97 compatible geodatabase in ArcGIS 9.2

Access 97 is still a popular choice for databases (especially in archaeology!) but the default ArcGIS 9.2 geodatabase is in Access 2000 format and cannot be opened in earlier versions of Microsoft Access. It is possible to create a geodatabase that can be used by both programmes.

  1. Create a blank database in Microsoft Access 97 and save it to the location where you want your geodatabase to be stored. Close Access
  2. In ArcCatalog, navigate to the database, and right-click to add a new object. Choose “table” rather than “feature class” or any of the other options.
  3. Create a simple table called”test”, or similar- you can delete in in a minute. This creates all the geodatabase-specific tables that you need in the database.
  4. Import your spatial data into the geodatabase, or create new data as required. You should now be able to access the data in both Microsoft Access and ArcGIS.

As always with geodatabases- do not delete geodatabase tables or feature classes in Access as they will remain visible in ArcCatalog. Only use ArcCatalog for deletions.

Next Page »