[Geomoose-users] Feature Report opportunities

Brent Fraser bfraser at geoanalytic.com
Mon Jun 1 16:06:09 PDT 2015


Devs,

   While doing support for Feature Reports I found a couple of 
shortcomings with feature_report.php


1. Map portion of report not rendered if feature's layer projection is 
different from map's projection.

We need to insert some code to re-project the shape before setting the 
extent of the map graphic.  I used the following just before line 100:

//---------------------------------------------------------------------
# Re-project the feature shape if necessary:
$map_projection_text = $mapObj->getProjection();
if($map_projection_text != NULL) {
     $map_projectionObj = ms_newProjectionObj($map_projection_text);
}
if($layer->getProjection() != NULL) {
     $layer_projection_text = $layer->getProjection();
     $layer_projectionObj = ms_newProjectionObj($layer_projection_text);
}

if($layer_projectionObj) {
     $shape->project($layer_projectionObj, $map_projectionObj);
}
//---------------------------------------------------------------------

mapObj->setExtent($shape->bounds->minx,$shape->bounds->miny,$shape->bounds->maxx,$shape->bounds->maxy);
:


2.  Other layers not shown in Feature Report map graphic.

This one is a little tougher.  There is a tag in the feature_report 
service definition in the mapbook.xml:

<inputtype="hidden"name="layers"value="lmic/fsa"/>

but "layers" entry is never referenced on the feature_report.php. I 
suspect the intent was to allow the specification of other layers to 
render into the map graphic for the Feature Report.  I suppose we could 
use some code from print_util.php to do this (or just use all visible 
layers?).


If there is no disagreement, I'll create a couple of Issues in github 
for the above.

-- 
Best Regards,
Brent Fraser




More information about the Geomoose-users mailing list