MySQL OGR VRT

Fawcett, David David.Fawcett at STATE.MN.US
Mon Apr 3 12:11:17 PDT 2006


I am attempting to use MySQL as the datasource for a simple point layer.
I am using MapServer 4.6.1 (gdal 1.3.1).  

Here is my .ovf file:
<OGRVRTDataSource>

    <OGRVRTLayer name="aqidata">
 
<SrcDataSource>MYSQL:aqiTest,user=xxx,password=xx,host=192.168.1.100,por
t=3306,tables=testdata</SrcDataSource> 
 	<SrcLayer>testdata</SrcLayer> 
	<GeometryField encoding="PointFromColumns" x="x" y="y"/> 
    </OGRVRTLayer>

</OGRVRTDataSource>

When I use ogrinfo (gdal 1.3.1) directly on the .ovf file, it shows me
layer with nine point features in it.  

When I try to use it within MapServer, I get the error:

msDrawMap(): Image handling error. Failed to draw layer named 'MyAqi'.
msOGRFileOpen(): OGR error. Open failed for OGR connection
`aqidata.ovf'. Failed to open datasource
`MYSQL:aqiTest,user=xxx,password=xx,host=192.168.1.100,port=3306,tables=
testdata'. 

Here is the layer definition:  
(I have tried it with and without the DATA line)

LAYER
    NAME MyAqi
    STATUS DEFAULT
    TYPE POINT
    CONNECTIONTYPE OGR  
    CONNECTION "aqidata.ovf"
    DATA "testdata"
    TRANSPARENCY 30
    CLASS 
       NAME "None"
	 STYLE
	    SYMBOL 'circle'
          SIZE 15
	    COLOR 0 255 0
	 END
    END
END  

I have searched the archives, but can't find anything that fits exactly.


Any ideas?

David.

PS.  Many thanks to Frank for some preliminary help.



More information about the MapServer-users mailing list