Search This Blog

Monday, February 25, 2008

NZMG - WGS84 Projections

NZMG was the official New Zealand mapping projection until 2001.

From the LINZ website (NZ mapping body):

"NZMG is not based on a geometric projection (transverse Mercator is based on a cylinder). Instead it uses a complex-number polynomial expansion. This has the advantage of exhibiting minimal scale distortion over New Zealand; however it is a projection unique to New Zealand and so can be difficult to use or program into computer software or positioning devices. "

In packages such as ESRI ArcGIS you can reproject data easily...... however if you're writting your own software you need to find some libraries to do this.

PROJ4 is one such library. It can be downloaded with GDAL / OGR as part of FW TOOLS.

Here there are 2 tools to assist in transformations... PROJ and CS2CS.
CS2CS caters with changes in DATUM.

To convert from NZMG to WGS84 requires a change in datum.

There are 3 methods to do this...

a) 3 parameter shift
b) 7 parameter shift
c) grid (NTv2)

a) is only good to the nearest 100m or so...
b) is only good to 5m or so..
c) uses a look up grid and should be good to nearest few cm

The look up grid can be downloaded from here:

Syntax to convert a user entered co-ordinate from WGS84 lat/long to NZMG x,y (m):

C:\Program Files\FWTools2.1.0\bin>cs2cs +proj=latlong +datum=WGS84 +to +proj=nzmg +datum=nzgd49 +nadgrids=o:/nzgd2kgrid0005.gsb

170 -43 [enter]
2265438.60 5796423.71 0.00

This should give you metre accuracte conversions.


To carry out from C# using FW TOOLS... you will need to check the C# example from Tamas Szekeres. This can be found in the FWTOOLS / csharp /apps folder.. and is entitled OSRTransform.cs.

A few modifications are required to work with NZMG and WGS84... as follows:

OSGeo.OSR.SpatialReference src = new OSGeo.OSR.SpatialReference("");

src.ImportFromProj4("+proj=latlong +datum=WGS84");

OSGeo.OSR.SpatialReference dst = new OSGeo.OSR.SpatialReference("");

dst.ImportFromProj4("+proj=nzmg +x_0=25100000.0000000000 +y_0=6023150.0000000000 +datum=nzgd49 +nadgrids='o:\nzgd2kgrid0005.gsb'");

CoordinateTransformation ct = new OSGeo.OSR.CoordinateTransformation(src, dst);

double[] p = new double[3];

p[0] = 172.585303;

p[1] = -43.510183;

p[2]=0; //needed even if 0 value

ct.TransformPoint(p); Console.WriteLine("x:" + p[0] + " y:" + p[1]) ;

This should give you results accurate to a few metres.

Tuesday, February 19, 2008

List of great web sites relating to GIS and GPS

Awesome listing of GIS tools, blogs, web pages, development examples...
A great starting point in any search for GIS or GPS tools...

Open Source GIS tools - starting page

Intro to GRASS, GDAL, PROJ, and other useful open source GIS tools.

Tuesday, February 12, 2008

Spoken word

Books read by volunteers....

Can download to Nokia's Audio books tool for S60 phones!

Garmin get talking

So.. Nokia are getting mapping...

Why shouldn't the mapping people get talking...

Check this out! New from Garmin in the near future!

The Nuviphone!

Nokia gets mapping big time!

OK.. so Nokia (phones) are getting into mapping...

They brought out the 6610 with GPS (as used by Ewan McGreggor on long way down) :-

Then the multimedia computer that was the N95.. with all it troubles and slow lock on to GPS signals.

The N82 which improved on the N95 GPS performance...
An Updated N95 8GB which sorted out the original N95 GPS troubles....
An update to the N95 to get it back on track....

They've purchased NavTec for a few billion,137887-c,mapping/article.html
These guys make the maps! Next time you're using Google Maps.. check the bottom line to see if NavTec are mentioned! If they're not chances are that TeleAtlas are.. oh yer. they've just been bought by TomTom a GPS giant!

So what's next for Nokia? Well it seems the next mobile mapping software will be aimed at pedestrians...

Monday, February 4, 2008

Mobile Phones as Environmental Sensors

Mobile phones are a form of ubiqutous computing.
The connected crowd (Rheingold).

Sensors on phones include:
location (GPS, cell-id, wifi)
movement (accelerometers)
ad hoc bluetooth devices

Now projects using mobiles to collect environmental data are becoming common place:
Cellphones to monitor highway traffic

Cellphones to detect dirty bombs?

Cellphones to track air pollution

Capturing ambient intelligence