~ubuntu-branches/debian/sid/gdal/sid

« back to all changes in this revision

Viewing changes to ogr/ogrsf_frmts/pgeo/ogrpgeotablelayer.cpp

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2012-05-07 15:04:42 UTC
  • mfrom: (5.5.16 experimental)
  • Revision ID: package-import@ubuntu.com-20120507150442-2eks97loeh6rq005
Tags: 1.9.0-1
* Ready for sid, starting transition.
* All symfiles updated to latest builds.
* Added dh_numpy call in debian/rules to depend on numpy ABI.
* Policy bumped to 3.9.3, no changes required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: ogrpgeotablelayer.cpp 20191 2010-08-06 16:27:21Z rouault $
 
2
 * $Id: ogrpgeotablelayer.cpp 22155 2011-04-13 19:52:57Z rouault $
3
3
 *
4
4
 * Project:  OpenGIS Simple Features Reference Implementation
5
5
 * Purpose:  Implements OGRPGeoTableLayer class, access to an existing table.
29
29
 
30
30
#include "cpl_conv.h"
31
31
#include "ogr_pgeo.h"
 
32
#include "ogrpgeogeometry.h"
32
33
 
33
 
CPL_CVSID("$Id: ogrpgeotablelayer.cpp 20191 2010-08-06 16:27:21Z rouault $");
 
34
CPL_CVSID("$Id: ogrpgeotablelayer.cpp 22155 2011-04-13 19:52:57Z rouault $");
34
35
 
35
36
/************************************************************************/
36
37
/*                          OGRPGeoTableLayer()                         */
100
101
 
101
102
    switch( nShapeType )
102
103
    {
103
 
        case SHPT_POINT:
104
 
        case SHPT_POINTM:
105
 
        case SHPT_POINTZ:
106
 
        case SHPT_POINTZM:
 
104
        case ESRI_LAYERGEOMTYPE_NULL:
 
105
            eOGRType = wkbNone;
 
106
            break;
 
107
 
 
108
        case ESRI_LAYERGEOMTYPE_POINT:
107
109
            eOGRType = wkbPoint;
108
110
            break;
109
111
 
110
 
        case SHPT_ARC:
111
 
        case SHPT_ARCZ:
112
 
        case SHPT_ARCM:
113
 
        case SHPT_ARCZM:
 
112
        case ESRI_LAYERGEOMTYPE_MULTIPOINT:
 
113
            eOGRType = wkbMultiPoint;
 
114
            break;
 
115
 
 
116
        case ESRI_LAYERGEOMTYPE_POLYLINE:
114
117
            eOGRType = wkbLineString;
115
118
            break;
116
 
            
117
 
        case SHPT_MULTIPOINT:
118
 
        case SHPT_MULTIPOINTZ:
119
 
        case SHPT_MULTIPOINTM:
120
 
        case SHPT_MULTIPOINTZM:
121
 
            eOGRType = wkbMultiPoint;
 
119
 
 
120
        case ESRI_LAYERGEOMTYPE_POLYGON:
 
121
        case ESRI_LAYERGEOMTYPE_MULTIPATCH:
 
122
            eOGRType = wkbPolygon;
122
123
            break;
123
124
 
124
125
        default:
 
126
            CPLDebug("PGeo", "Unexpected value for shape type : %d", nShapeType);
125
127
            eOGRType = wkbUnknown;
126
128
            break;
127
129
    }
128
130
 
129
 
    if( eOGRType != wkbUnknown && bHasZ )
 
131
    if( eOGRType != wkbUnknown && eOGRType != wkbNone && bHasZ )
130
132
        eOGRType = (OGRwkbGeometryType)(((int) eOGRType) | wkb25DBit);
131
133
 
132
134
/* -------------------------------------------------------------------- */
278
280
    poStmt = new CPLODBCStatement( poDS->GetSession() );
279
281
    poStmt->Append( "SELECT * FROM " );
280
282
    poStmt->Append( poFeatureDefn->GetName() );
281
 
    poStmt->Appendf( " WHERE %s = %d", pszFIDColumn, nFeatureId );
 
283
    poStmt->Appendf( " WHERE %s = %ld", pszFIDColumn, nFeatureId );
282
284
 
283
285
    if( !poStmt->ExecuteSQL() )
284
286
    {