[mapserver-commits] r12870 - branches/branch-6-0/docs/en/mapfile
trunk/docs/en/mapfile
svn at osgeo.org
svn at osgeo.org
Thu Dec 8 04:25:13 EST 2011
Author: havatv
Date: 2011-12-08 01:25:13 -0800 (Thu, 08 Dec 2011)
New Revision: 12870
Modified:
branches/branch-6-0/docs/en/mapfile/join.txt
trunk/docs/en/mapfile/join.txt
Log:
Updated the join document - mysql example (#4077)
Modified: branches/branch-6-0/docs/en/mapfile/join.txt
===================================================================
--- branches/branch-6-0/docs/en/mapfile/join.txt 2011-12-07 18:23:44 UTC (rev 12869)
+++ branches/branch-6-0/docs/en/mapfile/join.txt 2011-12-08 09:25:13 UTC (rev 12870)
@@ -109,8 +109,8 @@
TYPE [ONE-TO-ONE|ONE-TO-MANY]
The type of join. Default is one-to-one.
-Example 1: Join from SHP file to DBF file
-=========================================
+Example 1: Join from Shape dataset to DBF file
+==============================================
Mapfile Layer
-------------
@@ -184,8 +184,8 @@
</tr>
-Example 2: Join from SHP file to PostgreSQL table
-=================================================
+Example 2: Join from Shape dataset to PostgreSQL table
+======================================================
Mapfile Layer
-------------
@@ -249,8 +249,8 @@
</tr>
-Example 3: Join from SHP file to CSV file
-=========================================
+Example 3: Join from Shape dataset to CSV file
+==============================================
Mapfile Layer
-------------
@@ -275,6 +275,7 @@
FOOTER "../htdocs/cgi-query-templates/footer.html"
JOIN
NAME "test"
+ CONNECTIONTYPE CSV
TABLE "../data/lookup.csv"
FROM "ID"
TO "IDENT"
@@ -335,3 +336,39 @@
<td align="left">[NAME]</td>
<td align="left">[test_VAL]</td>
</tr>
+
+Example 4: Join from Shape dataset to MySQL
+===========================================
+
+Mapfile Layer
+-------------
+
+.. code-block:: mapfile
+
+ LAYER
+ NAME "prov_bound"
+ TYPE POLYGON
+ STATUS DEFAULT
+ DATA "prov.shp"
+ CLASS
+ NAME "Province"
+ STYLE
+ OUTLINECOLOR 120 120 120
+ COLOR 255 255 0
+ END # style
+ END # class
+ TOLERANCE 20
+ TEMPLATE "../htdocs/cgi-query-templates/prov.html"
+ HEADER "../htdocs/cgi-query-templates/prov-header.html"
+ FOOTER "../htdocs/cgi-query-templates/footer.html"
+ JOIN
+ NAME "mysql-join"
+ CONNECTIONTYPE MYSQL
+ CONNECTION 'server:user:password:database'
+ TABLE "mysql-tablename"
+ FROM "ID"
+ TO "mysql-column"
+ TYPE ONE-TO-ONE
+ END # join
+ END # layer
+
Modified: trunk/docs/en/mapfile/join.txt
===================================================================
--- trunk/docs/en/mapfile/join.txt 2011-12-07 18:23:44 UTC (rev 12869)
+++ trunk/docs/en/mapfile/join.txt 2011-12-08 09:25:13 UTC (rev 12870)
@@ -109,8 +109,8 @@
TYPE [ONE-TO-ONE|ONE-TO-MANY]
The type of join. Default is one-to-one.
-Example 1: Join from SHP file to DBF file
-=========================================
+Example 1: Join from Shape dataset to DBF file
+==============================================
Mapfile Layer
-------------
@@ -184,8 +184,8 @@
</tr>
-Example 2: Join from SHP file to PostgreSQL table
-=================================================
+Example 2: Join from Shape dataset to PostgreSQL table
+======================================================
Mapfile Layer
-------------
@@ -249,8 +249,8 @@
</tr>
-Example 3: Join from SHP file to CSV file
-=========================================
+Example 3: Join from Shape dataset to CSV file
+==============================================
Mapfile Layer
-------------
@@ -275,6 +275,7 @@
FOOTER "../htdocs/cgi-query-templates/footer.html"
JOIN
NAME "test"
+ CONNECTIONTYPE CSV
TABLE "../data/lookup.csv"
FROM "ID"
TO "IDENT"
@@ -335,3 +336,39 @@
<td align="left">[NAME]</td>
<td align="left">[test_VAL]</td>
</tr>
+
+Example 4: Join from Shape dataset to MySQL
+===========================================
+
+Mapfile Layer
+-------------
+
+.. code-block:: mapfile
+
+ LAYER
+ NAME "prov_bound"
+ TYPE POLYGON
+ STATUS DEFAULT
+ DATA "prov.shp"
+ CLASS
+ NAME "Province"
+ STYLE
+ OUTLINECOLOR 120 120 120
+ COLOR 255 255 0
+ END # style
+ END # class
+ TOLERANCE 20
+ TEMPLATE "../htdocs/cgi-query-templates/prov.html"
+ HEADER "../htdocs/cgi-query-templates/prov-header.html"
+ FOOTER "../htdocs/cgi-query-templates/footer.html"
+ JOIN
+ NAME "mysql-join"
+ CONNECTIONTYPE MYSQL
+ CONNECTION 'server:user:password:database'
+ TABLE "mysql-tablename"
+ FROM "ID"
+ TO "mysql-column"
+ TYPE ONE-TO-ONE
+ END # join
+ END # layer
+
More information about the mapserver-commits
mailing list