[Geomoose-users] identify service

Len Kne lkne at houstoneng.com
Wed Oct 6 13:38:54 EDT 2010


Hi Steve

Look for the following lines in identify.php

                                if($queryShape->type == MS_SHAPE_POINT) {
                                                $point = $queryShape->line(0)->point(0);
                                                $map->queryByPoint($point, MS_MULTIPLE, -1);
                                                $substArray['mapx'] = $point->x;
                                                $substArray['mapy'] = $point->y;
                                } else {
                                                $map->queryByShape($queryShape);
                                }

And change them to:

                                if($queryShape->type == MS_SHAPE_POINT) {
                                                $point = $queryShape->line(0)->point(0);
                                                $map->queryByPoint($point, MS_MULTIPLE, -1);

$clonePoint = $point;
$projOutObj = ms_newprojectionobj("proj=latlong");
$projInObj = ms_newprojectionobj("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs");
$clonePoint->project($projInObj, $projOutObj);

$substArray['mapx'] = round($clonePoint->x,4);
$substArray['mapy'] = round($clonePoint->y,4);
                                } else {
                                                $map->queryByShape($queryShape);
                                }

This is a quick way to do this - you will need to change $projInObj to match your map projection (the example above is web Mercator).  See www.spatialreference.org<http://www.spatialreference.org> to get proj4 strings.

Len


From: Steve Dougill [mailto:Steve.Dougill at co.crook.or.us]
Sent: Wednesday, October 06, 2010 12:06 PM
To: geomoose-users at lists.sourceforge.net
Subject: [Geomoose-users] identify service

I am using the identify service and by default it returns the x,y coordinates of the clicked location in ground coordinates ... It looks like this is set in identify.php.  Has anyone changed the code to give lat long coordinates instead?

Steve Dougill
Crook County GIS - IT - Web
267 NE 2nd St, Suite 200, Prineville, OR 97754
Tel. 541.416.3930
http://gis.co.crook.or.us/
* * * CONFIDENTIALITY NOTICE * * *
This e-mail may contain information that is privileged, confidential, or otherwise exempt from disclosure under applicable law.  If you are not the addressee or it appears from the context or otherwise that you have received this e-mail in error, please advise me immediately by reply e-mail, keep the contents confidential, and immediately delete the message and any attachments from your system.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20101006/0b2d623c/attachment.html


More information about the Geomoose-users mailing list