[gdal-dev] SQL results truncated

Clay, Bruce bclay at ball.com
Wed Nov 4 12:25:13 EST 2009


It seems like I encountered this problem before but I can not find any
information about it now.

 

If I run a SQ script like the following

 

Select * from

 (Select MIN_LAT - (round((MIN_LAT - LATITUDE) / (MAX_LAT - MIN_LAT) *
1728.497600)) * 0.000579 LAT2,

         MAX_LON - (round((LONGITUDE - MAX_LON) / (MIN_LON - MAX_LON) *
1814.921600)) * 0.000551 LON2,

         Round(sum(TRACK_SIZE) / 1.000000) CONFIDENCE,

         max(B_TEMP) Intensity,

         min(TO_CHAR(DATE_TIME, 'MM-DD-YYYY HH24:MI:SS')) DATE_TIME 

    FROM

       WACDS.MODIS_ACTIVE_FIRE WHERE

          LATITUDE BETWEEN MIN_LAT AND MAX_LAT AND

          LONGITUDE BETWEEN MIN_LON AND MAX_LON AND

          DATE_TIME BETWEEN TO_DATE('03/01/2007 00:00:00' , 'MM-DD-YYYY
HH24:MI:SS') AND

                            TO_DATE('04/30/2007 23:59:59' , 'MM-DD-YYYY
HH24:MI:SS') AND

          CONFIDENCE > 1.000000

    GROUP BY

        round((MIN_LAT - LATITUDE) / (MAX_LAT - MIN_LAT) * 1728.497600),

        round((LONGITUDE - MAX_LON) / (MIN_LON - MAX_LON) *
1814.921600))

  where 

    (CONFIDENCE * 1.000000) > 1.000000

  ORDER BY DATE_TIME

 

From sqlPal I get LAT2 and LON2 data back as doubles

 

If I run it through OGR ExecuteSql the LAT2 and LON2 data comes back as
integers and can not be used to plot the data

 

OGRFieldDefn *fieldDef = featureDef->GetFieldDefn(fieldIndex);

if (fieldDef != NULL)

{

      fieldType = fieldDef->GetType();

}

 

Returns type integer

 

And both

 

 const char *latStr = (char *)feature->GetFieldAsString("LAT2");

 

  double latitude = feature->GetFieldAsDouble("LAT2");

 

 

return(only the whole portion of what I see in sqlPal.

 

 

Does anyone see / know what might be going wrong?

 

Bruce

 




This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20091104/777ad99a/attachment.html


More information about the gdal-dev mailing list