Classification:  UNCLASSIFIED 
Caveats: NONE
 
Hello All,

 

I am trying to use the mapOverlay plugin to draw data from a SQL query onto a
layer.

 

>From my ServerMyplugin.php:

public function handlePreDrawing($request) {

                        $layer = new LayerOverlay();

                        $layer->name = "block_groups_pl";

                        $layer->connectiontype = "postgis";

                        $layer->connection = "user=USER password=PASSWORD
dbname=DBNAME host=HOSTNAME port=5432";

                        $layer->classitem = "hpdif_class";

                        $layer->data = "shape from ( SELECT mb.shape as
shape, mb.roco as roco_id......

                        $mapOverlay
=$this->serverContext->getPluginManager()->mapOverlay;

                        $mapOverlay->updateMap($layer);

 

The SQL query works if defined in a map file, but I am trying to set several
parts of it as user defined variables.  I edited the connection statement for
public dissemination.

 

However the error message I get is:

 

class:   SoapFaultWrapper

message:   Mapserver error: Error in msDrawMap(): Failed to draw layer named
'block_groups_pl'.

 

Error in msSHPOpenFile():
(/var/www/geoblaze/cartoweb3/projects/c111_sc2/server_conf/c111_sc2/shape
from ( SELECT mb.shape as shape, mb.roco as roco_id,.....

 

 

This does work if I replace the SQL query with the path to a shape file.  Is
there something else I need to do to get this to work?  According to the
documentation it should function as presented.

 

Thank you,

 

--Donald

 

 

Donald Z Cowart

SAJ GIS Web Architect

904-232-1215

[EMAIL PROTECTED]

 

 
Classification:  UNCLASSIFIED 
Caveats: NONE
_______________________________________________
Cartoweb-users mailing list
[email protected]
http://lists.maptools.org/mailman/listinfo/cartoweb-users

Reply via email to