[Cartoweb-users] RE: Querying a dynamic map layer... (UNCLASSIFIED)

Cowart, Donald Z SAJ Contractor Donald.Z.Cowart at saj02.usace.army.mil
Wed Dec 6 10:17:12 EST 2006


Classification:  UNCLASSIFIED 
Caveats: NONE

Yes, I have TEMPLATE defined as 'ttt' in the map file and I also tried adding
it in the server portion of my plugin where the DATA statement is located....

Mapfile entry:

LAYER
        NAME modbranch
        MAXSCALE 1000001
        TYPE polygon
        STATUS off
        PROJECTION
                'init=epsg:26917'
        END
        TRANSPARENCY 60
        CONNECTIONTYPE postgis
        CONNECTION "user=XXXX password=XXXX dbname=XXXX host=XXXX"
	  CLASSITEM hpdif_class
        CLASS
                NAME 'GT 90 Days Shorter'
                EXPRESSION S9
                COLOR 255 000 000
        END
        CLASS
                NAME '90 - 60 Days Shorter'
                EXPRESSION S6
                COLOR 255 145 000
        END
        CLASS
                NAME '30 - 60 Days Shorter'
                EXPRESSION S3
                COLOR 255 255 000
        END
        CLASS
                NAME 'Within 30 Days'
                EXPRESSION MC
        END
	  TEMPLATE 'ttt'
END


Then in my plugin the client portion gets several variables from the user,
and then passes them along to the server portion of the plugin where the data
statement is executed...

>From ServerModeling.php:

class ServerModeling extends ClientResponderAdapter {

//cut some other data handling functions for clarity....

	public function handlePreDrawing($request) {
		$layer = new LayerOverlay();
		$layer->name = "modbranch";
		$layer->template = 'ttt';
		
		$model="chance_sc";
		
		$plan = $this->comparison; 	 //from the client side
plugin
		$alt = "alternative4";
		$asalt = "alt4b";
		$hdif = $this->hdepth; 		//from the client side plugin
		$yrseason = $this->yrseason; 	//from the client side plugin
		$yr = 98;
        	
		if ( substr($yrseason,4,3) == "dry")
        	$isitmonsoonseason = "dry";
		else
        	$isitmonsoonseason = "wet";

		$layer->data = "shape from ( SELECT mb.shape as shape, 
						mb.roco as roco_id, 
						mb.gse_05 as elev_29, 
						{$alt}.peak_stg as
{$asalt}_peakstg, 
						{$plan}.peak_stg as
{$plan}_peakstg, 
	
{$alt}.{$isitmonsoonseason}_{$hdif} as {$asalt}_hp_days, 
	
{$plan}.{$isitmonsoonseason}_{$hdif} as {$plan}_hp_days, 
	
{$alt}.{$isitmonsoonseason}_{$hdif} - {$plan}.{$isitmonsoonseason}_{$hdif} AS
hpdif_days, 
						cls.dif_class AS hpdif_class 
						FROM {$model}.modbranch_poly
as mb 
						inner join
{$model}.model_{$asalt}_{$yr} AS {$alt} ON {$alt}.roco = mb.roco 
						inner join
{$model}.model_{$plan}_{$yr} AS {$plan} ON {$plan}.roco = mb.roco 
						inner join
{$model}.hpdif_class as cls on cls.hp_dif =
({$alt}.{$isitmonsoonseason}_{$hdif} - {$plan}.{$isitmonsoonseason}_{$hdif})
) AS mb_table 
						 USING UNIQUE roco_id USING
SRID=26917 ";
		
		$mapOverlay
=$this->serverContext->getPluginManager()->mapOverlay;
		$mapOverlay->updateMap($layer);
	}
}



This works as it should for updating the map image, but queries to the
dynamic layer do not work.  Does cartoweb expect the DATA statement to be in
the server side of a plugin?  Does it work better if it is on the client side
of a plugin?


Thank you for your help with this,

--Donald

Donald Z Cowart
SAJ GIS Web Architect
904-232-1215
Donald.z.cowart at saj02.usace.army.mil

-----Original Message-----
From: Oliver Christen [mailto:oliver.christen at camptocamp.com] 
Sent: Wednesday, December 06, 2006 4:49 AM
To: Cowart, Donald Z SAJ Contractor; cartoweb-users at lists.maptools.org
Subject: Re: [Cartoweb-users] RE: Querying a dynamic map layer...
(UNCLASSIFIED)

when you add the new layer, do you add the parameter TEMPLATE with some 
value to that layer?

regards
Oliver


> Classification:  UNCLASSIFIED
> Caveats: NONE
>
>
> Hello again,
>
> I'm still having the issue described below.  The heart of the question is,
> can the query core plug-in, query a dynamically generated (by the 
> mapOverlay
> plug-in) layer?  If so, what is needed in the dynamic/mapoverlay layer to
> make it query-able?
>
> Thank you,
>
> --Donald
>
>
> Donald Z Cowart
> SAJ GIS Web Architect
> 904-232-1215
> Donald.z.cowart at saj02.usace.army.mil
>
> -----Original Message-----
> From: Cowart, Donald Z SAJ Contractor
> Sent: Tuesday, November 28, 2006 1:43 PM
> To: cartoweb-users at lists.maptools.org
> Subject: Querying a dynamic map layer... (UNCLASSIFIED)
>
> Classification:  UNCLASSIFIED
> Caveats: NONE
>
> Hello All,
>
> I have setup a dynamic map layer via a plugin.  The plugin works like it
> should generating the layer data in the handlepredrawing stage.  However,
> When I switch to query mode, the layer does not appear to get queried. 
> Other
> layers do return data correctly.  Is this appropriate behavior?  Do I need 
> to
> access some hooks into the query coreplugin in some way?
>
> Thank you in advance,
>
> --Donald
>
> Donald Z Cowart
> SAJ GIS Web Architect
> 904-232-1215
> Donald.z.cowart at saj02.usace.army.mil
>
>
> Classification:  UNCLASSIFIED
> Caveats: NONE
>
> Classification:  UNCLASSIFIED
> Caveats: NONE
>
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
> 
Classification:  UNCLASSIFIED 
Caveats: NONE




More information about the Cartoweb-users mailing list