[postgis-users] transform() does not do work for NGO1948 zone III-> WGS84 longlat (epsg:27393->epsg:4326)

Michael Fuhr mike at fuhr.org
Thu Dec 22 08:54:01 PST 2005


On Thu, Dec 22, 2005 at 09:46:48AM -0500, Frank Warmerdam wrote:
> On 12/22/05, Havard Tveite <havard.tveite at umb.no> wrote:
> > It is nice to provide warnings, but for epsg:27393 -> epsg:4326
> > the following problems persist:
> >
> > 1) Longitude of origin (+lon_0=-10.72291666666667) is ignored
> >     (as demonstrated by strk's query).
> 
> Are you sure that the the +lon_0 is being ignored?  It seems more
> likely that it is being undone by the +pm=oslo.  There are a variety of
> problems with prime meridian handling in the EPSG->proj.4 translation
> process.  I would suggest modifying the PROJ.4 definition to not
> include the +pm=oslo and see if that helps.

I don't think anybody has mentioned the PROJ.4 program cs2cs, which
you can use to do conversions from the command line; this is a
convenient way to remove PostGIS from the conversion process to see
if it's the problem.

Here's an example that converts from 27393 to 4326:

echo 2836.394208896 185526.991186176 | 
cs2cs +proj=tmerc +lat_0=58 +lon_0=-10.72291666666667 \
      +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 \
      +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 \
      +pm=oslo \
      +units=m +no_defs \
      +to \
      +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs \
      -f "%.8f"

0.04642016      59.66619169 -6.08805941

These are the same numbers people have been seeing in PostGIS (I
think the third coordinate is Z).  Here's the same example,
omitting +pm=oslo:

echo 2836.394208896 185526.991186176 | 
cs2cs +proj=tmerc +lat_0=58 +lon_0=-10.72291666666667 \
      +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 \
      +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 \
      +units=m +no_defs \
      +to \
      +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs \
      -f "%.8f"

-10.67553750    59.66595692 -17.39326135

Here's the example with +pm=oslo and without +lon_0:

echo 2836.394208896 185526.991186176 | 
cs2cs +proj=tmerc +lat_0=58 \
      +k=1.000000 +x_0=0 +y_0=0 +a=6377492.018 +b=6356173.508712696 \
      +towgs84=278.3,93,474.5,7.889,0.05,-6.61,6.21 \
      +pm=oslo \
      +units=m +no_defs \
      +to \
      +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs \
      -f "%.8f"

10.76845023     59.66650218 0.30776738

These aren't exactly the numbers Håvard got in the old version
of PostGIS but they're getting close.

-- 
Michael Fuhr



More information about the postgis-users mailing list