Piero, It seems the DSN is different in the 2 examples below. Is this intentional?
You should also make sure that the same gdal dll is actually used by ogrinfo and mapserver. Best regards, Tamas 2008/2/13, Piero Cavalieri <[EMAIL PROTECTED]>: > > > > > Hi all, > > > > I have a problem with OGR layer. > > > > In map file: > > … > > … > > CONNECTIONTYPE OGR > > CONNECTION " > > <OGRVRTDataSource> > > <OGRVRTLayer name='pontiProvinciali'> > > <SrcDataSource>ODBC:xxx/[EMAIL PROTECTED]</SrcDataSource> > > <SrcLayer> dbo.PONTE </SrcLayer> > > <GeometryField encoding='PointFromColumns' x='Latitudine' > y='Longitudine'/> > > <GeometryType>wkbPoint</GeometryType> > > <SrcSQL> > > select DENOMINAZIONE_UFFICIALE + ' (' + IDENTIFICATIVO + ')' as > Etichetta, Latitudine, Longitudine from PONTE where IDENTIFICATIVO like > 'SP%' > > </SrcSQL> > > </OGRVRTLayer> > > </OGRVRTDataSource>" > > CLASS > > … > > … > > > > Testing connection with ogrinfo is ok (connection ok, all features > returned): > > Layer name: pontiProvinciali > > Geometry: Point > > Feature Count: 524 > > Extent: (0.000000, 0.000000) - (5146718.200000, 1726532.780000) > > Layer SRS WKT: > > (unknown) > > Etichetta: String (231.0) > > Latitudine: Real (10.2) > > Longitudine: Real (10.2) > > OGRFeature(pontiProvinciali):0 > > Etichetta (String) = rio Merdar (SP 1 km 0.638 ) > > Latitudine (Real) = 5100693.00 > > Longitudine (Real) = 1672733.00 > > POINT (5100693 1672733 0) > > > > OGRFeature(pontiProvinciali):1 > > … > > … > > > > > > But with mapserver, in log: > > > > Wed Feb 13 10:30:00 2008,1364,127.0.0.1,TRENTINO,0,1601927.675913 > 5057438.805019 1739281.629519 5158103.889549,1670604.652716 > 5107771.347284,DTM ammcmp_grp idro_grp viapri vie srt pontiProvinciali > ,msDrawMap(): Image handling error. Failed to draw layer named > 'pontiProvinciali'. <br> > > msOGRFileOpen(): OGR error. Open failed for OGR connection ` > > <OGRVRTDataSource> > > <OGRVRTLayer name='pontiProvinciali'> > > <SrcDataSource>ODBC:xxx/[EMAIL PROTECTED]</SrcDataSource> > > <SrcLayer>dbo.PONTE</SrcLayer> > > <GeometryField encoding='PointFromColumns' x='Latitudine' > y='Longitudine'/> > > <GeometryType>wkbPoint</GeometryType> > > <SrcSQL> > > select DENOMINAZIONE_UFFICIALE + ' (' + IDENTIFICATIVO + ')' as > Etichetta'. File not found or unsupported format. <br> > > > > > > > > I have also another ovf layer (on SQL Server 2005, with another ODBC > connection), and that one works ok, so I don't understand where's the > problem. > > Anyone have some tips ? > > > > Thanks in advance > > Piero