Hello Chris,

"Chris Green" <[email protected]>, [20110622 - 12:17:35]

> I am trying to establish a MySQL connection to a Mapserver 6.0 layer
> using OGR. After much trial and error (mostly error) I have got to
> the point where I have an ovf file which I can test using ogrinfo,
> but which I cannot make work in a layer.
> 
> My ovf file (OGR_test.ovf) is  
> 
> <OGRVRTDataSource>
>     <OGRVRTLayer name="OGR_test">
>       
> <SrcDataSource>mysql:testDB,user=root,password=mysql,port=3306,tables=testTa
> ble</SrcDataSource>
>         <SrcSQL>SELECT City, Latitude, Longitude FROM
> testTable</SrcSQL> <GeometryType>wkbPoint</GeometryType>
>         <GeometryField encoding="PointFromColumns" x="Longitude"
> y="Latitude"/>
>     </OGRVRTLayer>
> </OGRVRTDataSource>
> 
> I can successfully test this and see the data in testTable via:
> 
> ~# ogrinfo var/www/vhosts/mysite/httpdocs/data/OGR_test.ovf
> 
> 
> However when I create a test layer I cannot establish the OGR
> connection. I am trying with:
> 
> LAYER
>   NAME "testLayer"
>   STATUS DEFAULT
>   TYPE POINT
>   CONNECTIONTYPE OGR
>   CONNECTION "OGR_test.ovf"
>   DATA "OGR_test"
>   CLASS
>     NAME "MyClass"
>     STYLE
>       SYMBOL 'circle'
>       SIZE 15
>       COLOR 0 255 0
>     END
>   END
> END
> 
> This produces an "internal server error".
> 
> I have also tried using an absolute path to OGR_test.ovf, still no
> success. It seems that I have not got the CONNECTION and DATA
> parameters right but after reading the MySQL and the OGR sections in
> the Mapserver documentation many times I still can't figure out what
> I'm doing wrong.
> 
> Can someone help?

Just a guess.

Make sure you have the exact same env-vars set for apache as you have
set within the shell your ogrinfo-command works. Sometimes there
can be a differnces there?

Best

        Stephan

-- 
Stephan Holl <[email protected]> | Tel.: +49 (0)541-33 508 3663
Intevation GmbH, Neuer Graben 17, 49074 OS  |  AG Osnabrück - HR B 18998
Geschäftsführer:  Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner

Attachment: signature.asc
Description: PGP signature

_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to