Re: [mapserver-users] draw line using mysql sahpe file

2012-03-07 Thread Murat Beyhan
Dear Paolo,

Thanks for your advice, as you said just change select * form sfault
then it works fine...
wonderful

it took 2 weeks to see these result
many thanks
murat

On Wed, 2012-03-07 at 11:36 +0100, Paolo Corti wrote:
> SELECT eq_id from sfault where eq_id like  "%eq_id%" 


Murat BEYHAN 

Jeofizik Y.Müh.
T.C. Başbakanlık
Afet ve Acil Durum Yönetimi Başkanlığı
Deprem Dairesi Başkanlığı
Eskişehir Yolu 12. Km.
Lodumlu/ANKARA
Tel: 312 2872680-1556
email:bey...@deprem.gov.tr




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] draw line using mysql sahpe file

2012-03-07 Thread Paolo Corti
> But I desire only one of them using eq_id column but when I make sql
> statement as follows. I mean when I add sql statement it draws nothing.
> But be sure same eq_id comes to map file correctly to draw point of
> epicenter. There is no problem for it. Also I use EXPRESSION FOR CLASS
> also it doesn't draw line on the map. Previous map draws all, following
> draws nothing. How can I pass this handicap. Please let help me.
> LAYER
>     NAME "fault"
>     TYPE line
>     STATUS default
>   CONNECTIONTYPE OGR
>   CONNECTION '
>   
> MYSQL:testogr,user=root,password=password123,host=localhost,port=3306,tables=sfault
> SELECT eq_id from sfault where eq_id like  "%eq_id%" 
> 
> '
>

In your SrcSQL you need to include the geometry field.
You have to include the GeometryField subelement as well.
Always try to use ogrinfo to check if the dataset is returning
expected results (specially for geometry)

best regards
P

-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


[mapserver-users] draw line using mysql sahpe file

2012-03-06 Thread Murat Beyhan
Dear All,

For 2 weeks I struggled to draw simple line using mysql database in
order to collect to many lines and draw only desired one on the map I
followed many way but could not solve the problem

at the beginning of my work I stored start and end of the line point on
the database as a table on mysql then I try to draw it using ogr. but I
could not draw it.
Then I firs create shape file of lines than I store it on mysql spatial
database by following 

 ogr2ogr -f MySQL MySQL:testogr,user=root,password=password123
sfault1.shp -nln sfault -append -overwrite -lco GEOMETRY_NAME=SHAPE2
then structure of the table created by this command as follows:


OGR_FID  
int(11)
Yes 
NULL 
SHAPE2  
geometry
Yes 
NULL 
id  
decimal(1,0)
Yes 
NULL 
lon  
double(8,4)
Yes 
NULL 
lat  
double(7,4)
Yes 
NULL 
eq_id  
varchar(14)
Yes 
NULL 

same database testogr has a two another table which collect
geometry_column and spatial_ref_sys.

then I try to draw it on mapserver
then I succeeded but it draws all of the line stored in this table using
following map layer. 
LAYER
 NAME "fault"
 TYPE line
 STATUS default
   CONNECTIONTYPE OGR
   CONNECTION '
   
MYSQL:testogr,user=root,password=password123,host=localhost,port=3306,tables=sfault
 
' 
 
   DATA sfault
   
  CLASS
  NAME "Kaynak Fay/Source Fault"
   SYMBOL "cline"
   SIZE 3
   COLOR 255 0 0 
 END
 END

But I desire only one of them using eq_id column but when I make sql
statement as follows. I mean when I add sql statement it draws nothing.
But be sure same eq_id comes to map file correctly to draw point of
epicenter. There is no problem for it. Also I use EXPRESSION FOR CLASS
also it doesn't draw line on the map. Previous map draws all, following
draws nothing. How can I pass this handicap. Please let help me.
LAYER
 NAME "fault"
 TYPE line
 STATUS default
   CONNECTIONTYPE OGR
   CONNECTION '
   
MYSQL:testogr,user=root,password=password123,host=localhost,port=3306,tables=sfault
SELECT eq_id from sfault where eq_id like  "%eq_id%" 

' 

   DATA sfault
#   CLASSITEM "eq_id"
  CLASS
#  EXPRESSION ([eq_id] EQ 'eq_id') !! this also doesn't work 
   NAME "Kaynak Fay/Source Fault"
   SYMBOL "cline"
   SIZE 3
   COLOR 255 0 0 
END
END


-- 
Murat BEYHAN
Geophysical Engineer, M.Sc.
Prime Ministry
Disaster and Emergency Management Presidency
Earthquake Department
Address: Eskisehir Yolu 12. Km.
Lodumlu/ANKARA
Tel: 312 2872680-1556
email:bey...@deprem.gov.tr



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users