[Geomoose-users] Problem in query.php if layer SRS different from map SRS

Brent Fraser bfraser at geoanalytic.com
Sun Jul 26 10:12:18 PDT 2015


Tanya,

   Just by looking at the code in Github I see that there is still no 
re-projection of the extent before the query call, so i expect that is 
is still broken (but I will try v2.8).  Now that I'm getting results 
back I ran into the "zoom to results" bug you've referenced, so that 
saved me some time.  Thanks!

Personally, I think the parcel data in our demo should be in EPSG:4326 
so we can discover these problems in our testing before release.

Best Regards,
Brent Fraser

On 7/26/2015 10:57 AM, TC Haddad wrote:
>
> There was a bug that was fixed recently that may relate:
>
> https://github.com/geomoose/geomoose/issues/90
>
> You could try grabbing the relevant changes to query.php:
>
> https://github.com/geomoose/geomoose-services/commit/dacfa7e2648c5bcd3ec38308cb1199621a07c390
>
> Or you could try a 2.8 install to see if the same problem is present 
> (before filing a new issue...).
>
>
>
> On Sun, Jul 26, 2015 at 9:32 AM, Brent Fraser <bfraser at geoanalytic.com 
> <mailto:bfraser at geoanalytic.com>> wrote:
>
>     Hi Developers (and others),
>
>       While debugging a user's problem with using his data with
>     query.php, I see that line 376 in github (or line 420-ish in GM
>     2.7.1):
>
>         $ext = $queryLayer->getExtent();
>
>     then the layer's extent is used for the query a little later:
>
>         $queryLayer->queryByRect($ext);
>
>     This fails to find any features since in my case the coordinate
>     systems of the map and layer are different, and the queryByrect
>     must be done using a rectangle in the MAP's SRS not the LAYER's
>     SRS.  I did a little hack to re-project the extent just before the
>     queryByRect:
>
>                         // re-project the layer's extent into the map
>     SRS for querying:
>                         $map_projection_def = $map->getProjection();
>                         $map_projection_obj =
>     ms_newProjectionObj($map_projection_def);
>
>                         if($queryLayer->getProjection() != NULL) {
>                             $projection = $queryLayer->getProjection();
>                         }
>                         if($projection != NULL) {
>                             # reproject the query shape as available.
>                             $projection =
>     ms_newProjectionObj($projection);
>                         }
>                         if($projection) {
>                             $ext->project($projection,
>     $map_projection_obj);
>                         }
>                         if($DEBUG) {
>                             error_log(implode(',',
>     array($ext->minx,$ext->miny,$ext->maxx,$ext->maxy)));
>                             error_log("<br/>extent for query in map
>     SRS.<br/>");
>                         }
>
>     I thought I would get comments before filing an Issue.
>
>     So any comments?
>
>     -- 
>     Best Regards,
>     Brent Fraser
>
>
>     _______________________________________________
>     Geomoose-users mailing list
>     Geomoose-users at lists.osgeo.org <mailto:Geomoose-users at lists.osgeo.org>
>     http://lists.osgeo.org/mailman/listinfo/geomoose-users
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20150726/a9db65af/attachment.html>


More information about the Geomoose-users mailing list