scale and query problems

Robert Ofarrell s371538 at student.uq.edu.au
Sun Feb 4 17:36:44 PST 2001


Daniel,
A few weeks ago I asked this question, but really didn't get around to
looking into the problem furthur until now.  However I am still have the
same problem as before.  I am sure that my layers are setup properly and
have included the mapfile that I am using below this message.

Your suggestions would be greatly appreciated.

Robert

>
> A couple of problems that I have run into when using MapScript with
PHP3.
>
> 1. When doing a query on a map with multiple layers, the result of a
> msqueryUsingPoint() only returns the shapes in the first two layers and
> seems to ignore the other layers on the map.  I have a nice tolerance so
> that all the layers have some shape where I click but only the first two
> layers respond.
>

Robert,

This probably has more to do with your .map layers setup than with
MapScript itself.  Are all the layers you want to query with STATUS=ON,
and do they all contain a QUERY object?

We've used queries with multiple layers before and I don't remember
noticing a problem... but a bug is always possible.  If you're sure that
your layers are setup properly, then please send me your .map file and
I'll try to reproduce/fix the problem.

// Map File
NAME NSW
SIZE 300 300
SYMBOLSET symbols/symbols.sym
EXTENT 150.000000 -34.000000 152.000000 -32.000000
UNITS KILOMETERS
SHAPEPATH data/
IMAGECOLOR 238 238 255

#
#	Web Object
#
WEB
	MINSCALE 100
	MAXSCALE 100000
	IMAGEPATH "/tmp/ms_tmp/"
	IMAGEURL "/ms_tmp/"
END #Web

#
#	Legend Object
#
LEGEND
	STATUS OFF
	IMAGECOLOR 238 238 255
	KEYSIZE 18 12
	LABEL
		TYPE BITMAP
		SIZE MEDIUM
		COLOR 0 0 89
	END #Label
END #Legend

#
#	ScaleBar Object
#
SCALEBAR
	STATUS ON
	IMAGECOLOR 238 238 255
	SIZE 150 5
	COLOR 255 255 255
	BACKGROUNDCOLOR 0 0 0
	OUTLINECOLOR 0 0 0
	INTERVALS 5
	UNITS KILOMETERS
	LABEL
		COLOR 0 0 0
		SIZE SMALL
	END
END #Scalebar

#
#	Reference Map
#
REFERENCE
	STATUS ON
	COLOR -1 -1 -1
	EXTENT 150.000000 -34.000000 152.000000 -32.000000
	IMAGE "graphics/refmap.gif"
	OUTLINECOLOR 0 0 0
	SIZE 100 100
END #Reference

#
#	QueryMap Object
#
QUERYMAP
	COLOR 192 192 192
	STYLE HILITE
END #QueryMap

#
#	Layer Objects
#
#	Layer: "nsw1_pal2_poly"
LAYER
	NAME "nsw1_pal2_poly"
	DESCRIPTION "nsw1_pal2_poly"
	TYPE POLYGON
	STATUS ON
	DATA "nsw1_pal2_poly"

	CLASSITEM 'NSW1P_ID'
	CLASSITEM 'AREA'
	CLASSITEM 'PERIMETER'
	CLASSITEM 'NSW1_PAL2_'
	CLASSITEM 'IDENT'
	CLASSITEM 'NAME'
	CLASSITEM 'RES_TYPE'
	CLASSITEM 'RES_AREA'
	CLASSITEM 'STATE'
	CLASSITEM 'AUTHORITY'
	CLASSITEM 'RES_NUMBER'
	CLASSITEM 'PROCLAIMED'
	CLASSITEM 'LATEST_GAZ'
	CLASSITEM 'SOURCE'
	CLASSITEM 'REVISED'
	CLASSITEM 'FEATURE'

	CLASS
		EXPRESSION  (1 eq 0)
		NAME "nsw1_pal2_poly"
		COLOR 192 192 192
		OUTLINECOLOR 0 0 0
		LABEL
			FORCE true
			PARTIALS true
			POSITION auto
			SIZE small
			COLOR 255 255 255
			OUTLINECOLOR 0 0 0
		END #Label
	END #Class

	CLASS
		EXPRESSION  (1 eq 1)
		NAME "nsw1_pal2_poly"
		COLOR 120 170 69
		OUTLINECOLOR 0 0 0
	END #Class

	QUERYITEM 'NSW1P_ID'
	QUERYITEM 'AREA'
	QUERYITEM 'PERIMETER'
	QUERYITEM 'NSW1_PAL2_'
	QUERYITEM 'IDENT'
	QUERYITEM 'NAME'
	QUERYITEM 'RES_TYPE'
	QUERYITEM 'RES_AREA'
	QUERYITEM 'STATE'
	QUERYITEM 'AUTHORITY'
	QUERYITEM 'RES_NUMBER'
	QUERYITEM 'PROCLAIMED'
	QUERYITEM 'LATEST_GAZ'
	QUERYITEM 'SOURCE'
	QUERYITEM 'REVISED'
	QUERYITEM 'FEATURE'

	TOLERANCE 0
	QUERY
		EXPRESSION (1 eq 1)
		TEMPLATE ""
	END #Query
