Opened 15 years ago
Closed 14 years ago
#3163 closed defect (fixed)
OGRLayer::GetFeatureCount returns a wrong value for SOUNDG layer
Reported by: | yilmaz | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.6.3 |
Component: | OGR_SF | Version: | 1.6.2 |
Severity: | normal | Keywords: | feature count, SOUNDG, sounding points |
Cc: |
Description
The following two pieces of code return different results:
// process the layer of sounding points if ( ( poLayer = poDS->GetLayerByName("SOUNDG") ) != NULL ) { poLayer->ResetReading(); printf("%d\n", poLayer->GetFeatureCount()); }
and
// process the layer of sounding points if ( ( poLayer = poDS->GetLayerByName("SOUNDG") ) != NULL ) { int x = 0; poLayer->ResetReading(); while( (poFeature = poLayer->GetNextFeature()) != NULL ) { x++; } printf("%d\n", x); }
regardless of SPLIT_MULTIPOINT option being ON or OFF.
The first one prints out the value 2, where the second one prints out 772. The same thing possibly does not happen with other layers (e.g. DEPCNT layer).
Change History (4)
comment:1 by , 15 years ago
Status: | new → assigned |
---|
comment:2 by , 15 years ago
I checked it, when SPLIT_MULTIPOINT is OFF, I get 14 features. When it is ON, I get 1228 features.
It behaves in the same way with my original file. So it was my mistake, that is, probably there is no problem when SPLIT_MULTIPOINT is OFF.
comment:4 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
I tried "ogrinfo GB4X0000.000 SOUNDG" and reported feature count is 14, and the actual number of features is 14. This is without split-multipoint.
Could you confirm if you have the same problem with the above file without split-multipoint on?
I would like to isolate whether this is just a splitting issue or not. If you don't have problems with GB4X0000.000 then I'll likely need access to your file.