<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Albert,<br>
stupid me!<br>
<br>
It was indeed simple like that.<br>
I didn't read the f.. manual properly. So I didn't realize, that the
tables need to be addressed in both, the connection, as well as the
SQL-statement.<br>
<br>
Thanks a lot for your hint!<br>
<br>
Sven<br>
<br>
<br>
<br>
Am 11.10.2011 10:37, schrieb Albert Rovira:
<blockquote cite="mid:4E94003A.3080607@ngeografics.com" type="cite">
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
Hi,<br>
<br>
This is an OGR feature that by default get all database metadata
... <br>
<br>
You can disable it adding the table parameter on OGR call (see <a
moz-do-not-send="true"
href="http://www.gdal.org/ogr/drv_mysql.html">http://www.gdal.org/ogr/drv_mysql.html</a>)<br>
<br>
I don't know how can you get this result with mapserver.<br>
<br>
<br>
<br>
<br>
Al 11/10/2011 8:32, En/na Sven Burbeck ha escrit:
<blockquote cite="mid:4E93E307.4010505@bfs.de" type="cite">Hi
list, <br>
unfortunately I'm still facing the same problem, so I would like
to give it a trial once more. <br>
<br>
Isn't there anybody who at least has an idea, what the problem
could be? <br>
<br>
cheers, <br>
Sven <br>
<br>
<br>
Am 07.10.2011 10:31, schrieb Sven Burbeck: <br>
<blockquote type="cite">Hi group, <br>
I have a question about ogr-connect to MySql database. <br>
<br>
Yesterday I encountered that my MySQL-DB logged several
SQL-Requests for a single (simple) MapServer request. <br>
My mapfile stores a SQL-Statement like that: <br>
## <br>
SELECT centroid(b.geom), b.id, a.name, date(b.measure_date) as
date, b.value as wert <br>
FROM locality a RIGHT JOIN result b ON a.id = b.id <br>
## <br>
<br>
However, my MySQL-DB logs the following: <br>
## <br>
111007 7:24:22 19 Connect user_xy@localhost on myDB <br>
19 Query SHOW TABLES <br>
19 Query DESCRIBE `table_1` <br>
19 Query SELECT srid FROM
geometry_columns WHERE f_table_name = 'table_1' <br>
19 Query DESCRIBE `table_2` <br>
19 Query SELECT srid FROM
geometry_columns WHERE f_table_name = 'table_2' <br>
19 Query DESCRIBE `table_3` <br>
19 Query SELECT srid FROM
geometry_columns WHERE f_table_name = 'table_3' <br>
19 Query DESCRIBE `table_4` <br>
19 Query SELECT srid FROM
geometry_columns WHERE f_table_name = 'table_4' <br>
... <br>
... <br>
19 Query SELECT centroid(b.geom), b.id,
a.name, date(b.measure_date) as date, b.value as wert FROM
locality a RIGHT JOIN result b ON a.id = b.id <br>
19 Quit <br>
## <br>
<br>
I wondered where all these "SHOW TABLES", "DESCRIBE table..."
came from, since the results are completely unnecessary in
order to retrieve the final "SELECT centroid(b.geom)..."
resultset, aren't they? <br>
<br>
So I did a simple OGR check. <br>
First for the table I would like to retrieve the "geom" column
from: <br>
## <br>
ogrinfo MYSQL:myDB,user=user_xy,password=pwd_xy,port=3306
result -summary <br>
INFO: Open of
`MYSQL:myDB,user=user_xy,password=pwd_xy,port=3306' <br>
using driver `MySQL' successful. <br>
<br>
Layer name: result <br>
Geometry: Polygon <br>
Feature Count: 1680 <br>
Extent: (6.034624, 47.396320) - (15.028760, 55.023074) <br>
Layer SRS WKT: <br>
GEOGCS["GCS_WGS_1984", <br>
DATUM["WGS_1984", <br>
SPHEROID["WGS_1984",6378137,298.257223563]], <br>
PRIMEM["Greenwich",0], <br>
UNIT["Degree",0.017453292519943295]] <br>
FID Column = some_column_with_integers <br>
Geometry Column = geom <br>
... <br>
## <br>
<br>
Next check was just for an ogrinfo-connect with the
sql-statement attached directly: <br>
## <br>
ogrinfo MYSQL:myDB,user=user_xy,password=pwd_xy,port=3306
result -sql 'SELECT centroid(b.geom), b.id, a.name,
date(b.measure_date) as date, b.value as wert FROM locality a
RIGHT JOIN result b ON a.id = b.id' <br>
## <br>
<br>
T my surprise all these ogrinfo requests invoked the described
bulk of SQL-statements. Apparently it doesn't matter if I use
table-join or not. <br>
<br>
So my question is: <br>
Does Mapserver connect to MySQL using the "ogrinfo" request
and is there any way to suppress all these (in my opinion)
unnecessary "Describe table ... / SELECT srid..." queries? <br>
<br>
These are the versions I use: <br>
MapServer version 5.6.5 <br>
GDAL 1.8.0, released 2011/01/12 <br>
mysql Ver 14.14 Distrib 5.5.10, for Linux (x86_64) using
readline 5.1 <br>
<br>
<br>
Any help would be appreciated! <br>
<br>
thanks in advance, <br>
Sven <br>
<br>
</blockquote>
<br>
</blockquote>
<br>
<br>
<div class="moz-signature">-- <br>
<p> Albert Rovira Brugués<br>
Nexus Geografics 902 102255<br>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
href="http://www.nexusgeografics.com">http://www.nexusgeografics.com</a><br>
</p>
<p> <code>Abans d'imprimir aquest missatge pensa en el medi
ambient.</code> </p>
<p> <code>La informació inclosa en aquest missatge és
CONFIDENCIAL. Si vostè llegeix aquest missatge i no és el
destinatari indicat, l'informem que està totalment prohibida
qualsevol utilització, divulgació, distribució i/o
reproducció d'aquesta comunicació, total o parcial, sense
autorització expressa en virtut de la legislació vigent. Si
ha rebut aquest missatge per error, li preguem que ens ho
notifiqui immediatament per aquesta via i procedeixi a la
seva eliminació junt amb els fitxers annexes sense llegir-lo
ni gravar-lo. </code> </p>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
____________________________
Bundesamt für Strahlenschutz (BfS)
SW 2.1
Rosastr. 9
D-79098 Freiburg
phone: ++49 (0)3018 333 6741
fax: ++49 (0)3018 10 333 6741
____________________________</pre>
</body>
</html>