Murat,<div><br></div><div>Since it is MySQL it doesn't matter much how you store it. If you are going to edit the end points later, storing them as points is preferable, otherwise store them as wkt linestring geometries.</div>
<div><br></div><div>For your mapfile, first check if the extents are correct. Then check if the mapfile works with a shapefile created from the geometries in MySQL.<br><br>On Tuesday, February 28, 2012, Murat BEYHAN wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chaitanya,<br>
<br>
thanks for your repply,<br>
<br>
Actually I use ogr and mysql to draw point for example epicenter of<br>
earthquakes. But this is the first time to draw line which is stored in<br>
Mysql as a table. Actually there is no problem on drawing shape file of the<br>
line. But I would like to draw it using MySql and ogr functionality. So I<br>
have only start and end point of line and I store it on MySql database then<br>
I try to draw it considering id of the line by sql statement.<br>
Just I would lie to learn how to code it on Mapserver map file and how<br>
should I store line on database as a start and stop point of the line or as<br>
a geometry . Please help...<br>
thanks<br>
<br>
<br>
<br>
<br>
On Mon, 27 Feb 2012 22:09:52 +0530, Chaitanya kumar CH wrote<br>
> Murat,<br>
><br>
> First check if your database is accessible using ogrinfo[1].<br>
> Then create a vrt file with the content you specified in the CONNECTION<br>
> field of the mapfile. Check if ogrinfo gives expected results with this<br>
> file.<br>
><br>
> You probably have gdal executables if you are running mapserver.<br>
><br>
> [1]: <a href="http://www.gdal.org/ogrinfo.html" target="_blank">http://www.gdal.org/ogrinfo.html</a><br>
><br>
> On Mon, Feb 27, 2012 at 12:48 PM, Murat Beyhan<br>
> <<a href="javascript:;" onclick="_e(event, 'cvml', 'beyhan@deprem.gov.tr')">beyhan@deprem.gov.tr</a>> wrote:<br>
><br>
> > 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>
> ><br>
> ><br>
<SrcDataSource>MYSQL:dynamic,user=root,password=mysqlpasswd,host=localhost,po<br>
rt=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>
> ><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="javascript:;" onclick="_e(event, 'cvml', '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>
> ><br>
><br>
> --<br>
> Best regards,<br>
> Chaitanya kumar CH.<br>
><br>
> +91-9494447584<br>
> 17.2416N 80.1426E<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>
Murat Beyhan<br>
Jeofizik Yük. Müh.<br>
T.C.<br>
BAŞBAKANLIK<br>
Afet ve Acil Durum Yönetimi Başkanlığı<br>
Deprem Dairesi Başkanlığı<br>
Eskişehir Yolu 12. Km. Lodumlu/Ankara<br>
Tel:+90 (312) 2872680-1550<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>
</blockquote></div><br><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br><br>+91-9494447584<br>17.2416N 80.1426E<br>