Fwd: [Cartoweb-users] SOAP bbox request

Alexandre Saunier alexandre.saunier at camptocamp.com
Fri Jul 28 11:29:36 EDT 2006


Alex,

pay attention that the CartoWeb SOAP documentation may be quite outdated 
according to this bugreport:
http://bugzilla.maptools.org/show_bug.cgi?id=1513

AS

> ---------- Forwarded message ----------
> From: *Alex Kuznetsov* <nexikan at gmail.com <mailto:nexikan at gmail.com>>
> Date: Jul 27, 2006 12:39 PM
> Subject: Re: [Cartoweb-users] SOAP bbox request
> To: Damien Corpataux <damien.corpataux at camptocamp.com 
> <mailto:damien.corpataux at camptocamp.com>>
> 
> Damien -
> 
> Thanks again for your reply... we appreciate your time and any clues you 
> can provide.
> 
> We are beginners with CartoWeb and are definitely interested in 
> CartoClient only at this stage. However, we would like to add a search 
> function to locate property parcels based on various criteria and have 
> the map zoom in to the parcel. Our parcel attribute and spatial data is 
> stored in PostGIS. We thought the PHP code was the only way to do this, 
> but as you can see, there are a few "loose ends".
> 
> Our project is described to some degree at the following URLs:
> 
> http://www.webgisdev.com/webgis/6apro.htm - phase 1
> http://www.webgisdev.com/webgis/6bpro.htm - phase 2
> 
> Thanks
> - Alex
> 
> 
> 
> On 7/27/06, *Damien Corpataux* < damien.corpataux at camptocamp.com 
> <mailto:damien.corpataux at camptocamp.com>> wrote:
> 
>     Alex,
> 
>     we try provide the users with clues on what's going on as much as
>     possible. By the way, do you plan to use CartoWeb as a Web Service
>     (using the Cartoserver only, writing your own client, a huge task),
>     or do you plan to use the PHP client (the Cartoclient), packaged
>     with CartoWeb?
> 
>     I recommend you use the Cartoclient and create a project with your
>     own data (it this is what you want).
> 
>     Damien
> 
> 
> 
> 
>     Alex Kuznetsov wrote:
> 
>>     Damien,
>>
>>     Thank you for your reply.
>>
>>     We got the SOAP request directly from the CartoWeb Documentation
>>     (page 148)... please do not assume we know what we are doing ;o)
>>
>>     We assumed that
>>     http://localhost/cartoserver.wsdl.php?mapId=ybaranav1 is the
>>     proper substitution for the example URL given on the same page.
>>     How can we check that it is accessible?
>>
>>     BTW, this project is being completed over the next two weeks by 68
>>     GIS Specialist students here at Fleming College in Ontario... so
>>     we ALL appreciate any further assistance you can provide.
>>
>>     Thanks again
>>     - Alex
>>
>>
>>
>>     On 7/26/06, *Damien Corpataux* < damien.corpataux at camptocamp.com
>>     <mailto:damien.corpataux at camptocamp.com>> wrote:
>>
>>         Hi,
>>
>>         manually building a SOAP request is rather unusual, but I
>>         assume you know what you're doing and why you're doing it. At
>>         this point, I would check that the ressource
>>         http://localhost/cartoserver.wsdl.php?mapId=ybaranav1 is
>>         accessible from your php script.
>>
>>         Damien
>>
>>
>>
>>         Alex Kuznetsov wrote:
>>         We are working on a college MapServer project with CartoWeb...
>>         is a great productive tool.
>>         As a final task, we are trying to add functionality to search
>>         for an individual parcel and zoom
>>         to it on the map. We are able to retrieve the coordinates from
>>         our PostGIS database but can't get
>>         the SoapClient working and can't figure out how to integrate
>>         this function with the rest of CartoWeb...
>>         i.e. do we have to add/extend a plug-in?
>>
>>         Our third attempt is pasted below. Note the ERROR above the
>>         offending line.
>>
>>         Any help greatly appreciated
>>         - Tony Bonnici, Alex Kusnetsov
>>
>>         -------------
>>
>>         <html>
>>          <head><title>Parcel Locator</title>
>>          </head>
>>
>>          <body>
>>
>>          <?php
>>
>>           $dbcon = pg_connect("dbname=webproj6 user=postgres
>>         host=localhost password=postgres");
>>
>>           if ($dbcon == 0) die("connection to WebProj6 PostgreSQL DB
>>         failed");
>>
>>           $query = 'SELECT astext(envelope(the_geom)) FROM poly_parcel
>>         where GID = 5000' ;
>>
>>           $result = pg_query($query) or die('Query failed [' . $query
>>         . '] with error: ' . pg_last_error());
>>
>>           while ($line = pg_fetch_array($result, null, PGSQL_ASSOC))
>>           {
>>             foreach ($line as $col)
>>               list($j1, $j2, $x1, $y1, $xj, $yj, $x2, $y2) = split('[(
>>         ,]', $col) ;
>>           }
>>
>>           pg_free_result($result);
>>           pg_close($dbcon);
>>
>>           $x1 -= $margin ;
>>           $y1 -= $margin ;
>>           $x2 += $margin ;
>>           $y2 += $margin ;
>>
>>         // ERROR ON NEXT LINE: Warning: SoapClient::__construct() [
>>         function.SoapClient---construct]:
>>
>>         // I/O warning : failed to load external entity "
>>         http://localhost/cartoserver.wsdl.php?mapId=ybaranav1"
>>
>>         // in C:\wamp\www\cartoweb3\projects\ybaranav1\parloc2.php on
>>         line 41
>>
>>
>>
>>           $client = new SoapClient("
>>         http://localhost/cartoserver.wsdl.php?mapId=ybaranav1
>>         <http://localhost/cartoserver.wsdl.php?mapId=ybaranav1>");
>>
>>           $request->mapId = 'ybaranav1';
>>
>>           $request->imagesRequest->className = 'ImagesRequest';
>>           $request->imagesRequest->mainmap->isDrawn = true;
>>           $request->imagesRequest->mainmap->path = '';
>>           $request->imagesRequest->mainmap->width = 500;
>>           $request->imagesRequest->mainmap->height = 500;
>>           $request->imagesRequest->mainmap->format = '';
>>
>>           $request->imagesRequest->keymap->isDrawn = true;
>>           $request->imagesRequest->keymap->path = '';
>>           $request->imagesRequest->keymap->width = 224;
>>           $request->imagesRequest->keymap->height = 150;
>>           $request->imagesRequest->keymap->format = '';
>>
>>           $request->imagesRequest->scalebar->isDrawn = true;
>>           $request->imagesRequest->scalebar->path = '';
>>           $request->imagesRequest->scalebar->width = 350;
>>           $request->imagesRequest->scalebar->height = 3;
>>           $request->imagesRequest->scalebar->format = '';
>>
>>           $request->layersRequest->className = 'LayersRequest';
>>           $request->layersRequest->layerIds = array('Parcel','Buildings');
>>
>>           $request->layersRequest->resolution = null;
>>
>>           $request->locationRequest->className = 'LocationRequest';
>>           $request->locationRequest->locationType = 'bboxLocationRequest';
>>           $request->locationRequest->bboxLocationRequest->bbox->minx =
>>         $x1 ;
>>           $request->locationRequest->bboxLocationRequest->bbox->miny =
>>         $y1 ;
>>           $request->locationRequest->bboxLocationRequest->bbox->maxx =
>>         $x2 ;
>>           $request->locationRequest->bboxLocationRequest->bbox->maxy =
>>         $y2 ;
>>
>>           try
>>           {
>>             $result = $client->getMap($request);
>>             print_r($result);
>>           }
>>           catch (SoapFault $fault)
>>           {
>>             print $fault->faultstring;
>>           }
>>
>>         ?>
>>
>>         </body>
>>         </html>
>>
>>------------------------------------------------------------------------
>>
>>_______________________________________________
>>Cartoweb-users mailing list
>>
>>
>>
>>Cartoweb-users at lists.maptools.org <mailto:Cartoweb-users at lists.maptools.org>
>>
>>
>>http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>
>>  
>>
>>
>>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users


More information about the Cartoweb-users mailing list