END #Layer

#	Layer: "nsw1_pal2_line"
LAYER
	NAME "nsw1_pal2_line"
	DESCRIPTION "nsw1_pal2_line"
	TYPE LINE
	STATUS ON
	DATA "nsw1_pal2_line"

	CLASSITEM 'NSW_ID'
	CLASSITEM 'FNODE_'
	CLASSITEM 'TNODE_'
	CLASSITEM 'LPOLY_'
	CLASSITEM 'RPOLY_'
	CLASSITEM 'LENGTH'
	CLASSITEM 'NSW1_PAL2_'
	CLASSITEM 'FEATURE'
	CLASSITEM 'STATE'

	CLASS
		EXPRESSION  (1 eq 0)
		NAME "nsw1_pal2_line"
		COLOR 192 192 192
		OUTLINECOLOR 0 0 0
		LABEL
			FORCE true
			PARTIALS true
			POSITION auto
			SIZE small
			COLOR 255 255 255
			OUTLINECOLOR 0 0 0
		END #Label
	END #Class

	CLASS
		EXPRESSION  (1 eq 1)
		NAME "nsw1_pal2_line"
		COLOR 70 120 69
		OUTLINECOLOR 0 0 0
	END #Class

	QUERYITEM 'NSW_ID'
	QUERYITEM 'FNODE_'
	QUERYITEM 'TNODE_'
	QUERYITEM 'LPOLY_'
	QUERYITEM 'RPOLY_'
	QUERYITEM 'LENGTH'
	QUERYITEM 'NSW1_PAL2_'
	QUERYITEM 'FEATURE'
	QUERYITEM 'STATE'

	TOLERANCE 0
	QUERY
		EXPRESSION (1 eq 1)
		TEMPLATE ""
	END #Query
END #Layer

#	Layer: "nsw2_pal2_poly"
LAYER
	NAME "nsw2_pal2_poly"
	DESCRIPTION "nsw2_pal2_poly"
	TYPE POLYGON
	STATUS ON
	DATA "nsw2_pal2_poly"

	CLASSITEM 'NSW_ID'
	CLASSITEM 'AREA'
	CLASSITEM 'PERIMETER'
	CLASSITEM 'NSW2_PAL2_'
	CLASSITEM 'IDENT'
	CLASSITEM 'NAME'
	CLASSITEM 'RES_TYPE'
	CLASSITEM 'RES_AREA'
	CLASSITEM 'STATE'
	CLASSITEM 'AUTHORITY'
	CLASSITEM 'RES_NUMBER'
	CLASSITEM 'PROCLAIMED'
	CLASSITEM 'LATEST_GAZ'
	CLASSITEM 'SOURCE'
	CLASSITEM 'REVISED'
	CLASSITEM 'FEATURE'

	CLASS
		EXPRESSION  (1 eq 0)
		NAME "nsw2_pal2_poly"
		COLOR 192 192 192
		OUTLINECOLOR 0 0 0
		LABEL
			FORCE true
			PARTIALS true
			POSITION auto
			SIZE small
			COLOR 255 255 255
			OUTLINECOLOR 0 0 0
		END #Label
	END #Class

	CLASS
		EXPRESSION  (1 eq 1)
		NAME "nsw2_pal2_poly"
		COLOR 200 0 0
		OUTLINECOLOR 0 0 0
	END #Class

	QUERYITEM 'NSW_ID'
	QUERYITEM 'AREA'
	QUERYITEM 'PERIMETER'
	QUERYITEM 'NSW2_PAL2_'
	QUERYITEM 'IDENT'
	QUERYITEM 'NAME'
	QUERYITEM 'RES_TYPE'
	QUERYITEM 'RES_AREA'
	QUERYITEM 'STATE'
	QUERYITEM 'AUTHORITY'
	QUERYITEM 'RES_NUMBER'
	QUERYITEM 'PROCLAIMED'
	QUERYITEM 'LATEST_GAZ'
	QUERYITEM 'SOURCE'
	QUERYITEM 'REVISED'
	QUERYITEM 'FEATURE'

	TOLERANCE 0
	QUERY
		EXPRESSION (1 eq 1)
		TEMPLATE ""
	END #Query

