>>>>>>>>>>>>>>> add below to ogrfeature.cpp (I put after DumpReadable) /************************************************************************/ /* Summary() */ /************************************************************************/ static void SumGeom( OGRGeometry * poGeometry, FILE * fpOut ) { OGRLineString *poLine; OGRPolygon *poPoly; OGRLinearRing *poRing; OGRGeometryCollection *poColl; if( poGeometry != NULL ) { fprintf( fpOut, "%s ", poGeometry->getGeometryName() ); switch( poGeometry->getGeometryType() ) { case wkbUnknown: case wkbNone: break; case wkbPoint: case wkbPoint25D: break; case wkbLineString: case wkbLineString25D: poLine = (OGRLineString*)poGeometry; fprintf( fpOut, "%d points\n", poLine->getNumPoints() ); break; case wkbPolygon: case wkbPolygon25D: poPoly = (OGRPolygon*)poGeometry; poRing = poPoly->getExteriorRing(); fprintf( fpOut, "%d points, %d inner rings\n", poRing->getNumPoints(), poPoly->getNumInteriorRings() ); break; case wkbMultiPoint: case wkbMultiPoint25D: case wkbMultiLineString: case wkbMultiLineString25D: case wkbMultiPolygon: case wkbMultiPolygon25D: case wkbGeometryCollection: case wkbGeometryCollection25D: poColl = (OGRGeometryCollection*)poGeometry; fprintf( fpOut, "%d geometries:\n", poColl->getNumGeometries() ); for ( int ig = 0; ig < poColl->getNumGeometries(); ig++) { fprintf( fpOut, " "); OGRGeometry * poChild = (OGRGeometry*)poColl->getGeometryRef(ig); SumGeom( poChild, fpOut ); } break; case wkbLinearRing: break; } fprintf( fpOut, "\n" ); } } /** * Summarize this feature in a human readable form. * * @param fpOut the stream to write to, such as stdout. If NULL stdout will * be used. */ void OGRFeature::Summary( FILE * fpOut , int bField ) { if( fpOut == NULL ) fpOut = stdout; fprintf( fpOut, "OGRFeature(%s):%ld\n", poDefn->GetName(), GetFID() ); if ( bField ) { for( int iField = 0; iField < GetFieldCount(); iField++ ) { OGRFieldDefn *poFDefn = poDefn->GetFieldDefn(iField); fprintf( fpOut, " %s (%s) = ", poFDefn->GetNameRef(), OGRFieldDefn::GetFieldTypeName(poFDefn->GetType()) ); if( IsFieldSet( iField ) ) fprintf( fpOut, "%s\n", GetFieldAsString( iField ) ); else fprintf( fpOut, "(null)\n" ); } } SumGeom( poGeometry, fpOut ); } >>>>>>>>>>>>>>> add below to ogr_feature.h (I put after DumpReadable) void Summary( FILE *, int bField ); >>>>>>>>>>>>>>> supporting changes in ogrinfo.cpp 41,42d40 < int bBrief = FALSE; // RME addition for geom summary < int bField = FALSE; // RME addition for geom summary 129,140d126 < /* RME extension */ < else if( EQUAL(papszArgv[iArg],"-br") < || EQUAL(papszArgv[iArg],"-brief") ) < { < bBrief = TRUE; < } < /* RME extension */ < else if( EQUAL(papszArgv[iArg],"-fi") < || EQUAL(papszArgv[iArg],"-fields") ) < { < bField = TRUE; < } 304c290 < " [-sql statement] [-al] [-so] [-br] [-fi] [--formats]\n" --- > " [-sql statement] [-al] [-so] [--formats]\n" 390,394c376 < /* RME extension */ < if (bBrief) < poFeature->Summary( NULL, bField ); < else < poFeature->DumpReadable( NULL ); --- > poFeature->DumpReadable( NULL );