[GRASS-user] Problem reprojecting to UTM 34 S

Rainer M Krug r.m.krug at gmail.com
Fri May 16 04:03:14 EDT 2008


On Thu, May 15, 2008 at 8:01 PM, Tom Russo <russo at bogodyn.org> wrote:
> On Thu, May 15, 2008 at 06:16:34PM +0200, we recorded a bogon-computron collision of the <r.m.krug at gmail.com> flavor, containing:
>> On Thu, May 15, 2008 at 4:46 PM, Michael Perdue <michael_perdue at yahoo.ca> wrote:
>> > From what I see, gdalinfo hak_ser2.asc is listing all the latitudes as being
>> > positive which means that they are in the northern hemisphere. It looks to
>> > me like gdal is doing the right thing and there is something wrong with the
>> > ASCII grid.
>
> That's not how I read it.  The upper left corner is
>> >> Upper Left  (  15.9916667, -21.9918333)
>
> which is 15.9916667 East longitude and 21.9918333 South latitude.


OK - I think we are getting somewhere.

>
>> >> I have a ESRI asc raster in +proj=longlat +ellps=D_Clarke_1866 +no_defs
> [...]
>> >>
>> >> gdalwarp -s_srs '+proj=longlat +ellps=D_Clarke_1866 +no_defs' -t_srs
>> >> EPSG:32734 hak_ser2.asc hak_ser2_utm34.asc
>> >>
>> >> where EPSG:323734 is the definition for UTM 34 S WGS 84
>
> I assume you mean "32734" not "323734" --- 32734 is WGS84 Zone 34 southern
> hemisphere.

Right - sorry.

>
>> >> But I get:
>> >>
>> >> rkrug at ecolmod1:~/Documents/Projects/AlienSpread/GIS.local/Rainer_subset>
>> >> gdalinfo hak_ser2_utm34.asc
>> >> Driver: GTiff/GeoTIFF
>> >> Files: hak_ser2_utm34.asc
>> >> Size is 1028, 880
>> >> Coordinate System is:
>> >> PROJCS["WGS 84 / UTM zone 34N",
>> >>   GEOGCS["WGS 84",
>> >>       DATUM["WGS_1984",
>> >>           SPHEROID["WGS 84",6378137,298.2572235629972,
>> >>               AUTHORITY["EPSG","7030"]],
>> >>           AUTHORITY["EPSG","6326"]],
>> >>       PRIMEM["Greenwich",0],
>> >>       UNIT["degree",0.0174532925199433],
>> >>       AUTHORITY["EPSG","4326"]],
>> >>   PROJECTION["Transverse_Mercator"],
>> >>   PARAMETER["latitude_of_origin",0],
>> >>   PARAMETER["central_meridian",21],
>> >>   PARAMETER["scale_factor",0.9996],
>> >>   PARAMETER["false_easting",500000],
>> >>   PARAMETER["false_northing",0],
>> >>   UNIT["metre",1,
>> >>       AUTHORITY["EPSG","9001"]],
>> >>   AUTHORITY["EPSG","32634"]]
>
> That's odd --- you say you used "EPSG:32734" but this last line clearly
> shows "32634" (which is WGS 84 zone 34 Northern hemisphere).  Is it
> possible you fat-fingered when typing in the command line?

No - just checked it and see below.

>
> If not, maybe you could try using the PROJ.4 specification for the
> coordinate system for -t_srs instead of the EPSG number?
>
>  gdalwarp -t_srs '+proj=utm +zone=34 +south +ellps=WGS84 +datum=WGS84 +units=m +no_defs' -s_srs '+proj=longlat +ellps=D_Clarke_1866 +no_defs' hak_ser2.asc hak_ser2_utm34.asc

Here are the results as suggested:

~/> gdalwarp -s_srs '+proj=longlat +ellps=D_Clarke_1866 +no_defs'
-t_srs '+proj=utm +zone=34 +south +ellps=WGS84 +datum=WGS84 +
units=m +no_defs' hak_ser2.asc hak_ser2_utm34.asc
Processing input file hak_ser2.asc.
Using internal nodata values (eg. -9999) for image hak_ser2.asc.
0...10...20...30...40...50...60...70...80...90...100 - done.

~/> gdalinfo hak_ser2_utm34.asc
Driver: GTiff/GeoTIFF
Files: hak_ser2_utm34.asc
Size is 1028, 880
Coordinate System is:
PROJCS["WGS 84 / UTM zone 34N",
    GEOGCS["WGS 84",
        DATUM["WGS_1984",
            SPHEROID["WGS 84",6378137,298.2572235629972,
                AUTHORITY["EPSG","7030"]],
            AUTHORITY["EPSG","6326"]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433],
        AUTHORITY["EPSG","4326"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",21],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AUTHORITY["EPSG","32634"]]
Origin = (-17471.391705359546904,-2431926.174459759611636)
Pixel Size = (1715.270741799227608,-1715.270741799227608)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  -17471.392,-2431926.174) ( 15d59'39.65"E, 21d54'55.81"S)
Lower Left  (  -17471.392,-3941364.427) ( 15d17'55.27"E, 35d28'51.77"S)
Upper Right ( 1745826.931,-2431926.174) ( 32d58'5.17"E, 21d33'19.99"S)
Lower Right ( 1745826.931,-3941364.427) ( 34d34'59.95"E, 34d50'47.92"S)
Center      (  864177.770,-3186645.301) ( 24d43'43.82"E, 28d45'21.15"S)
Band 1 Block=1028x1 Type=Float32, ColorInterp=Gray
>

>
> If that works, then perhaps there's something goofy with how GDAL is processing
> your EPSG number (maybe leaving off the "+south" when it creates the proj.4
> arguments?).  What version of GDAL are you using?

GDAL 1.5.0, released 2007/12/18

>
> --
> Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
> Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
>  "It's so simple to be wise: just think of something stupid to say and
>  then don't say it."  --- Sam Levinson
>
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa


More information about the grass-user mailing list