END #Layer

#	Layer: "nsw2_pal2_line"
LAYER
	NAME "nsw2_pal2_line"
	DESCRIPTION "nsw2_pal2_line"
	TYPE LINE
	STATUS ON
	DATA "nsw2_pal2_line"

	CLASSITEM 'NSW_ID'
	CLASSITEM 'FNODE_'
	CLASSITEM 'TNODE_'
	CLASSITEM 'LPOLY_'
	CLASSITEM 'RPOLY_'
	CLASSITEM 'LENGTH'
	CLASSITEM 'NSW2_PAL2_'
	CLASSITEM 'FEATURE'
	CLASSITEM 'STATE'

	CLASS
		EXPRESSION  (1 eq 0)
		NAME "nsw2_pal2_line"
		COLOR 192 192 192
		OUTLINECOLOR 0 0 0
		LABEL
			FORCE true
			PARTIALS true
			POSITION auto
			SIZE small
			COLOR 255 255 255
			OUTLINECOLOR 0 0 0
		END #Label
	END #Class

	CLASS
		EXPRESSION  (1 eq 1)
		NAME "nsw2_pal2_line"
		COLOR 0 0 0
		OUTLINECOLOR 0 0 0
	END #Class

	QUERYITEM 'NSW_ID'
	QUERYITEM 'FNODE_'
	QUERYITEM 'TNODE_'
	QUERYITEM 'LPOLY_'
	QUERYITEM 'RPOLY_'
	QUERYITEM 'LENGTH'
	QUERYITEM 'NSW2_PAL2_'
	QUERYITEM 'FEATURE'
	QUERYITEM 'STATE'

	TOLERANCE 0
	QUERY
		EXPRESSION (1 eq 1)
		TEMPLATE ""
	END #Query

END #Layer

#	Layer: "nsw_pnt2_point"
LAYER
	NAME "nsw_pnt2_point"
	DESCRIPTION "nsw_pnt2_point"
	TYPE POINT
	STATUS ON
	DATA "nsw_pnt2_point"

	CLASSITEM 'NSW_ID'
	CLASSITEM 'AREA'
	CLASSITEM 'PERIMETER'
	CLASSITEM 'NSW_PNT2_'
	CLASSITEM 'NSW_PNT2_I'
	CLASSITEM 'IDENT'
	CLASSITEM 'NAME'
	CLASSITEM 'RES_TYPE'
	CLASSITEM 'RES_AREA'
	CLASSITEM 'STATE'
	CLASSITEM 'AUTHORITY'
	CLASSITEM 'RES_NUMBER'
	CLASSITEM 'PROCLAIMED'
	CLASSITEM 'LATEST_GAZ'
	CLASSITEM 'SOURCE'
	CLASSITEM 'REVISED'
	CLASSITEM 'FEATURE'

	CLASS
		EXPRESSION  (1 eq 0)
		NAME "nsw_pnt2_point"
		COLOR 192 192 192
		OUTLINECOLOR 0 0 0
		LABEL
			FORCE true
			PARTIALS true
			POSITION auto
			SIZE small
			COLOR 255 255 255
			OUTLINECOLOR 0 0 0
		END #Label
	END #Class

	CLASS
		EXPRESSION  (1 eq 1)
		SYMBOL 4
		SIZE 5
		COLOR 0 0 255
	END #Class

	QUERYITEM 'NSW_ID'
	QUERYITEM 'AREA'
	QUERYITEM 'PERIMETER'
	QUERYITEM 'NSW_PNT2_'
	QUERYITEM 'NSW_PNT2_I'
	QUERYITEM 'IDENT'
	QUERYITEM 'NAME'
	QUERYITEM 'RES_TYPE'
	QUERYITEM 'RES_AREA'
	QUERYITEM 'STATE'
	QUERYITEM 'AUTHORITY'
	QUERYITEM 'RES_NUMBER'
	QUERYITEM 'PROCLAIMED'
	QUERYITEM 'LATEST_GAZ'
	QUERYITEM 'SOURCE'
	QUERYITEM 'REVISED'
	QUERYITEM 'FEATURE'

	TOLERANCE 0
	QUERY
		EXPRESSION (1 eq 1)
		TEMPLATE ""
	END #Query

END #Layer

END #MapFile




More information about the MapServer-users mailing list