[mapserver-users] GetFeatureInfo error with native vector tileindex

Rahkonen Jukka (Tike) jukka.rahkonen at mmmtike.fi
Tue Aug 12 04:27:25 PDT 2014


Even Rouault wrote:

> Le lundi 11 août 2014 15:13:47, Rahkonen Jukka (Tike) a écrit :
> > Hi,
> >
> > I have something like 10000 shapefiles which I have combined to one
> > layer with a tileindex shapefile which is created with ogrtindex
> > utility. I can make WMS to render the layer fine both with the native
> > Mapserver tileindex connection and by reading the tileindex with OGR
> > by using CONNECTIONTYPE OGR.  However, GetFeatureInfo works well only
> > with OGR connection to tileindex. The native tileindex throws
> > occasionally this error (record number varies, naturally).
> >
> > msDBFReadAttribute(): DBASE file error. Invalid record number 231855.
> 
> Is the error always the same or changing for the exact same GetFeatureInfo
> request ?
> Are you able to determine which shape is at that location and find how many
> records are there in the .DBF ? (what ogrinfo should report) That error is
> returned when :
> if( hEntity < 0 || hEntity >= psDBF->nRecords ) So it would mean that there is an
> attempt of reading more records than there are actually. Which could happen if
> the DBF would be truncated. But I'm not clear why you wouldn't see the error
> through OGR.
> Difficult to know without being able to reproduce...


Hi,

At least I can reproduce something odd now with a minimal setup which I can share.
 
I use a trimmed MS4W version with fresh Mapserver 6.5-dev binaries from gisinternals.

The test package is in http://latuviitta.org/downloads/vectortileindex_map.zip
The package contains:
- mapfile in \apps
- one shapefile in \apps\data
- ogrtindex index shap in \apps
- GetFeatureInfo templates for text/html output in \apps\templates

Mapfile has section:
     CONNECTIONTYPE OGR
     TILEINDEX "c:\ms4w\apps\debug.shp"
     TILEITEM "location"

When tileindex is read like this through OGR GetFeatureInfo works but not if CONNECTIONTYPE OGR is commented out. Rendering works fine with both settings.

Here is a request to test with. It should find data as
KALTEVUUS 	ALA 	NOPEUS 	EROOSIO
0.400000 	0.630000 	16.000000 	0

http://localhost:8060/cgi-bin/mapserv.exe?map=/ms4w/apps/vectortileindex.map&&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=322114.29698474460747093,6747927.06825653277337551,322258.16823926079086959,6748042.80528055597096682&CRS=EPSG:3067&WIDTH=1079&HEIGHT=868&LAYERS=SMK_uoma-analyysi_ala&STYLES=&FORMAT=image/png&QUERY_LAYERS=SMK_uoma-analyysi_ala&INFO_FORMAT=text/html&I=813&J=483&FEATURE_COUNT=10
 
With DEBUG 5 and when having a correctly working OGR connection into tileindex I get all this into MS_ERRORFILE after successful GetFeatureInfo

[Tue Aug 12 14:11:33 2014].119000 msOGRFileOpen(c:\ms4w\apps\debug.shp)...
[Tue Aug 12 14:11:33 2014].119000 OGROPen(c:\ms4w\apps\debug.shp)
[Tue Aug 12 14:11:33 2014].119000 msConnPoolRegister(SMK_uoma-analyysi_ala,(null),019956E0)
[Tue Aug 12 14:11:33 2014].119000 msOGRFileOpen(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp,0)...
[Tue Aug 12 14:11:33 2014].119000 OGROPen(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp)
[Tue Aug 12 14:11:33 2014].119000 msConnPoolRegister(SMK_uoma-analyysi_ala,(null),019C3638)
[Tue Aug 12 14:11:33 2014].119000 msOGRFileWhichShapes: Setting spatial filter to 3322545.770087 6750733.636809 3322548.437923 6750736.304646
[Tue Aug 12 14:11:33 2014].119000 msOGRFileClose(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp,0).
[Tue Aug 12 14:11:33 2014].119000 msConnPoolRelease(SMK_uoma-analyysi_ala,(null),019C3638)
[Tue Aug 12 14:11:33 2014].119000 msOGRFileOpen(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp,0)...
[Tue Aug 12 14:11:33 2014].119000 OGROPen(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp)
[Tue Aug 12 14:11:33 2014].129000 msConnPoolRegister(SMK_uoma-analyysi_ala,(null),019CACC0)
[Tue Aug 12 14:11:33 2014].129000 msOGRFileWhichShapes: Setting spatial filter to 3322545.770087 6750733.636809 3322548.437923 6750736.304646
[Tue Aug 12 14:11:33 2014].129000 msOGRFileNextShape: Returning shape=130023, tile=0
[Tue Aug 12 14:11:33 2014].129000 msOGRFileNextShape: Returning MS_DONE (no more shapes)
[Tue Aug 12 14:11:33 2014].129000 msOGRFileClose(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp,0).
[Tue Aug 12 14:11:33 2014].129000 msConnPoolRelease(SMK_uoma-analyysi_ala,(null),019CACC0)
[Tue Aug 12 14:11:33 2014].129000 msOGRFileOpen(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp,0)...
[Tue Aug 12 14:11:33 2014].129000 OGROPen(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp)
[Tue Aug 12 14:11:33 2014].139000 msConnPoolRegister(SMK_uoma-analyysi_ala,(null),019CADA0)
[Tue Aug 12 14:11:33 2014].139000 msOGRFileWhichShapes: Setting spatial filter to 3322545.770087 6750733.636809 3322548.437923 6750736.304646
[Tue Aug 12 14:11:33 2014].139000 freeLayer(): freeing layer at 0198D638.
[Tue Aug 12 14:11:33 2014].139000 msOGRLayerClose((null)).
[Tue Aug 12 14:11:33 2014].139000 msOGRFileClose(c:\ms4w\apps\debug.shp,0).
[Tue Aug 12 14:11:33 2014].139000 msConnPoolRelease(SMK_uoma-analyysi_ala,(null),019956E0)
[Tue Aug 12 14:11:33 2014].139000 msOGRFileClose(c:/ms4w/apps/data/vesiensuojelu_teema_ii.shp,0).
[Tue Aug 12 14:11:33 2014].139000 msConnPoolRelease(SMK_uoma-analyysi_ala,(null),019CADA0)

With native connection to tileindex I do not get anything at all into errorfile despite using DEBUG 5. So with this small set I do not get those two kind of errors which I get from the big vector tileindex: 
"msDBFReadAttribute(): DBASE file error. Invalid record number 231855." or 
" msDBFReadAttribute(): DBASE file error. Invalid field index 0."

Regards,

-Jukka Rahkonen-


More information about the mapserver-users mailing list