Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-05 Thread Chaitanya kumar CH
At this point I could only advice you to refer to MySQL documentation. http://dev.mysql.com/doc/ http://dev.mysql.com/doc/refman/5.0/en/string-functions.html On Mon, Mar 5, 2012 at 7:00 PM, Murat Beyhan wrote: > Chaitanya, > I could not succeeded What I have tried. > the problem is I'm not good

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-05 Thread Murat Beyhan
Chaitanya, I could not succeeded What I have tried. the problem is I'm not good at mysql. I think I could not do this job. I'm really upset. Are there a different way or easy way to draw line using mysql table data.. Regards On Mon, 2012-03-05 at 10:44 +0200, Murat Beyhan wrote: > Chaitanya, > >

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-05 Thread Murat Beyhan
Chaitanya, I was forget to convert lat lon to string as you said before than I was use BINARY to convert it but I could not converted ı think because still same problem continuing. as follows CREATE OR REPLACE ALGORITHM = UNDEFINED VIEW `lineview3` ( eq_id, geom ) AS SELECT eq_id, BINARY CO

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-05 Thread Chaitanya kumar CH
Murat, Perhaps you can use the CAST operator to convert the data type to varchar. On Monday, March 5, 2012, Murat Beyhan wrote: > Chaitanya, > > Thanks for your help, I try to use concat to create view from database > which is storing start and end of the point of the line > as follows. > > > cr

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-05 Thread Murat Beyhan
Chaitanya, Thanks for your help, I try to use concat to create view from database which is storing start and end of the point of the line as follows. create view lineview6 as select eq_id, CONCAT('LINESTRING(',lon1,'',lat1,',',lon2,'',lat2,')') as geom from sfault but at the previous problem

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Chaitanya kumar CH
Please refer to my previous posts. Modify the SQL select command. Use the CONCAT function instead of the + operator to create the wkt. It should be something like this: CONCAT('LINESTRING(', x1, ' ', y1, ',', x2, ' ', y2, ')') You may have to change the order of the points. On Fri, Mar 2, 2012 at

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Murat Beyhan
Chaitanya, I store data in table not view as I told you before becasue I could not declare column as string, then I create a new table and select fault(line) column as linestring. in mysql WKT support these format * A LineString with four points: LINESTRING(0 0, 10 10, 20

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Chaitanya kumar CH
Modify the table to store the line as a wkt geometry in string format. On Fri, Mar 2, 2012 at 9:12 PM, Murat Beyhan wrote: > Chaitanya, > > I mean What should I do, > Still could not draw a simple line on the map, > Please how can I overcome this issue. How can I change VRT file. > in order to r

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Murat Beyhan
Chaitanya, I mean What should I do, Still could not draw a simple line on the map, Please how can I overcome this issue. How can I change VRT file. in order to read data from such table storing data as linestring regards murat On Fri, 2012-03-02 at 21:08 +0530, Chaitanya kumar CH wrote: > I was

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Chaitanya kumar CH
I was talking about the geometry format of the line. You have to decide for yourselves about the efficiency. On Fri, Mar 2, 2012 at 8:57 PM, Murat Beyhan wrote: > Chaitanya, > > What do you prefer and which way more fast to draw line and point > because I also draw point about 16 and I use w

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Murat Beyhan
Chaitanya, What do you prefer and which way more fast to draw line and point because I also draw point about 16 and I use wkbpoint. Any way how to change and What I will change in the vrt. could you tell something about it thanks On Fri, 2012-03-02 at 20:23 +0530, Chaitanya kumar CH wrot

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Chaitanya kumar CH
Murat, You specified the encoding for GeometryField in the VRT as WKT. OGR expects a WKT if you do that. Either change the data or the VRT. On Fri, Mar 2, 2012 at 6:42 PM, Murat Beyhan wrote: > I have to say this is not view > this is a table created. > > Because I could not declare type of geo

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Murat Beyhan
I have to say this is not view this is a table created. Because I could not declare type of geom field as a string than I create geometry field column in spatial mysql database.. On Fri, 2012-03-02 at 18:39 +0530, Chaitanya kumar CH wrote: > Murat, > > Can you show a sample output of your view?

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Murat Beyhan
Here is also I could store data to mysql as follows INSERT INTO geom set eq_id='20111023101120', fault=GeomFromText('linestring(38.6636 43.8547,38.6952 43.0851)') SQL result Host: localhost Database: dynamic Generation Time: Mar 02, 2012 at 03:04 PM Generated by: phpMyAdmin 3.3.10 / MySQL 5.1.55

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Chaitanya kumar CH
Murat, Can you show a sample output of your view? SELECT * FROM geom; On Fri, Mar 2, 2012 at 6:12 PM, Murat Beyhan wrote: > > > > > Dear Chaitanya, > > I see what you explain first I convert lat lon data to string then I > concatenate them to string again. But I would like to ask > I have alrea

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Murat Beyhan
Dear Chaitanya, I see what you explain first I convert lat lon data to string then I concatenate them to string again. But I would like to ask I have already add data to mysql table as follows is this also correct because when I browse table it seems it store data in geometry field but mapserv

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Chaitanya kumar CH
Murat, Put aside linestrings and geometries. First you need to have a wkt representation of your line segment. Your MySQL query is returning a number. That should be an indicator that your query was wrong. You were using the wrong operator. You need to convert the latitude and longitude values to

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-02 Thread Murat Beyhan
Chaitanya, I could not do this using sql sorry. But I have an another idea is it good way to store these data as a spatial database in MySql. I try this but when I insert data to mysql table I have problem . I have created a table as follows eq_id varchar(14) fault linestring then I will inse

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-03-01 Thread Chaitanya kumar CH
Murat, It's not working. the geom field should not be 'Real'. It should be 'String'. Try something else other than the '+' operator in the SQL syntax to create the geom field in the view. On Thu, Mar 1, 2012 at 12:48 PM, Murat Beyhan wrote: > Chaitanya, > > I have had a progress about VRT data

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-29 Thread Murat Beyhan
Chaitanya, I have had a progress about VRT data access but I afraid something wrong in mapserver .map file. here is the test.vrt file and I use in map file with connection ogr functionality. : MYSQL:dynamic,user=root,password=mysql_passwd,host=localhost,port=3306,tables=lineview select eq_id,

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-29 Thread Chaitanya kumar CH
Murat, You should check MySQL's SQL syntax to concatenate strings and decimals to produce a string. On Wednesday, February 29, 2012, Murat Beyhan wrote: > Chaitanya, > > here is the structure of table on database > > sfault : > > eq_id varchar(14) > lat1 decimal(7,4) > lon1 decimal(7,4) > lat2

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-29 Thread Murat Beyhan
Chaitanya, here is the structure of table on database sfault : eq_id varchar(14) lat1 decimal(7,4) lon1 decimal(7,4) lat2 decimal(7,4) lon2 decimal(7,4) lineview : eq_id varchar(14) geom double it seams geom as double I thing it should be geometry isn't it? may

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-28 Thread Chaitanya kumar CH
Murat, I see that your view, lineview, doesn't give the expected geometry type with ogrinfo. It is showing the datatype as Real. Check if the datatype of geom is actually string/text. On Tue, Feb 28, 2012 at 12:49 PM, Murat Beyhan wrote: > Chaitanya, > > > Map file which is try to draw line as

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-27 Thread Murat Beyhan
Chaitanya, Map file which is try to draw line as follows are there any problem on the code LAYER NAME sfault1 CONNECTIONTYPE OGR CONNECTION ' MYSQL:dynamic,user=root,password=mysqlpasswd,host=localhost,port=3306,tables=lineview lineview wkbLineString WGS84 eq_id ' DATA sfault1

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-27 Thread Chaitanya kumar CH
Murat, 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. For your mapfile, first check if the extents are correct. Then check if the mapfile works with

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-27 Thread Murat BEYHAN
Chaitanya, thanks for your repply, Actually I use ogr and mysql to draw point for example epicenter of earthquakes. But this is the first time to draw line which is stored in Mysql as a table. Actually there is no problem on drawing shape file of the line. But I would like to draw it using My

Re: [gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-27 Thread Chaitanya kumar CH
Murat, First check if your database is accessible using ogrinfo[1]. 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. You probably have gdal executables if you are running mapserver. [1]: http://w

[gdal-dev] drawing line using OGR and mysql in mapserver

2012-02-27 Thread Murat Beyhan
Dear all, I have shared this mail on Mapserver list but could not solve my problem. Still could not achieve to draw line using start and stop point line data stored in MySql database. I have tried Mr. Robert's solution but I have faced an error message. in map file I changed Geometrytype from