Changeset 11226
- Timestamp:
- 04/08/07 10:54:41 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.4/gdal/ogr/ogrsf_frmts/pg/ogrpglayer.cpp
r11225 r11226 32 32 #include "ogr_pg.h" 33 33 #include "ogrpgutility.h" 34 #include "ogr_p.h" 34 35 #include "cpl_conv.h" 35 36 #include "cpl_string.h" … … 267 268 GByte * pabyWkb = (GByte *)PQgetvalue( hCursorResult, 268 269 iRecord, iField); 270 271 272 269 273 OGRGeometry * poGeom = NULL; 270 274 OGRGeometryFactory::createFromWkb(pabyWkb,NULL,&poGeom); … … 625 629 626 630 { 627 GByte *pabyWKB; 628 int iSrc=0, iDst=0; 629 OGRGeometry *poGeometry; 631 GByte *pabyWKB = NULL; 632 int iSrc=0; 633 int iDst=0; 634 OGRGeometry *poGeometry = NULL; 635 unsigned int ewkbFlags = 0; 630 636 631 637 if( pszBytea == NULL ) … … 665 671 666 672 /* -------------------------------------------------------------------- */ 673 /* Detect XYZM variant of PostGIS EWKB */ 674 /* */ 675 /* OGR does not support parsing M coordinate, */ 676 /* so we return NULL geometry. */ 677 /* -------------------------------------------------------------------- */ 678 memcpy(&ewkbFlags, pabyWKB+1, 4); 679 OGRwkbByteOrder eByteOrder = (pabyWKB[0] == 0 ? wkbXDR : wkbNDR); 680 if( OGR_SWAP( eByteOrder ) ) 681 ewkbFlags= CPL_SWAP32(ewkbFlags); 682 683 if (ewkbFlags & 0x40000000) 684 { 685 CPLError( CE_Failure, CPLE_AppDefined, 686 "Reading EWKB with 4-dimensional coordinates (XYZM) is not supported" ); 687 688 CPLFree( pabyWKB ); 689 return NULL; 690 } 691 692 /* -------------------------------------------------------------------- */ 667 693 /* PostGIS EWKB format includes an SRID, but this won't be */ 668 694 /* understood by OGR, so if the SRID flag is set, we remove the */
