[Geomoose-users] Feature Report error with Identify Tool
Brent Fraser
bfraser at geoanalytic.com
Mon Jun 1 09:57:48 PDT 2015
There doesn't seem to be a lot of documentation for the Feature Report
service, so I made some notes:
Feature Reports
Edit (or copy) the feature_report service in the mapbook to add the key
field, for example:
<service name="feature_report_Hydrography" display="false"
keep-others="true">
<url>php/feature_report.php</url>
<input type="hidden" name="layers" value="Backgrounds/osm"/>
<input type="hidden" name="src"/>
<input type="hidden" name="BF_ID"/>
</service>
Add the metadata to the feature’s map file:
METADATA
'identify_record' 'BF_HYDRO_POLYGON_identify.html'
'popups' 'BF_HYDRO_POLYGON_popups.html'
'feature_report' 'BF_HYDRO_POLYGON_report.xml'
END # of METADATA
Edit the _identify template to add a link to generate and view the
report. For example my BF_HYDRO_POLYGON_identify.html template has:
<tr><td align="left"><b><a href =
"javascript:GeoMOOSE.startService('feature_report_Hydrography',
{'BF_ID': '[BF_ID]', 'src' : 'Hydrography/Lakes'})">Report</a></b></td></tr>
Create the report xml file (in my case the file is named
BF_HYDRO_POLYGON_report.xml) modifying the key name and the PDF report name:
<query item="BF_ID" string="%qstring%"/>
<!-- This is the template -->
<template>BF_HYDRO_POLYGON_template.pdf</template>
Create the report PDF file
Copy the parcel_template.pdf to the name you entered in the report xml
file, for example:
copy parcel_template.pdf BF_HYDRO_POLYGON_template.pdf
Best Regards,
Brent Fraser
On 6/1/2015 10:22 AM, Fernando wrote:
> Hi again, after reading your answers, I tried to change dxf_text to
> gid, as Brent says but the error is exactly the same. The dxf_text
> column are unique identifiers of our project.
>
> And to test the idea of Tanya, I have corrected the projection of
> drawing, referencing it with ArcMap to EPSG 23030:
>
> Projected Coordinate System: ED_1950_UTM_Zone_30N
> Projection: Transverse_Mercator
> Linear Unit: Meter
>
> And placing on the extend of southern Spain following: 358836 4186265
> 359163 4186624
>
> MAP
> NAME EDIFICIO_C2_MAP
> STATUS ON
> EXTENT 358836 4186265 359163 4186624
> UNITS METERS
> .....
> PROJECTION
> "init=epsg:23030"
> END
> ......
> LAYER
> CONNECTIONTYPE postgis
> CONNECTION "user=postgres password=************** dbname=edificio_c2
> host=localhost port=5432"
> DATA "the_geom FROM c2_shape USING UNIQUE gid USING SRID=23030"
> .....
>
> And the error is as follows:
>
> Warning: layerObj::queryByRect(): [MapServer Error]:
> msPostGISLayerWhichShapes(): Error executing query: ERROR: error de
> sintaxis en o cerca de «C2BO010»
> LINE 1: ...6624,359163 4186265,358836 4186265))',23030) and (16C2BO010)
> ^
> in C:\ms4w\apps\geomoose2\htdocs\php\feature_report.php on line 72
>
> Warning: mapObj::setExtent(): [MapServer Error]: setExtent(): Given
> map extent is invalid. Check that it is in the form: minx, miny, maxx,
> maxy
> in C:\ms4w\apps\geomoose2\htdocs\php\feature_report.php on line 100
>
> Warning: mapObj::setExtent(): [MapServer Error]:
> msPostGISLayerWhichShapes(): Error executing query: ERROR: error de
> sintaxis en o cerca de «C2BO010»
> LINE 1: ...6624,359163 4186265,358836 4186265))',23030) and (16C2BO010)
> ^
> in C:\ms4w\apps\geomoose2\htdocs\php\feature_report.php on line 100
>
> Fatal error: Uncaught exception 'MapScriptException' in
> C:\ms4w\apps\geomoose2\htdocs\php\feature_report.php:100
> Stack trace:
> #0 C:\ms4w\apps\geomoose2\htdocs\php\feature_report.php(100):
> mapObj->setExtent(0, 0, 0, 0)
> #1 {main}
> thrown in C:\ms4w\apps\geomoose2\htdocs\php\feature_report.php on
> line 100
>
>
> It might be a bug GeoMOOSE programming? What else I can do?
>
> ------------------------------------------------------------------------
> Date: Thu, 28 May 2015 10:22:53 -0600
> From: bfraser at geoanalytic.com
> To: nando_gcia at hotmail.com; geomoose-users at lists.osgeo.org
> Subject: Re: [Geomoose-users] Feature Report error with Identify Tool
>
> Fernanado,
>
> When Mapserver does the attribute query as requested by the GeoMOOSE
> feature_report.php, it applies a spatial filter based on the EXTENT
> stated in the map file and a filter on a unique key:
>
> Warning: layerObj :: queryByRect (): [MapServer Error]:
> msPostGISLayerWhichShapes (): Error executing query: ERROR: syntax
> error at or near "C2BN001"
> LINE 1: ... -1 362.227 362.227 -136 -1 -136 -1)) ', 3857) and (16C2BN001)
> ^
>
> It looks like it's having a problem with the unique key. You specified
>
> <Td> [dxf_text] <a
> href="javascript:GeoMOOSE.startService('feature_report',
> {'dxf_text':'[dxf_text]','src':'edificio_c2_espacios/C2-ALBERT_EINSTEIN'})">
> Report </ a> </ td>
>
> but you may want to try:
>
> <Td> [dxf_text] <a
> href="javascript:GeoMOOSE.startService('feature_report',
> {'gid':'[gid]','src':'edificio_c2_espacios/C2-ALBERT_EINSTEIN'})">
> Report </ a> </ td>
>
>
> Best Regards,
> Brent Fraser
> On 5/28/2015 4:10 AM, Fernando wrote:
>
> Brent, thank you for your replies but how can I georeference the
> building plan correctly ? Actually we don't need to have an real
> coordinate system, that does not matter in the project. We start
> from a DXF AutoCAD drawing and converted into shapefile with
> ArcTools and then import it to POSTGIS. To display online we
> decided to try GeoMOOSE.
>
> How do you think that would solve the error?
>
>
> 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
>
>
>
>
>
> _______________________________________________
> Geomoose-users mailing list
> 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/20150601/50adbad7/attachment-0001.html>
More information about the Geomoose-users
mailing list