[Qgis-user] QGIS -> MySQL -> Mapserver ??

Saber Razmjooei razmjooeis at faunalia.co.uk
Wed Jul 27 01:34:37 PDT 2011


Chris

I presume your ogr can handle mysql if you can open it in QGIS. But to
confirm could you run:

ogrinfo --formats




from terminal and check if you have

-> "MSSQLSpatial" (read/write)

Is your database large? Have you considered using PostGIS?

Cheers
Saber


On 27/07/11 07:45, Chris Green wrote:
>  
>
> Hi QGIS users
>
>  
>
> I have a problem getting Mapserver to display vector line features which I
> created with QGIS and saved as spatial objects in MySQL...I asked for some
> advice on this from the Mapserver forum yesterday but had no responses,
> perhaps someone in this forum has some experience to offer?
>
>  
>
> As explained in the question below, I can create line features in QGIS, save
> them in a MySQL table, and recall and display them with QGIS without any
> problem.  But the same features do not appear to be recognised by OGRInfo or
> by Mapserver. The line features are saved as BLOB data in a MySQL  MyISAM
> table in a column which is defined as type 'geometry'. MySQL can create a
> spatial index of these features.
>
>  
>
> The table is accessed by QGIS as a database layer via the 'Add Vector Layer'
> dialogue. I am using QGIS 1.7. 
>
>  
>
> It's not really a QGIS problem, but I spent all day wrestling with this
> yesterday but have not solved it.  Any suggestions?
>
>  
>
>  
>
>  
>
> Chris
>
>  
>
> ############################################################################
> ###     
>
>  
>
>  
>
> 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
>
>  
>
>  
>
>  
>
>  
>
>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20110727/c2ba3d45/attachment.html>


More information about the Qgis-user mailing list