I have found that:
- for blank image: I swapped Latitude and Longitude (when doing copy and
paste...my mistake...)
-I still have strange behaviour:
<OGRVRTLayer name="pontiStatali">
<SrcDataSource>ODBC:xxx/[EMAIL PROTECTED],PONTE</SrcDataSource>
<GeometryField encoding="PointFromColumns" x="Longitudine"
y="Latitudine"/>
<SrcSQL>
...
</SrcSQL>
</OGRVRTLayer>
This one works.
But if I add another <OGRVRTLayer> node inside <OGRVRTDataSource> node:
<OGRVRTLayer name="pontiProvinciali">
<SrcDataSource>ODBC:xxx/[EMAIL PROTECTED],PONTE</SrcDataSource>
<GeometryField encoding="PointFromColumns" x="Longitudine"
y="Latitudine"/>
<SrcSQL>
...
</SrcSQL>
</OGRVRTLayer>
Both doesn't work anymore....and I have error like:
msOGRFileOpen(): OGR error. Open failed for OGR connection `ponti.ovf'.
Failed to find layer 'PontiProvinciali' on datasource 'ODBC:xx/[EMAIL
PROTECTED],PontiProvinciali
Funny thing, I have the same error on both layers (i.e. "Failed to find layer
'PontiProvinciali'" also on the other layer, which, alone, works...)
I have the same problem both with <SrcSQL> and using db views + <SrcLayer>
Now I try to put OGRVRTDataSource on different ovf files...
Cheers
Piero
> -----Original Message-----
> From: UMN MapServer Users List [mailto:[EMAIL PROTECTED] On
> Behalf Of Piero Cavalieri
> Sent: mercoledì 13 febbraio 2008 13.26
> To: [email protected]
> Subject: Re: [UMN_MAPSERVER-USERS] OGR connection problem
>
> -----Original Message-----
> From: UMN MapServer Users List [mailto:[EMAIL PROTECTED] On
> Behalf Of Tamas Szekeres
> Sent: mercoledì 13 febbraio 2008 12.51
> To: [email protected]
> Subject: Re: [UMN_MAPSERVER-USERS] OGR connection problem
>
> Piero,
>
> It seems the DSN is different in the 2 examples below. Is this
> intentional?
>
> Yes, xxx, yyy are not real user pass....
>
> You should also make sure that the same gdal dll is actually used by
> ogrinfo and mapserver.
>
> Yes, this must be verified, but the point is: with one similar connection
> it works, with other no....
> Also now I have used separate ovf file, and in .map:
> STATUS ON
> CONNECTIONTYPE OGR
> CONNECTION "ponti.ovf"
> DATA "pontiProvinciali"
> CLASS
> ....
> ....
>
> Now I have no error at all, but returned image is blank.....
> Possible it is a SRS problem ?
>
> Thanks
> Piero
>
>
> 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