[Proj] How to Scale a Mercator projection?

Frank Warmerdam warmerdam at pobox.com
Tue Jul 25 21:42:42 EDT 2006


Christopher Barker wrote:
>>> """
>>> 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.

Chris,

Yes, and apparently my typo.   I have fixed this.

> 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.

Ugg.  What a nightmare.

I think I've seriously mixed things up by not properly
differentiating between the 1SP and 2SP forms of Mercator
in my OGR / WKT handling code and I'll need to do some work
to fix that.

> 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.

My understanding is that PROJ.4 does not support a latitude of origin
(ie. lat_0) other than the equator.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org



More information about the Proj mailing list