[Proj] Re: Proj Digest, Vol 51, Issue 2

Andrew Williams AWilliams at rapidmap.com
Tue Aug 12 22:48:42 EDT 2008


Neil,
Just chiming in to see if I can assist. Lat Long to UTM is very familiar territory form me.

Just looking at your command line these no reason for proj4 to return negative values.

For typical UTM projections the standard zones are 6 degrees wide all around the world. Often they are numbered. Increasing East and West from Greenwich eg 0-6 degrees is Zone 1 etc.

When using Proj the lon_0 represents the central meridian of a zone. So the lon_0 for Zone 1 is 3. Think of this as the vertical axis of a graph. Lat_0 is typically the equator eg 0 degree. Think of this as the horizontal axis of a graph.

Your points fall into Zone 5 between longitudes 24 and 30 in the Northern Hemishpere.

So by nominating a lon_0 (correctly) of 27 degrees and by omitting the lat_0 so defaulting to 0 degrees your points fall on the positive/positive quadrant. The formulae that produces UTM will return positive values.

Often in the mapping industry we try NOT TO return negative values. The way we do this and is supported by proj4 is the use of false origins. The parameters x_0 and y_0 are used for this purpose.

In Australia being South of the equator and using UTM the negative latitudes produce "Northings" and any longitude West of the Central Meridian produces negative "Eastings" To make them positive we define a false origin 10 million metres South of the Central Meridian/Equator(True) origin and 500,000 metres West of the true origin. That way all our Eastings and Northings come out positive.

In your case I can't determine why you expect/want negative Eastings, but perhaps the false origin may help.

Regards
Andrew

From: proj-bounces at lists.maptools.org [mailto:proj-bounces at lists.maptools.org] On Behalf Of Neil Robinson
Sent: Tuesday, 12 August 2008 6:10 PM
To: geraldi.evenden at gmail.com
Cc: proj at lists.maptools.org
Subject: Re: [Proj] Re: Proj Digest, Vol 51, Issue 2

Dear Gerald,

Thanks to your suggestion. In trying to give you a sample of expected output I've tested things more thoroughly (I'm a chemical engineer by training, so this geo-referenced mapping stuff is all new to me) and it does appear to be working correctly -- almost.

my input file, "Desktop/proj" had this:
27.5 0.00
27.5 10.0
27.5 20.0
27.5 30.0
27.58676 26.18728

My commands and output from the console:

neil at neil:~$ proj +proj=tmerc +ellps=WGS84 +lon_0=27 Desktop/proj
55660.46    0.00
54820.34    1105896.37
52324.06    2212444.34
48243.45    3320218.65
58652.24    2897715.76

In each case, the magnitudes are correct (as far as I can tell using other software) but the first column of values should all be negative.

i.e. Desired output:
-55660.46    0.00
-54820.34    1105896.37
-52324.06    2212444.34
-48243.45    3320218.65
-58652.24    2897715.76


Gerald I. Evenden wrote:

On Monday 11 August 2008 4:07:58 am Neil Robinson wrote:



Hi Gerard,



Thanks for your response. I realise that this isn't a support forum, but

I'm not getting any joy anywhere else and you are clearly very

knowledgeable on this topic



        ...



I tried lodging a bug with qgis [1], but they seemed to think the problem

was with proj4 (although, through my ignorance that was my guess, so I

might have planted the seed of that conclusion).





I would just use +proj=tmerc and put some added '-' flags to juggle the

I/O.

But that's somebody else's job as I only work on the library.  ;-)



I tried this suggestion (I think I did), but negative zero doesn't make any

sense to proj4.

Without adding the '-' flags, this is what I think the parameters need to

be for one of the projections I'm interested in:



+proj=tmerc +ellps=WGS84 +lat_0 +lon_29 +k=1 +towgs84=0,0,0,0,0,0,0

+units=m +no_defs





Can you give a sample input (lat/lon) and an approximation of what you expect

(without datum conversion which I cannot handle).  Under normal circumstances

the above would generate (viewed as a console screen capture):



gie at charon:~$ lproj +proj=tmerc +ellps=WGS84 +lon_0=29

31 45

157693.72       4986890.93



Note; option +towgs84 and +no_defs is not on my software and the other options

are defaulted as you explicitly specified.



The input is longitude(31), latitude(45) and the output is easting(x) and

northing(y) in meters.



What output would you prefer to see?




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20080813/93568337/attachment.html


More information about the Proj mailing list