Skip to content

Commit

Permalink
limit ogr integer fields to width 10, otherwise they become real
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@8355 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 17, 2008
1 parent 44b97a3 commit e2ea490
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1208,6 +1208,7 @@ QGISEXTERN bool createEmptyDataSource(const QString& uri,
else if(it->second == "Integer")
{
OGRFieldDefnH field = OGR_Fld_Create(codec->fromUnicode(it->first).data(), OFTInteger);
OGR_Fld_SetWidth(field,10); // limit to 10. otherwise OGR sets it to 11 and recognizes as OFTDouble later
if(OGR_L_CreateField(layer,field,TRUE) != OGRERR_NONE)
{
QgsLogger::warning("creation of OFTInteger field failed");
Expand Down

0 comments on commit e2ea490

Please sign in to comment.