Coordinate Conversion

andy aborruso at TIN.IT
Mon Jun 11 05:12:57 EDT 2007


Hi Ian,
look if this code (phpmapscript) give you some ispiration.

<?php
        $projInObj = ms_newprojectionobj("init=epsg:4326"); original 
epsg code
        $projOutObj = ms_newprojectionobj("init=epsg:23033"); 
destination epsg code
        $poPoint = ms_newpointobj();
        $poPoint->setXY(13, 38); //original coordinates
        $poPoint->project($projInObj, $projOutObj);       
        echo $poPoint->x.",".$poPoint->y; //echo new coordinates
?>

cheers,

a


Ian Tidy ha scritto:
>
> Hi,
>
> I need some help with a small enhancement to my MapServer site.  I 
> have been asked to display the map extents and centre in other 
> coordinate systems.  Currently the map window returns NZMG 
> co-ordinates, I have been asked to supply these coordinates in NZTM, 
> WGS84, and a few others.
>
> I am using MapServer 4.6, MapScript and PHP on a Linux Server.
> Is there a MapScript function that will convert between coordinate 
> systems or is there another way of doing this?
>
> Cheers Ian
> ______________________
> *Ian Tidy*
> *GIS Analyst / Developer*
> Works Asset Department
> Napier City Council
> Hastings St, Private Bag 6010, Napier, New Zealand
> *Phone +64-6-835-7579 Ext. 8115*
> Fax +64-6-834-4195
> _mailto:iant at napier.govt.nz_
> _http://www.napier.govt.nz_ | _http://maps.napier.govt.nz_
>
>
> ------------------------------------------------------------------------
> This e-mail message has been scanned for Viruses and Content and 
> cleared by *MailMarshal *
> ------------------------------------------------------------------------
> ######################################################################
> Attention:
> This e-mail message and accompanying data may contain information that
> is confidential and subject to legal privilege. Any information
> provided is given in good faith. However unless specifically stated to
> the contrary, Napier City Council accepts no liability for the
> content of this e-mail or for the consequences of any action taken on
> the basis of the information provided, unless that information is
> subsequently confirmed in writing. If you are not the intended recipient,
> you are notified that any use, dissemination, distribution or copying
> of this message or data is prohibited. If you received this e-mail
> message in error, please notify us immediately and erase all copies
> of this message and attachments. Thank you.
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition. 
> Version: 7.5.472 / Virus Database: 269.8.13/843 - Release Date: 10/06/2007 13.39
>   



More information about the mapserver-users mailing list