[FWTools] OGR2OGR MySQL to Shapefile Truncating Decimal Places

Michael Thompson mthompson at geostats.com
Mon Feb 23 14:00:57 EST 2009

Hi All,


I'm attempting to create a ESRI shapefile from the results of a SQL
query on a MySQL DB using OGR2OGR included with FWTools 2.2.8.  The
operation completes  without reporting any errors and the shapefile is
created as expected, but when I load the shapefile in ArcMap all the
floating point columns in the attribute table have no decimal places.
If I run the query in MySQL Query Browser the results contain the
decimal places that I expect.  I've tried rounding the selected columns
in the query to force the results to have a set number of decimal places
but this does not seem to change the output.


Does anyone have any ideas as to what could be causing this behavior?
I was able to work around the problem by converting the double columns
to chars in the query so that OGR2OGR treated them as strings, but this
seems messy.





Michael Thompson

Software Engineer

mthompson at geostats.com <mailto:mthompson at geostats.com> 


GeoStats LP

530 Means St., Ste. 310

Atlanta, Georgia 30318

(404) 588-1004



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/fwtools/attachments/20090223/a617e85f/attachment.htm 

More information about the FWTools mailing list