[mapserver-users] MS4W and Oracle

Ricardo Queiroz ricardoqmacedo at gmail.com
Wed May 18 05:48:37 PDT 2016


This is my first mail to this list, and sorry about english (not my native
language)

I've a software with ms4w 1.3.4 and pgsql9.5 (and postgis 2.2.2) and works
fine, so i need to convert all the app to use oracle (client request =/,
i'm using oracle client 11.2.0.3.0). I follow the steps of the ms4w
installation and when  write "mapserv -v" in console the oraclespatian
appears, so the next step was test the connection layer, there's ok, when i
change some parameters (to wrong) in the conn string the connect fail, but
here's the problem, when i set a data in the layer (simple sql) allways
return a error and i can't resolve this, don't know if is some mapserver
config or else.

Basic example of layer (trying draw a point):

$objLayer = ms_newLayerObj($objMap);
$objLayer ->set("name", "layer_oracle");
$objLayer ->setConnectionType(MS_ORACLESPATIAL);
$objLayer ->set("connection", "user/pass at tnsName");
$objLayer ->setProcessing("CLOSE_CONNECTION=DEFER");
$objLayer ->set("type", MS_LAYER_POINT);

$data = "THE_GEOM from (select PK_ID, NAME as LABELITEM, THE_GEOM from
user.TABLE_POINT) USING SRID 29193";
$objLayer ->set("data", $data); unset($data);

$objLayer ->set("labelitem", "LABELITEM");
$objLayer ->set("template", "layer.html");
$objLayer ->set("header", "layer.html");
$objLayer ->set("footer", "layer.html");

$objClass= ms_newClassObj($objLayer );
$objClass->set("name", "POINT");

$objStyle= ms_newStyleObj($objClass);
$objStyle->set("symbolname", "dot_purple");

$objLabel= new labelObj();
$objLabel->color->setRGB(217, 242, 230);
$objLabel->outlinecolor->setRGB(0, 0, 0);
$objLabel->set("font", "luxi-bold");
$objLabel->set("size", 9);
$objLabel->set("position", MS_UC);
$objLabel->set("partials", MS_TRUE);
$objLabel->set("mindistance",100);
$objLabel->set("buffer",4);

$objClass->addLabel($objLabel);
$objLayer ->set("status", MS_ON);

$objLayer ->free(); $objClass->free(); $objStyle->free(); $objLabel->free();
unset($objLayer); unset($objClass); unset($objStyle); unset($objLabel);


I get the error message:

Warning: mapObj::draw(): [MapServer Error]: msDrawMap(): Failed to draw
layer named 'layer_oracle'. in...
Warning: mapObj::draw(): [MapServer Error]:
msOracleSpatialLayerWhichShapes(): Check your data statement and server
logs in...


When i change some var on set("connection") i get the error conn msg, so i
can connect, just can't draw the point

Warning: mapObj::draw(): [MapServer Error]: msOracleSpatialLayerOpen():
Cannot create OCI Handlers. Connection failure. Check your logs and the
connection string. in



The same example works fine when i change to postgis (using the same table
"structure").
Oracle table and the record:

CREATE TABLE TABLE_POINT
(
PK_ID NUMBER,
NAME VARCHAR2(30 BYTE),
THE_GEOM  SDO_GEOMETRY,
PRIMARY KEY (PK_ID)
)

insert into TABLE_POINT(PK_ID, NAME, THE_GEOM) values(1, 'Point
1', MDSYS.SDO_GEOMETRY(2001,29193,MDSYS.SDO_POINT_TYPE(798062.7655190326,7459237.923282569,null),null,null));



Thanks,

Ricardo Queiroz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20160518/1fd7c536/attachment.html>


More information about the mapserver-users mailing list