[Mapserver-users] Join Query error

Richard Greenwood rich at greenwoodmap.com
Tue Jul 6 18:59:12 EDT 2004


Steve,

As always, thanks for your help.

Removing the query object solves the first problem. Unfortunately the 
4.2 docs still says "Joins are defined within a query object." I think I 
could fix that in CVS if you like.

Unfortunately I'm still not getting data from my joined table, even in a 
one-to-one join. It works with an OGR join, but ultimately I need to get 
a one-to-many join going, so I don't think I can use the OGR join. I've 
tried the obvious stuff with field name case, etc. Do you see anything 
wrong with the layer definition and query string below?

Rich

LAYER
	NAME  "join_query"
	TYPE QUERY
	STATUS ON
	DATA  "parcel_region"			
	HEADER "attribute_header.html"
	FOOTER "attribute_footer.html"
	TEMPLATE "attribute_display.html"
	JOIN
		NAME "test"
		TABLE "/Tc/temp/assessor2.DBF"
		FROM PIDP
		TO PIDA
		TYPE single
	END
END

Query string:
   imgext=2410773.068182+1413684.318182+2424682.613636+1424109.318182
   map=tc/tc.map
   mode=query
   template=tc.html
   layer=join_query
   imgxy=219.5+164.5
   img.x=188
   img.y=168



Steve Lime wrote:

> Hi Rich: Joins live by themselves inside layers. Query objects are long
> gone. Here's an 
> example for a  one-to-one join with a csv file. In the case of a
> one-to-many join you'd 
> have a template defined in the join.
> 
>   # 1 by 1/2 Degree (100K) Quadrangle Index
>   LAYER
>     NAME "L210000030201"
>     STATUS OFF
>     TYPE QUERY
> 
>     # data access information
>     DATA  "/r01/data/drs/metadata/mapserver/gen_state"
>     FILTERITEM  "C210030201"
>     FILTER /./
> 
>     # result presentation information
>     TEMPLATE "query_result.html"
>     HEADER "query_layer_header.html"
>     FOOTER "query_layer_footer.html"
>     JOIN
>       NAME "stats"
>       CONNECTIONTYPE CSV
>       TABLE
> "/r01/data/drs/metadata/data_def/layer_stat/indx_q100kpy4_stat.txt"
>       FROM "TILE_ID"
>       TO "1"
>     END
>   END
> 
> Steve
> 
> 
> 
>>>>Richard Greenwood <rich at greenwoodmap.com> 7/2/2004 1:43:38 PM >>>
> 
> I'm struggling with a join, type multiple. First off I get:
>    loadLayer(): Unknown identifier. Parsing error near (QUERY):(line
> 428)
> (see map file below). If I comment out the QUERY and corresponding END,
> 
> I get rid of the error, but still no data from the joined dbf. The data
> 
> from the base table is displayed, but then "[CATS]" is displayed rather
> 
> than the cat.html template.
> 
> Seems like maybe I shouldn't have a CLASS in a layer with a QUERY, but
> 
> removing it doesn't really effect things much.
> 
> Can anybody point me to a working example that I could examine?
> 
> Thanks,
> Rich

-- 
Richard Greenwood
www.greenwoodmap.com





More information about the mapserver-users mailing list