[Proj] How to Scale a Mercator projection?

Christopher Barker Chris.Barker at noaa.gov
Tue Jul 25 14:58:17 PDT 2006


Frank Warmerdam wrote:
> I'm sorry I haven't responded yet to any of your email on gdal-dev and
> elsewhere.  I have just checked, and I definately see an effect when
> specifying +k_0:
> 
> warmerda at gdal2200[82]% proj +proj=merc +ellps=WGS84 +k_0=0.998
> 5 5                          (input)
> 555484.26       552476.68    (output)
> warmerda at gdal2200[83]% proj +proj=merc +ellps=WGS84 +k_0=1.0
> 5 5                          (input)
> 556597.45       553583.85    (output)
> 
> Perhaps you could be more specific about how you determined it was having
> no effect?

Of course, your examples work for me too. Inspired by that, I went back 
to my examples, and found that I had always specified lat_ts. I thought 
I'd tested that, but I guess I had tested changing lat_ts to 0 or other 
values, but not removing it altogether. If you don't specify lat_ts, 
then k_0 does have the effect I'd expect. This is consistent (except for 
the 0)with:
>> """
>> A more common formulation for Mercator is to drop the +k_0, and 
>> instead to provide a latitude of true scale using the +lat_ts 
>> parameter, which is the latitude at which the scale is 0
>> """
> 
> Where exactly did you see this?  You are quite right that a scale of zero
> is nonsensical.

I found that here:
http://www.remotesensing.org/geotiff/proj_list/mercator_2sp.html

It must be a typo.

However, this is a GDAL issue. This all started with my trying to use 
the python bindings to osr. I initialized the projection with various 
versions of:

Proj.SetMercator( clat = 29.1333,
                   clong=-89.583333,
                   scale=0.0174532925199433,
                   fe=100,
                   fn=-2972000,
                   )

The scale parameter didn't make a difference. Thinking it may be an 
issue with the bindings, I then went straight to the proj command line 
tool, but I started with the command line spit out by osr.py when I 
passed in 0 as the scale:

ValueError: Failed to initialize PROJ.4 with `+proj=merc +lat_ts=29.1333 
+lon_0=-89.583333 +k=0.000000 +x_0=100 +y_0=-2972000 +ellps=WGS84 
+datum=WGS84 +units=m +no_defs '

In there, I see that lat_ts has been set, which is why scale didn't do 
anything. In fact, lat_ts is always set by osr.py, even if you set it to 
0, and, with the python bindings, you don't have the option of not 
setting it at all, as they are all non-keyword arguments.

This issue aside, I'm still a bit confused. My understanding is that the 
projection (at least on nautical charts) is defined by it being 
Mercator, and by the scale at a reference latitude. That's why I was 
trying to set lat_ts: I know the scale at a latitude near the middle of 
the chart. Given that the scale changes with latitude with a mercator 
projection, it seems that that's a needed parameter.

The other option is to calculate the scale from the reference points, 
but it would be nice to be able to do it directly with the info in the 
bsb file.

thanks for your help,

-Chris




-- 
Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the Proj mailing list