Dear all,<br>I am starting with mapserver and now I have problems with database issues.<br>I am using Mysql 5 in windows XP. Mapserver was installed with ms4w 2.2.5. Normally Mapserver is working fine.<br>I tried to draw a layer from a mySQL table. The table has spatial information,
i.e. x/y columns.<br>I tried in two ways first with .ovf file and then with direct ogr connection. I was unsuccessful in both case.<br><br>1) .ovf<br><span style="font-weight: bold; text-decoration: underline;">MAP FILE for the layer
<br><br></span> LAYER # point layer with sampled site starts here, query and join<br> NAME "dbsites"<br> TYPE point<br> CONNECTIONTYPE OGR <br> CONNECTION "
mysql.ovf" <br> DATA "aquidata"<br> TRANSPARENCY 100<br> STATUS on<br> HEADER "c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_header.html"<br> FOOTER "c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_footer.html"
<br> TEMPLATE "c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_class_query.html"<br> TOLERANCE 150<br> TOLERANCEUNITS pixels<br> CLASS <br> NAME "dbsites"
<br> STYLE<br> SYMBOL 'circle'<br> COLOR 0 0 0<br> SIZE 7<br> END # end style<br> END # end class<br> END # sites layer ends here
<br><br><span style="text-decoration: underline;">.ovf file<br><br></span><OGRVRTDataSource><br> <OGRVRTLayer name="aqidata"><br> <SrcDataSource>MYSQL:URBSISdtb_GRU01,user=root,password=leo,host=localhost,port=3306,tables=qloc</SrcDataSource>
<br> <SrcSQL>SELECT LocCode, X, Y, alt, lu, relief FROM qloc</SrcSQL> <br> <GeometryType>wkbPoint</GeometryType><br> <GeometryField encoding="PointFromColumns" x="X" y="Y"/>
<br> </OGRVRTLayer><br></OGRVRTDataSource><br><br>The ovf file was tested in ogrinfo and everything was fine. When used in the html template wih CGI substitution strings the following error was reported<br>
<br>
msDrawMap(): Image handling error. Failed to draw layer named 'dbsites'. <br>
msOGRFileOpen(): OGR error. GetLayer(aquidata) failed for OGR connection `mysql.ovf'. <br><br><br>2) direct OGR<br> LAYER # point layer with sampled site starts here, query and join<br> NAME "dbsites"
<br> TYPE point<br> CONNECTIONTYPE OGR <br> CONNECTION "MYSQL:URBSISdtb_GRU01,user=root,password=leo,host=localhost,port=3306,tables=qloc" <br> DATA "SELECT LocCode, X, Y, alt, lu, relief FROM qloc"
<br> TRANSPARENCY 100<br> STATUS on<br> HEADER "c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_header.html"<br> FOOTER "c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_footer.html"
<br> TEMPLATE "c:/ms4w/tmp/ms_tmp/appl/q_templates/gru_CGI_db_class_query.html"<br> TOLERANCE 150<br> TOLERANCEUNITS pixels<br> CLASS <br> NAME "dbsites"
<br> STYLE<br> SYMBOL 'circle'<br> COLOR 0 0 0<br> SIZE 7<br> END # end style<br> END # end class<br> END # sites layer ends here
<br><br>In this case the layer is displayed in the legend, but not draw and no query are possible.<br><br>If someone has any hints on how to solve that.<br><br>Thank you very much in advance<br><br>Laura<br><span style="text-decoration: underline;">
</span>