[mapserver-users] buffer bounds (PHP Mapscript)

Carlo Pelliconi c.pelliconi at sis-ter.it
Fri Apr 11 14:05:40 EDT 2008


Thank you very much Armin: it works!

Carlo

Armin Burger ha scritto:
> Carlo
>
> I don't know if this behaviour is a feature or a bug of PHP Mapscript 
> (I have not tested it with SWIG versions of Mapscript). A workaround 
> is to project the buffer in the same projection as the layer. Then the 
> extent is returned correctly. Something like
>
> $prj =  ms_newprojectionobj($queryLayer->getProjection());
> $buffer_polygon=$selected_shape->buffer($buffer_width);
> $buffer_polygon->project($prj, $prj);
> $shapebounds=$buffer_polygon->bounds;
>
> Armin
>
> On 11/04/2008 14:20, Carlo Pelliconi wrote:
>> Hi.
>> I'm trying to obtain automatic zoom on a buffer (which I want to see 
>> in map - and I do that) created around a selected feature.
>> I use
>>
>> $selected_shape=$queryLayer->getShape(...);
>> $buffer_polygon=$selected_shape->buffer($buffer_width);
>> $shapebounds=$buffer_polygon->bounds;
>>
>> This doesn't work: $buffer_shapebounds (which is a rectobj) is set to 
>> -1 -1 -1 -1 and used in setExtent it doesn't work.
>> If I apply the same code to a "real" shapefile (eg. the result of a 
>> getShape, without the buffer around), it works:
>>
>> $selected_shape=$queryLayer->getShape(...);
>> $shapebounds=$selected_shape->bounds;
>>
>> In this case $shapebounds is well defined and used in setExtent it 
>> works.
>>
>> Any idea or suggestion?
>> Thanks in advance
>>
>
>
>


-- 
ing. Carlo Pelliconi
c.pelliconi at sis-ter.it
SIS.TER S.p.A.
www.sis-ter.it
via Mentana, 10
40026 Imola (BO) Italy
cell    +39 333 6375379
tel     +39 0542 364034
fax     +39 0542 612130

ATTENZIONE!
Questo documento è indirizzato esclusivamente al destinatario. Tutte le
informazioni ivi contenute, compresi eventuali allegati, sono soggette
a riservatezza secondo i termini del D.Lgs. 196/2003 in materia di
"privacy" e ne è proibita l'utilizzazione da parte di altri soggetti. Si ricorda che la diffusione l'utilizzo e/o la conservazione dei dati ricevuti per errore costituisce violazione di carattere penale ai sensi dell'art. 616 Codice penale (Violazione, sottrazione e soppressione di corrispondenza). Se avesse ricevuto per errore questo messaggio, La preghiamo cortesemente di contattare il mittente al più presto e di cancellare il messaggio subito dopo. Grazie.

ATTENTION!
This message is being sent from Sis.Ter S.p.A. and may contain information which is confidential or privileged. If you are not the intended recipient, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy. Any unauthorized use of the content of this message is a breach of your duty to respect the confidentiality of the correspondence between other persons and can expose the responsible party to civil and/or criminal penalties (D.Lgs. 196/2003 "Tutela della privacy" e art. 616 Codice penale "Violazione, sottrazione e soppressione di corrispondenza"), and may constitute a more serious offence. Thanks.

ACHTUNG!
Dieses Dokument ist ausschließlich dem Empfänger vorbehalten. Die darin enthaltenen Informationen, auch jene in etwaigen Anlagen, gelten im Sinne des Dekrets Nr. 196/2003 in Sachen "Privacy" als streng vertraulich und dürfen von anderen Personen nicht verwende werden. Wer diese Mitteilung irrtümlicherweise erhält ist gebeten uns umgehend zu informieren und anschließend die Mitteilung zu vernichten. Vielen Dank.




More information about the mapserver-users mailing list