OGR MySQL Spatial Connection
Dylan Rawlins
dylan at MAPSERVER.CO.ZA
Fri Sep 15 03:18:16 PDT 2006
I am trying to connect to a spatial table in MySQl using an OGR
connection and ovf file.
The ovf:
<OGRVRTDataSource>
<OGRVRTLayer name="aqidata">
<SrcDataSource>MYSQL:test,user=ABC123,password=*****,host=localhost,port
=3306,tables=glacier</SrcDataSource>
<SrcSQL>SELECT * FROM glacier</SrcSQL>
<GeometryType>wkbPoint</GeometryType>
<Geometry_Name>ref</Geometry_Name>
</OGRVRTLayer>
</OGRVRTDataSource>
The mapfile:
LAYER
NAME "MyAqi"
STATUS DEFAULT
TYPE POINT
CONNECTIONTYPE OGR
CONNECTION "aqidata.ovf"
DATA "aqidata"
CLASS
NAME "MyClass"
STYLE
SYMBOL 'circle'
SIZE 15
COLOR 0 255 0
END
END
END
When I connect to the ovf via FWTools it works fine. However, when I try
and connect through PHP Mapscript (v4.8) I get the following error:
Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named
'MyAqi'. in C:\Program Files\Apache
Group\Apache2\htdocs\test\OGR\RoWMapProcess.php on line 425
Warning: [MapServer Error]: msOGRFileOpen(): Open failed for OGR
connection `aqidata.ovf'. Failed to open datasource
`MYSQL:test,user=ABC123,password=*****,host=localhost,port=3306,tables=g
lacier'. in C:\Program Files\Apache
Group\Apache2\htdocs\test\OGR\RoWMapProcess.php on line 425
Any ideas on what I have overlooked??
More information about the MapServer-users
mailing list