Murat,<div><br></div><div>First check if your database is accessible using ogrinfo[1].</div><div>Then create a vrt file with the content you specified in the CONNECTION field of the mapfile. Check if ogrinfo gives expected results with this file.<br>
<br>You probably have gdal executables if you are running mapserver.<br><br>[1]: <a href="http://www.gdal.org/ogrinfo.html">http://www.gdal.org/ogrinfo.html</a><br><br><div class="gmail_quote">On Mon, Feb 27, 2012 at 12:48 PM, Murat Beyhan <span dir="ltr"><<a href="mailto:beyhan@deprem.gov.tr">beyhan@deprem.gov.tr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear all,<br>
I have shared this mail on Mapserver list but could not solve my<br>
problem.<br>
Still could not achieve to draw line using start and stop point line<br>
data stored in MySql database.<br>
<br>
I have tried Mr. Robert's solution but I have faced an error message.<br>
<br>
<br>
in map file<br>
I changed Geometrytype from wkbline to wkblinestring.<br>
<br>
LAYER<br>
NAME sfault1<br>
CONNECTIONTYPE OGR<br>
CONNECTION '<OGRVRTDataSource><br>
<OGRVRTLayer name="lineview"><br>
<SrcDataSource>MYSQL:dynamic,user=root,password=mysqlpasswd,host=localhost,port=3306,tables=lineview</SrcDataSource><br>
<SrcLayer>lineview</SrcLayer><br>
<GeometryType>wkbLineString</GeometryType><br>
<GeometryField encoding="WKT" field="geom"/><br>
<LayerSRS>WGS84</LayerSRS><br>
<FID>eq_id</FID><br>
</OGRVRTLayer><br>
</OGRVRTDataSource>'<br>
DATA sfault1<br>
STATUS on<br>
TYPE line<br>
CLASS<br>
NAME "Source Fault"<br>
SYMBOL "cline"<br>
SIZE 3<br>
COLOR 0 0 255<br>
END<br>
END<br>
<br>
in database<br>
I have two table<br>
one is sfault which store<br>
<br>
id lat1 lon1 lat2 lon2<br>
<br>
and another is lineview which is a view<br>
of this table created by following<br>
<br>
create view lineview as select eq_id, "LINESTRING(" + lon1 + " " + lat1<br>
+ "," + lon2 + " " + lat2 + ")" as geom from sfault<br>
<br>
<br>
there is an another issue,<br>
<br>
I have to draw line by considering id<br>
so in the map When I select one id, line should be belong to this id's<br>
information<br>
so I have to make a sql statement as follow instead of draw all line<br>
stored in database I have to draw just one line considering id<br>
<br>
something like this:<br>
<br>
select eq_id, geom from lineview where id like '%id%'<br>
<br>
<br>
please help about this subject....<br>
<br>
<br>
Regards....<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
Murat<br>
<br>
<br>
<br>
<br>
<br>
--<br>
This message has been scanned for viruses and<br>
dangerous content by MailScanner, and is<br>
believed to be clean.<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>
</div>