[Geomoose-users] identify service

Steve Dougill Steve.Dougill at co.crook.or.us
Wed Oct 6 14:17:21 EDT 2010


I am not sure why but it didn't work until I commented out one line of
code ... see below.  Thanks so much for your help and quick reply

 

The error I got was ... Fatal error - Call to function query by point()
on non object in identify.php line 91

 

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=lcc
+lat_1=42.33333333333334 +lat_2=44 +lat_0=41.66666666666666
+lon_0=-120.5 +x_0=1500000 +y_0=0 +ellps=GRS80 +datum=NAD83
+to_meter=0.3048006096012192 +no_defs");

                $clonePoint->project($projInObj, $projOutObj);

 

                $substArray['mapx'] = round($clonePoint->x,4);

                $substArray['mapy'] = round($clonePoint->y,4);

}else {

    $map->queryByShape($queryShape);

}

 

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/ <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.

From: Len Kne [mailto:lkne at houstoneng.com] 
Sent: Wednesday, October 06, 2010 10:39 AM
To: Steve Dougill; geomoose-users at lists.sourceforge.net
Subject: RE: identify service

 

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 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/ <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/79889d38/attachment.html


More information about the Geomoose-users mailing list