[Gdal-dev] Bug in osr.py CoordinateTransformation for mercator projection?

Christopher Barker Chris.Barker at noaa.gov
Mon Jul 24 16:12:54 EDT 2006


Hi all,

I'm struggling with trying to figure out how to convert pixels to 
lat/long for a raster nautical chart in BSB format.

Part of why I'm having trouble is that there is either a bug in 
osr.CoordinateTransformation, or i am missing something important in how 
it's supposed to work.

I'm trying to set up a Mercator projection with:
osr.SpatialReference.SetMercator, like so:

proj = osr.SpatialReference()
proj.SetWellKnownGeogCS( "WGS84" )
proj.SetMercator(clat = 0,
                  clong= 0,
                  scale=1,
                  fe=30,
                  fn=30,
                  )

While I'm not sure what all the parameters should be from the BSB file, 
I do have some idea. Most of the parameters behave as I suspect, except 
that the "scale" parameter seems to do nothing. It's kind of critical 
for my needs, however. Despite the value of the scale parameter not 
effecting the results, if I pass in a zero, I get an error (which I 
would expect), so it looks like the value is being passed to Proj4. What 
am I missing?

I've enclosed a little test script that does a transformation with 
different scale values, and there is no difference in the output.

Or do I need to do the scaling my self?

By the way, is there a better list to ask this on? this is the third 
related question I've asked, with nary a reply -- maybe I'm on teh wrong 
list.

-thanks,
-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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MercatorTest.py
Type: text/x-python
Size: 1594 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20060724/d48d1817/MercatorTest.py


More information about the Gdal-dev mailing list