Opened 12 years ago

Closed 12 years ago

#1997 closed defect (wontfix)

NaN values transformation in funtion Transform from OGRCoordinateTransformation class

Reported by: mgfernandes Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SRS Version: svn-trunk
Severity: normal Keywords: NaN
Cc:

Description (last modified by warmerdam)

When trying to transform an array with WGS84 latlon coordinates which has NaN values incorporated to UTM29 using functions Transform or TransformEX from class OGRCoordinateTransformation, the coordinates are transformed ok but the NaN values are transformed to Inf. This is the output from the test case I've attached:

Coordinates before transformation:

x: -8.95006 y: 37 -> is x nan: 0 is y nan: 0
x: -8.95009 y: 37 -> is x nan: 0 is y nan: 0
x: -1.#IND y: -1.#IND -> is x nan: 1 is y nan: 1
x: -8.94716 y: 37 -> is x nan: 0 is y nan: 0
x: -8.94716 y: 37 -> is x nan: 0 is y nan: 0

Coordinates after transformation:

x: 504444 y: 4.09488e+006 -> is x nan: 0 is y nan: 0
x: 504441 y: 4.09487e+006 -> is x nan: 0 is y nan: 0
x: 1.#INF y: 1.#INF -> is x nan: 0 is y nan: 0
x: 504702 y: 4.09487e+006 -> is x nan: 0 is y nan: 0
x: 504702 y: 4.09488e+006 -> is x nan: 0 is y nan: 0

The NaN values should be maintained.

Attachments (1)

teste.cpp (1.6 KB) - added by mgfernandes 12 years ago.
Transformation from latlon to utm29 using Transform from OGRCoordinateTransformation

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by mgfernandes

Attachment: teste.cpp added

Transformation from latlon to utm29 using Transform from OGRCoordinateTransformation

comment:1 Changed 12 years ago by warmerdam

Component: OGR_SFOGR_SRS
Description: modified (diff)
Keywords: NaN added

comment:2 Changed 12 years ago by warmerdam

Status: newassigned

Miguel,

What makes you think that the OGRCoordinateTransformation() function should treat NaN values in any particular way? Generally speaking GDAL and OGR services do *not* support NaN as an input and behavior is undefined when it is given.

comment:3 Changed 12 years ago by mgfernandes

Hello,

My interpretation of not treating values was that they were maintained from the input to the output but maybe i misinterpreted. If this behaviour is as it should be then I can close the ticket.

Best Regards, Miguel Fernandes

comment:4 Changed 12 years ago by warmerdam

Resolution: wontfix
Status: assignedclosed

Miguel,

There are no guarantees of special treatment of NaN for the coordinate transformation API (or the rest of GDAL/OGR really) so I'll close this ticket.

Note: See TracTickets for help on using tickets.