[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>&nbsp;</o:p></p><p class=MsoNormal>I&#8217;m having some trouble \
with an OGR connection to a MySQL database. The data I&#8217;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 &#8211; nothing is drawn and I can&#8217;t see any \
error.<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>I am \
using Mapserver 6.0 and my mapfile is very similar to the example in theMapserver / \
MYSQL &nbsp;documentation:<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</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"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NAME &quot;testLine&quot; \
<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TYPE&nbsp;&nbsp; \
LINE<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STATUS&nbsp; \
DEFAULT<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECTIONTYPE&nbsp; \
OGR<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CONNECTION&nbsp; \
&quot;mysql:testDB,user=admin,password=password,port=3306&quot; \
<o:p></o:p></span></p><p class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DATA &quot;SELECT Geometry from \
testLine&quot;<o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CLASS<o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
STYLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COLOR&nbsp; 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"'>&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
WIDTH&nbsp; 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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"'>&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; 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>&nbsp;</o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</o:p></span></p><p \
class=MsoNormal style='text-autospace:none'><span \
style='font-size:9.0pt;font-family:"Courier New"'><o:p>&nbsp;</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>&nbsp;</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>&nbsp;</o:p></span></p><p class=MsoNormal \
style='text-autospace:none'><span style='font-size:9.0pt;font-family:"Courier \
New"'><o:p>&nbsp;</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>&nbsp;</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>&nbsp;</o:p></p><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><p class=MsoNormal>Chris<o:p></o:p></p><p \
class=MsoNormal> &nbsp;<o:p></o:p></p><p class=MsoNormal><o:p>&nbsp;</o:p></p><p \
class=MsoNormal><o:p>&nbsp;</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