OGR connection for LINUX

joÿffffffffffe3o Antunes bluetuna_goes_skying at YAHOO.CO.UK
Tue May 24 11:56:27 EDT 2005


Hello Frank

sorry to be back on this subject but I could not
achieve my final goal yet..

I recall that my final goal is to make thematic maps
using an external updatable mysql table. This table
was fetched using an OGR connection to an ODBC in
windows environment but now I exported all my
application to LINUX so I am trying to access my mysql
table directly from OGR compiled with MySQL support.

OGR was compiled with MySQL support and it is working
properly after your  directions. I run:

 ogrinfo -ro
"/usr/local/apache2/htdocs/abruzzo/maps/data" -sql
"SELECT Id,FIELD  FROM comuni_abruzzo_gb LEFT JOIN
'MySQL:abruzzo,user=rt,password=rt,host=localhost'.zzz
ON comuni_abruzzo_gb.Id = zzz.ID1"

and a list of the atributes of the joined tables comes
out as well as the coordinates that define the
polygons.
Now I put that code in my map file like this:

 CONNECTIONTYPE OGR
 CONNECTION
"/usr/local/apache2/htdocs/abruzzo/maps/data"
 DATA "SELECT Id,FIELD FROM comuni_abruzzo_gb LEFT
JOIN
'MYSQL:abruzzo,user=rt,password=rt,host=localhost'.zzz
ON comuni_abruzzo_gb.Id=zzz.ID1"

but I keep getting this error

 Warning: [MapServer Error]: msDrawMap(): Failed to
draw layer named 'comuni'.  in
/usr/local/apache2/htdocs/abruzzo/_l_test_mysql.php on
line 117

 Warning: [MapServer Error]: msOGRLayerOpen(): OGR
support is not available. in
/usr/local/apache2/htdocs/abruzzo/_l_test_mysql.php on
line 117

 Fatal error: Call to a member function on a
non-object in
/usr/local/apache2/htdocs/abruzzo/_l_test_mysql.php on
line 118

even though I compiled mapserver using this:

 ./configure --with-php=/usr/local/php_nnn
--with-ogr=/usr/local/bin/gdal-config
--with-gdal=/usr/local/bin/gdal-config

and everything went fine..

... so I do not understand what's going on here..

... phpmapscript is working fine as well as all the
rest concerning the mapserver cgi... I just seem to be
not able to implement this OGR connection..

thank you so much for your pacience

regards

joao


--- Frank Warmerdam <fwarmerdam at gmail.com> wrote:
> On 5/23/05, joÿffffffffffe3o Antunes
> <bluetuna_goes_skying at yahoo.co.uk> wrote:
> > Hello frank,
> >
> > I am still fighting to have mysql support using
> OGR..
> >
> > the "funny" thing is that each time I run
> >
> > ogrinfo -ro -al -so
> >
>
'MYSQL:database=abruzzo,tablename=zzz,user=arit,password=arit,host=localhost,port:3306'
> >
> > I get this message:
> >
> > Warning 1: 'tablename=zzz' in MYSQL datasource
> > definition not recognised and ignored.
> > Warning 1: 'port:3306' in MYSQL datasource
> definition
> > not recognised and ignored.
>
> Joao,
>
> I see the documentation was wrong.  The table name
> list parameter
> is actually tables=, not tablename=.  I have
> corrected the docs online.
>
> Also, your port specifier should be port=n, not
> port:n.
>
> And finally you don't use database=, just make the
> database name
> the first argument.  Try instead something like:
>
> ogrinfo -ro -al -so
>
'MYSQL:abruzzo,tables=zzz,user=arit,password=arit,host=localhost,port=3306'
>
> Good luck,
> --
>
---------------------------------------+--------------------------------------
> 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
>





___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com



More information about the mapserver-users mailing list