OGR connection for LINUX

joÿffffffffffe3o Antunes bluetuna_goes_skying at YAHOO.CO.UK
Thu May 5 07:39:47 EDT 2005


Thank you Frank for your kind help.

I still have some issues though..

I don't understand which syntax I should use.. I am trying something like

   CONNECTIONTYPE OGR
   CONNECTION "C:\Programmi\Apache Group\Apache\htdocs\abruzzo\maps\data\comuni_abruzzo_gb.shp"
   DATA "SELECT * FROM comuni_abruzzo_gb LEFT JOIN 'MYGIS:database=zzzz_abruzzo, tablename=zzz, user=rt, password=rt, port=3306' ON comuni_abruzzo_gb.Id = zzz.ID"

But I get this error:

Warning: [MapServer Error]: msDrawMap(): Failed to draw layer named 'comuni'. in c:\programmi\apache group\apache\htdocs\abruzzo\_test_mysql.php on line 117

Warning: [MapServer Error]: msOGRFileOpen(): ExecuteSQL(SELECT * FROM comuni_abruzzo_gb LEFT JOIN 'MYGIS:database=zzzz_abruzzo, tablename=zzz, user=root, password=slbenfica, port=3306' ON comuni_abruzzo_gb.Id = zzz.ID) failed. SELECT from table MYGIS:database=zzzz_abruzzo, tablename=zzz, user=rt, password=rt, port=3306 failed, no such table/featureclass. in c:\programmi\apache group\apache\htdocs\abruzzo\_test_mysql.php on line 117

Fatal error: Call to a member function on a non-object in c:\programmi\apache group\apache\htdocs\abruzzo\_test_mysql.php on line 118
Besides I am just gessing as I don't know the syntax rules.. could you giveme a hand on this or tell me the place where I can find this syntax?

Thank you so much

Joao


Frank Warmerdam <fwarmerdam at GMAIL.COM> wrote:
On 5/4/05, joÿffffffffffe3o Antunes wrote:
> Now the challenge is: I am transfering this system to LINUX environment and
> as far as could get so far I still have to use an ODBC connection... is this
> true? I mean beeing in LINUX environment souldn't I be able to make a direct
> connection between mapserver an MySQL without having to use a windows native
> technology?
>
> I am afraid I might be making things more complex than they could be..
>
> thanks in advance for any tips.

Joao,

On Linux (or windows for that matter) you can access MySQL either
via ODBC or via a direct MySQL connection depending on how your
package is built. The direct MySQL driver is minimally documented at:

http://www.gdal.org/ogr/drv_mysql.html

I find it easier to build OGR directly against MySQL and use that
instead of ODBC on Linux where ODBC can be pretty hairy.

Note that in your example you were using a shapefile. That
configuration should work fine on Linux too.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent


---------------------------------
How much free photo storage do you get? Store your holiday snaps for FREE with Yahoo! Photos. Get Yahoo! Photos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050505/b2879cec/attachment.html


More information about the mapserver-users mailing list