[mapserver-users] Postgis conexion Error

Jeff McKenna jmckenna at gatewaygeomatics.com
Tue Nov 8 08:10:16 EST 2011


 From the doc 
(http://www.mapserver.org/mapscript/php/index.html#layerobj) see:

***
int 	connectiontype 	read-only, use setConnectionType() to set it
***

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 11-11-08 5:54 AM, Karlinhos wrote:
> Hi, in my php script I use something like that:
>
> /
> 	$Poligono1 = ms_newLayerObj($mapObject);
> 	$Poligono1->set( "name", "Capa de todo");
> 	$Poligono1->set( "type", MS_LAYER_POLYGON);
> 	$Poligono1->set( "status", MS_ON);
> 	
> 	$Poligono1->set("connectiontype",MS_POSTGIS);
> 	$Poligono1->set("connection","user=postgres password=**** dbname=****
> host=localhost");
> 	$Poligono1 ->set("data","the_geom FROM public.concellos using unique gid
> using srid=23030");
> /
>
> Ok, The problem is in the line connection..... the error message is this ->
>
> * /Fatal error: Uncaught exception 'MapScriptException' with message
> 'Property 'connectiontype' is read-only and cannot be set.' in
> C:\ms4w\Apache\htdocs\test10.php:30 Stack trace: #0
> C:\ms4w\Apache\htdocs\test10.php(30): layerObj->set('connectiontype',
> 'POSTGIS') #1 {main} thrown in C:\ms4w\Apache\htdocs\test10.php on line 30/*
>
> Can anybody help me with this connection ? ? ?
> I use MS4W, in WINxp :( , and a postgis db in localhost.
> Thanks in advance!
>


More information about the mapserver-users mailing list