[prev in list] [next in list] [prev in thread] [next in thread]
List: mapserver-users
Subject: [mapserver-users] OGR to MySQL
From: "Chris Green" <chris.green () ibstv ! co ! uk>
Date: 2011-07-26 10:57:23
Message-ID: 018a01cc4b82$cc9573c0$65c05b40$ () green () ibstv ! co ! uk
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
Hi users
I'm having some trouble with an OGR connection to a MySQL database. The data
I'm trying to access was created using QGIS as a line layer and saved in a
MySQL table as a BLOB in a geometry column. I can access and properly
display this line data using QGIS, but not so far via Mapserver - nothing is
drawn and I can't see any error.
I am using Mapserver 6.0 and my mapfile is very similar to the example in
theMapserver / MYSQL documentation:
LAYER
NAME "testLine"
TYPE LINE
STATUS DEFAULT
CONNECTIONTYPE OGR
CONNECTION "mysql:testDB,user=admin,password=password,port=3306"
DATA "SELECT Geometry from testLine"
CLASS
STYLE
COLOR 0 0 0
WIDTH 2
END # style
END # class
END # layer
If I look at the MySQL table using OGRinfo I see the following:
Layer name: testLine
Geometry: Unknown (any)
Feature Count: 0
Layer SRS WKT:
(unknown)
FID Coumn = id
Geometry Column = Geometry
The issue seems to be that OGRInfo and therefore MapServer does not
recognise any features in the table, but QGIS using access to the same table
finds and displays the features.
Anyone have any ideas what I am doing wrong?
Chris
[Attachment #5 (text/html)]
<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:x="urn:schemas-microsoft-com:office:excel" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 12 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-GB link=blue vlink=purple><div \
class=WordSection1><p class=MsoNormal>Hi users<o:p></o:p></p><p \
class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I’m having some trouble \
with an OGR connection to a MySQL database. The data I’m trying to access was \
created using QGIS as a line layer and saved in a MySQL table as a BLOB in a geometry \
column. I can access and properly display this line data using QGIS, but not so far \
via Mapserver – nothing is drawn and I can’t see any \
error.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am \
using Mapserver 6.0 and my mapfile is very similar to the example in theMapserver / \
MYSQL documentation:<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'>LAYER<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> NAME "testLine" \
<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> TYPE \
LINE<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> STATUS \
DEFAULT<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> CONNECTIONTYPE \
OGR<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> CONNECTION \
"mysql:testDB,user=admin,password=password,port=3306" \
<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> DATA "SELECT Geometry from \
testLine"<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'> CLASS<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> \
STYLE <o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'> \
COLOR 0 0 0<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'> \
\
WIDTH 2 <o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'> END # \
style<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'> END \
# class<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'>END # layer<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'><o:p> </o:p></span></p><p \
class=MsoNormal style='text-autospace:none'>If I look at the MySQL table using \
OGRinfo I see the following:<o:p></o:p></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'><o:p> </o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>Layer name: testLine<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>Geometry: Unknown (any)<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>Feature Count: 0<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>Layer SRS WKT: <o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>(unknown)<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>FID Coumn = id<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>Geometry Column = Geometry<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'><o:p> </o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'><o:p> </o:p></span></p><p class=MsoNormal style='text-autospace:none'>The \
issue seems to be that OGRInfo and therefore MapServer does not recognise any \
features in the table, but QGIS using access to the same table finds and displays the \
features.<o:p></o:p></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:10.0pt'><o:p> </o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier New"'> \
<o:p></o:p></span></p><p class=MsoNormal>Anyone have any ideas what I am doing \
wrong?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p \
class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Chris<o:p></o:p></p><p \
class=MsoNormal> <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p \
class=MsoNormal><o:p> </o:p></p></div></body></html>
_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic