[mapserver-users] draw line readinf from mysql
Robert Sanson
Robert.Sanson at asurequality.com
Mon Feb 20 12:15:48 PST 2012
Hi Murat
Is it possible for you to create a view from the columns that presents the data as a WKT line feature:
create view lineview as select id, "LINESTRING(" + lon1 + " " + lat1 + "," + lon2 + " " + lat2 + ")" as geom from mytable
Then set up your OGR ovf file representing this view:
<OGRVRTDataSource>
<OGRVRTLayer name="fences">
<SrcDataSource>ODBC:user/passwd at DSN</SrcDataSource>
<SrcLayer>lineview</SrcLayer>
<GeometryType>wkbLine</GeometryType>
<LayerSRS>EPSG:2193</LayerSRS>
<GeometryField encoding="WKT" field="geom"/>
<FID>id</FID>
</OGRVRTLayer>
</OGRVRTDataSource>
Best wishes,
Robert
>>> Murat Beyhan <beyhan at deprem.gov.tr> 21/02/2012 2:52 a.m. >>>
Dear friend,
I'm trying to draw a line using MySql database
the table in database as follows,
id lat1 lon1 lat2 lon2
20100308023229 40.1113 38.7901 40.0311 38.7428
actually using ogr connection I can draw point using ogr and mysql, but
How can I draw line using such database table, please help me and give
the idea...
Thanks
Murat
--
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:beyhan at 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 at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
This email and any attachments are confidential and intended solely for the addressee(s). If you are not the intended recipient, please notify us immediately and then delete this email from your system.
This message has been scanned for Malware and Viruses by Websense Hosted Security.
www.websense.com
More information about the MapServer-users
mailing list