Opened 6 years ago

Closed 6 years ago

#6340 closed defect (invalid)

GDAL doesn't support some Proj4 variable flags (ex. no_rot)

Reported by: bmoregeo Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: 1.10.1
Severity: normal Keywords: no_rot, axis, proj4
Cc:

Description

I am trying to add projection information to an existing raster using a proj4 string.

The input proj4 string is as follows

+proj=omerc +lat_0=0 +lonc=0 +alpha=87.90209000000001 +x_0=10394275.61336197 +y_0=5942765.637300909 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +to_meter=0.04583774658203 +no_defs +no_rot +axis=end

When I execute

gdal_translate -of PNG -a_srs "+proj=omerc +lat_0=0 +lonc=0 +alpha=87.90209000000001 +x_0=10394275.61336197 +y_0=5942765.637300909 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +to_meter=0.04583774658203 +no_defs +no_rot +axis=end" sample.png cli_prj.png

gdalinfo -proj4 cli_prj.png

the resulting proj4 string is missing the +no_rot and +axis=end flags

+proj=omerc +lat_0=0 +lonc=0 +alpha=87.90209000000001 +k=1 +x_0=10394275.61336197 +y_0=5942765.637300907 +gamma=0 +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +to_meter=0.04583774658203 +no_defs

Attachments (1)

6340.patch (10.8 KB) - added by Even Rouault 6 years ago.
Add debug message if some proj.4 parameters aren't used

Download all attachments as: .zip

Change History (4)

comment:1 Changed 6 years ago by Even Rouault

You can add +wktext at the end of the proj4 string to solve this: See http://www.gdal.org/classOGRSpatialReference.html#af1a29550373c2c14bd11514641e58e7c

comment:2 Changed 6 years ago by bmoregeo

WOW you all are fast. Yeah that fixed it!

comment:3 Changed 6 years ago by Even Rouault

Resolution: invalid
Status: newclosed

I'm going to close this without further action. I had prepared a patch to issue a debug message when proj parameters aren't used, but it has some shortcomings and I don't believe it is really needed after all. Attaching it however in case it might be helpful

Changed 6 years ago by Even Rouault

Attachment: 6340.patch added

Add debug message if some proj.4 parameters aren't used

Note: See TracTickets for help on using tickets.