At this point I could only advice you to refer to MySQL documentation.<div><br></div><div><a href="http://dev.mysql.com/doc/">http://dev.mysql.com/doc/</a></div><div><a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html">http://dev.mysql.com/doc/refman/5.0/en/string-functions.html</a><br>
<br><div class="gmail_quote">On Mon, Mar 5, 2012 at 7:00 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">
Chaitanya,<br>
I could not succeeded What I have tried.<br>
the problem is I'm not good at mysql.<br>
I think I could not do this job.<br>
I'm really upset.<br>
Are there a different way or easy way to draw line using mysql table<br>
data..<br>
Regards<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Mon, 2012-03-05 at 10:44 +0200, Murat Beyhan wrote:<br>
> Chaitanya,<br>
><br>
> I was forget to convert lat lon to string as you said before than I was<br>
> use BINARY to convert it but I could not converted ı think because still<br>
> same problem continuing.<br>
><br>
> as follows<br>
><br>
><br>
> CREATE OR REPLACE<br>
> ALGORITHM = UNDEFINED<br>
> VIEW `lineview3` (<br>
> eq_id,<br>
> geom<br>
> ) AS<br>
> SELECT eq_id,<br>
> BINARY CONCAT( 'LINESTRING(', lon1, ' ', lat1, ',', lon2, ' ', lat2,<br>
> ')' ) AS geom<br>
> FROM sfault<br>
><br>
><br>
> Ok, I will tyr cast. By the way I learn more about mysql, too..<br>
> thanks<br>
> Murat<br>
><br>
><br>
> On Mon, 2012-03-05 at 14:07 +0530, Chaitanya kumar CH wrote:<br>
> > Murat,<br>
> ><br>
> > Perhaps you can use the CAST operator to convert the data type to<br>
> > varchar.<br>
> ><br>
> > On Monday, March 5, 2012, Murat Beyhan <<a href="mailto:beyhan@deprem.gov.tr">beyhan@deprem.gov.tr</a>> wrote:<br>
> > > Chaitanya,<br>
> > ><br>
> > > Thanks for your help, I try to use concat to create view from<br>
> > database<br>
> > > which is storing start and end of the point of the line<br>
> > > as follows.<br>
> > ><br>
> > ><br>
> > > create view lineview6 as select eq_id,<br>
> > > CONCAT('LINESTRING(',lon1,'',lat1,',',lon2,'',lat2,')') as geom from<br>
> > > sfault<br>
> > ><br>
> > ><br>
> > ><br>
> > > but at the previous problem still could not solve<br>
> > > as you said geom field should be string but view automatically<br>
> > decided<br>
> > > the format of the geom column randomly (now is var). then the select<br>
> > sql<br>
> > > result of the view as follows and mapserver does not draw line.<br>
> > ><br>
> > ><br>
> > > SQL result<br>
> > > Host: localhost<br>
> > > Database: dynamic<br>
> > > Generation Time: Mar 05, 2012 at 09:52 AM<br>
> > > Generated by: phpMyAdmin 3.3.10 / MySQL 5.1.55<br>
> > > SQL query: SELECT * FROM `lineview6` LIMIT 0, 30 ;Rows: 1<br>
> > ><br>
> > > eq_id<br>
> > > geom<br>
> > > 20100308023229<br>
> > > LINESTRING(38.7901 40.0811,38.7428<br>
> > > 40.0311)<br>
> > ><br>
> > ><br>
> > > and structure of the lineview6 is as follows<br>
> > ><br>
> > > eq_id varchar(14)<br>
> > > geom var(51)<br>
> > ><br>
> > > please excuse me for this<br>
> > ><br>
> > > murat<br>
> > ><br>
> > ><br>
> > ><br>
> > > On Fri, 2012-03-02 at 21:38 +0530, Chaitanya kumar CH wrote:<br>
> > >> Please refer to my previous posts.<br>
> > >> Modify the SQL select command. Use the CONCAT function instead of<br>
> > the<br>
> > >> + operator to create the wkt.<br>
> > >><br>
> > >> It should be something like this: CONCAT('LINESTRING(', x1, ' ',<br>
> > y1,<br>
> > >> ',', x2, ' ', y2, ')')<br>
> > >> You may have to change the order of the points.<br>
> > >><br>
> > >> On Fri, Mar 2, 2012 at 9:24 PM, Murat Beyhan <<a href="mailto:beyhan@deprem.gov.tr">beyhan@deprem.gov.tr</a>><br>
> > >> wrote:<br>
> > >> Chaitanya,<br>
> > >><br>
> > >> I store data in table not view as I told you before becasue<br>
> > I<br>
> > >> could not<br>
> > >> declare column as string, then I create a new table and<br>
> > select<br>
> > >> fault(line) column as linestring. in mysql WKT support<br>
> > these<br>
> > >> format<br>
> > >><br>
> > >><br>
> > >> * A LineString with four points:<br>
> > >><br>
> > >> LINESTRING(0 0, 10 10, 20 25, 50 60)<br>
> > >><br>
> > >> Note that point coordinate pairs are separated by<br>
> > >> commas.<br>
> > >><br>
> > >> * A Polygon with one exterior ring and one interior<br>
> > ring:<br>
> > >><br>
> > >> POLYGON((0 0,10 0,10 10,0 10,0 0),(5 5,7 5,7 7,5 7,<br>
> > 5<br>
> > >> 5))<br>
> > >> * A MultiPoint with three Point values:<br>
> > >><br>
> > >> MULTIPOINT(0 0, 20 20, 60 60)<br>
> > >> * A MultiLineString with two LineString values:<br>
> > >><br>
> > >> MULTILINESTRING((10 10, 20 20), (15 15, 30 15))<br>
> > >> * A MultiPolygon with two Polygon values:<br>
> > >><br>
> > >> MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((5 5,7 5,7<br>
> > >> 7,5 7, 5 5)))<br>
> > >> * A GeometryCollection consisting of two Point values<br>
> > and<br>
> > >> one<br>
> > >> LineString:<br>
> > >><br>
> > >> GEOMETRYCOLLECTION(POINT(10 10), POINT(30 30),<br>
> > >> LINESTRING(15 15, 20 20))<br>
> > >><br>
> > >><br>
> > >> How to modify wkt geometry in string format<br>
> > >> in map file it is already defined as<br>
> > >> <GeometryType>wkbLineString</GeometryType><br>
> > >> like this.<br>
> > >><br>
> > >> I really sorry for giving trouble to you. Thanks<br>
> > >><br>
> > >> murat<br>
> > >><br>
> > >> On Fri, 2012-03-02 at 21:19 +0530, Chaitanya kumar CH<br>
> > wrote:<br>
> > >> > Modify the table to store the line as a wkt geometry in<br>
> > >> string format.<br>
> > >> ><br>
> > >> > On Fri, Mar 2, 2012 at 9:12 PM, Murat Beyhan<br>
> > >> <<a href="mailto:beyhan@deprem.gov.tr">beyhan@deprem.gov.tr</a>><br>
> > >> > wrote:<br>
> > >> > Chaitanya,<br>
> > >> ><br>
> > >> > I mean What should I do,<br>
> > >> > Still could not draw a simple line on the map,<br>
> > >> > Please how can I overcome this issue. How can I<br>
> > >> change VRT<br>
> > >> > file.<br>
> > >> > in order to read data from such table storing<br>
> > data<br>
> > >> as<br>
> > >> > linestring<br>
> > >> ><br>
> > >> > regards<br>
> > >> ><br>
> > >> > murat<br>
> > ><br>
> ><br>
> > --<br>
> > Best regards,<br>
> > Chaitanya kumar CH.<br>
> ><br>
> > <a href="tel:%2B91-9494447584" value="+919494447584">+91-9494447584</a><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>
><br>
> Murat BEYHAN<br>
><br>
> Jeofizik Y.Müh.<br>
> T.C. Başbakanlık<br>
> Afet ve Acil Durum Yönetimi Başkanlığı<br>
> Deprem Dairesi Başkanlığı<br>
> Eskişehir Yolu 12. Km.<br>
> Lodumlu/ANKARA<br>
> Tel: 312 2872680-1556<br>
> <a href="mailto:email%3Abeyhan@deprem.gov.tr">email:beyhan@deprem.gov.tr</a><br>
><br>
><br>
><br>
><br>
<br>
<br>
<br>
Murat BEYHAN<br>
<br>
Jeofizik Y.Müh.<br>
T.C. Başbakanlık<br>
Afet ve Acil Durum Yönetimi Başkanlığı<br>
Deprem Dairesi Başkanlığı<br>
Eskişehir Yolu 12. Km.<br>
Lodumlu/ANKARA<br>
Tel: 312 2872680-1556<br>
<a href="mailto:email%3Abeyhan@deprem.gov.tr">email:beyhan@deprem.gov.tr</a><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>
</div></div></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>