From 4e61397460dfc6ca1e45e7171b282332f75fd2ee Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Fri, 27 Nov 2009 19:21:07 +0000 Subject: [PATCH] A few more Mapserver usage updates. git-svn-id: http://svn.osgeo.org/postgis/trunk@4917 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/using_postgis_app.xml | 41 ++++++++++++--------------------------- 1 file changed, 12 insertions(+), 29 deletions(-) diff --git a/doc/using_postgis_app.xml b/doc/using_postgis_app.xml index fc147f1fc..42a8e6996 100644 --- a/doc/using_postgis_app.xml +++ b/doc/using_postgis_app.xml @@ -292,7 +292,7 @@ postgis# VACUUM ANALYZE; FROM table1 LEFT JOIN table2 ON table1.id = table2.id -) AS new_table USING UNIQUE oid USING SRID=-1" +) AS new_table USING UNIQUE gid USING SRID=-1" @@ -300,25 +300,15 @@ postgis# VACUUM ANALYZE; MapServer requires a unique id for each row in order to - identify the row when doing map queries. Normally, it would use - the oid as the unique identifier, but views and subselects don't - automatically have an oid column. If you want to use MapServer's - query functionality, you need to add a unique column to your view - or subselect, and declare it with USING UNIQUE. - For example, you could explicitly select one of the table's oid + identify the row when doing map queries. Normally it identifies + the primary key from the system tables. However, views and subselects don't + automatically have an known unique column. If you want to use MapServer's + query functionality, you need to ensure your view + or subselect includes a uniquely valued column, and declare it with USING UNIQUE. + For example, you could explicitly select nee of the table's primary key values for this purpose, or any other column which is guaranteed to be unique for the result set. - The USING statement can also be useful - even for simple DATA statements, if you are - doing map queries. It was previously recommended to add an index - on the oid column of tables used in query-able layers, in order to - speed up the performance of map queries. However, with the - USING clause, it is possible to tell mapserver - to use your table's primary key as the identifier for map queries, - and then it is no longer necessary to have an additional - index. - "Querying a Map" is the action of clicking on a map to ask for information about the map features in that location. Don't @@ -334,7 +324,7 @@ postgis# VACUUM ANALYZE; PostGIS needs to know which spatial referencing system is being used by the geometries in order to return the correct data - back to mapserver. Normally it is possible to find this + back to MapServer. Normally it is possible to find this information in the "geometry_columns" table in the PostGIS database, however, this is not possible for tables which are created on the fly such as subselects and views. So the @@ -344,13 +334,6 @@ postgis# VACUUM ANALYZE; - - The parser for MapServer PostGIS layers is fairly primitive, and - is case sensitive in a few areas. Be careful to ensure that all SQL - keywords and all your USING clauses are in upper - case, and that your USING UNIQUE clause precedes - your USING SRID clause. - @@ -363,7 +346,7 @@ postgis# VACUUM ANALYZE; CONNECTIONTYPE postgis NAME "roads" CONNECTION "user=theuser password=thepass dbname=thedb host=theserver" - DATA "the_geom FROM roads" + DATA "the_geom from roads" STATUS ON TYPE LINE CLASS @@ -384,7 +367,7 @@ END CONNECTIONTYPE postgis CONNECTION "user=theuser password=thepass dbname=thedb host=theserver" PROCESSING "CLOSE_CONNECTION=DEFER" - DATA "the_geom FROM roads" + DATA "the_geom from roads" MINSCALE 100000 STATUS ON TYPE LINE @@ -397,7 +380,7 @@ LAYER CONNECTIONTYPE postgis CONNECTION "user=theuser password=thepass dbname=thedb host=theserver" PROCESSING "CLOSE_CONNECTION=DEFER" - DATA "the_geom FROM roads" + DATA "the_geom from roads" MAXSCALE 100000 STATUS ON TYPE LINE @@ -426,7 +409,7 @@ END regular black lines. So, we have done a couple of interesting things using only - mapserver functionality, but our DATA SQL statement + MapServer functionality, but our DATA SQL statement has remained simple. Suppose that the name of the road is stored in another table (for whatever reason) and we need to do a join to get it and label our roads. -- 2.50.1