[Geomoose-users] Identify tool not work in Postgis layers
Fernando
nando_gcia at hotmail.com
Tue May 26 00:07:09 PDT 2015
Hello, I have installed on a Windows PC, MS4W - MapServer 4 Windows version 3.0.4, PHP 5.3.10, CGI MapServer 6.0.2, Apache 2.2.21, PostgreSQL 9.4, PostGIS 2.1 and GeoMOOSE 2.7.1.
Postgis layers displayed correctly but doesn't work the Identify tool. I read all the documentation and I can not figure out what fails. I modified the example of "parcels" that brings GeoMOOSE to guide me.
My configs are the folowing:
mapbook Describing the query and the select services:
<map-source name="edificio_c2_espacios" type="mapserver">
<file>./c2_postgis.map</file>
<layer name="C2-ALBERT_EINSTEIN" status="on"/>
<param name="FORMAT" value="image/png; mode=8bit"/>
<param name="TRANSPARENT" value="true"/>
</map-source>
<service name="identify" title="Identify" display="true" display-submit="false" clear-highlight="true">
<url>php/identify.php</url>
<step type="spatial" name="shape" line="false" polygon="false" jump-start="true" default="point" box="true" pan="false">
<header>
Click on the map to see more detailed information.
</header>
<!--
Uncomment this line to test "hidden" layers working with identify. This will
leave the layers listed here always identified despite their visibility.
<input type="hidden" name="hidden_layers" value="edificio_c2_espacios/C2-ALBERT_EINSTEIN"/>
-->
<input type="visiblelayers" name="layers"/>
<input type="projection" name="projection"/>
</step>
</service>
<catalog>
<group title="PLANOS DISTRIBUCIÓN" expand="true">
<layer title="ESPACIOS" src="edificio_c2_espacios/C2-ALBERT_EINSTEIN" metadata="true" legend="true" tip="Plano C2" show-legend="true" popups="true" fade="true" unfade="true">
<metadata>http://www.geomoose.org/docs/</metadata>
</layer>
</group>
</catalog>
------------------------------------------------------------------------------------------------------------------------
Map file "edificio_c2.map" of the postgis layer in C:\ms4w\apps\geomoose2\maps
MAP
NAME EDIFICIO_C2_MAP
STATUS ON
SIZE 800 800
EXTENT -136 -1 227 362
UNITS METERS
INCLUDE "./geomoose_globals.map"
IMAGECOLOR 255 255 255
IMAGETYPE PNG
SYMBOLSET "./symbols/symbol.sym"
FONTSET "./fonts/fontset.list"
TRANSPARENT FALSE
RESOLUTION 100
DEFRESOLUTION 100
OUTPUTFORMAT
NAME png
DRIVER "AGG/PNG"
MIMETYPE "image/png"
IMAGEMODE PC256
EXTENSION "png"
FORMATOPTION "GAMMA=0.75"
END
WEB
IMAGEPATH "/ms4w/tmp/ms_tmp/"
IMAGEURL "/ms_tmp/"
METADATA
"wms_title" "WMS EDIFICIO C2"
"wms_abstract" "SERVIDOR WMS C2"
"wms_onlineresource" "http://localhost/cgi-bin/mapserv?map=/ms4w/apps/geomoose2/maps/c2_postgis.map"
"wms_srs" "epsg:3857"
"wms_enable_request" "*" #necessary
"wms_feature_info_mime_type" "text/html"
END
END
QUERYMAP
STATUS ON
STYLE HILITE
COLOR 255 255 0
END
PROJECTION
"init=epsg:3857"
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=3857"
GROUP "C2-ALBERT_EINSTEIN"
NAME "C2-ALBERT_EINSTEIN"
METADATA
"DESCRIPTION" "ESPACIOS POLIGONADOS"
"GROUP" "C2-DISTRIBUCION"
"LAYER" "C2-ALBERT_EINSTEIN"
"TRANSPORTATION" "TRUE"
"RESULT_FIELDS" "dxf_text,area,perimeter,tipo_ubica,tipo_uso,contenido"
"RESULT_HEADERS" "IDENTIFICADOR, SUPERFICIE (m2), PERIMETRO (m), TIPO UBICACION, TIPO USO, DESCRIPCION"
"SPATIALSEARCH" "dxf_text"
"SPATIALSEARCHLIST" "dxf_text,area,perimeter"
"wms_group_title" "C2-DISTRIBUCION"
"wms_title" "Plano con filtro C2 ALBER EINSTEIN"
"wms_name" "C2-ALBERT_EINSTEIN"
"wms_format" "image/png"
"wms_abstract" "C2 ALBERT EINSTEIN - Plano"
"wms_srs" "epsg:3857"
"wms_enable_request" "*"
"wms_server_version" "1.1.1"
"wms_extent" "-136 -1 227 362"
"gml_include_items" "all"
"wms_include_items" "all"
# drill-down identify service record.
'identify_record' './templates/identify.html'
# query.php / "Search Parcels" functionality.
'itemquery' 'templates/search_result.html'
'itemquery-filter' '/.*[qstring].*/i'
'qstring_validation_pattern' '.'
# Feature reports are stored in the conf/feature_report directory.
'feature_report' 'parcel.xml'
'select_record' 'templates/select_result.html'
'select_header' 'templates/select_header.html'
'popups' 'parcels_popup.html'
END
VALIDATION
# %filtro% subtituciones sólo pueden tener letras minúsculas, mayúsculas y números
'filtro' '^[a-zA-Z0-9]+'
END
STATUS ON
TYPE POLYGON
CLASSITEM 'dxf_text'
CLASS
NAME "UBICACIONES"
STYLE
COLOR 235 235 235
OUTLINECOLOR 100 100 100
END
LABEL
FONT "vera_sans"
TYPE truetype
SIZE 7
ALIGN CENTER
COLOR 0 0 0
OUTLINECOLOR 255 255 128
FORCE TRUE
PARTIALS FALSE
POSITION AUTO
MAXSCALEDENOM 600
WRAP ':'
END
TEXT ('[dxf_text]' + ':' + '[tipo_ubica]')
END # end class
TOLERANCE 0
TOLERANCEUNITS PIXELS
TEMPLATE "building_popup.html"
PROJECTION
"init=epsg:3857"
END
END
END ## end Map
---------------------------------------------------------------------------------------------------------------
My postgis table:
CREATE TABLE c2_shape
(
gid serial NOT NULL,
area numeric,
perimeter numeric,
cover_ double precision,
cover_id double precision,
dxf_layer character varying(31),
dxf_color smallint,
dxf_thickn double precision,
dxf_type character varying(10),
dxf_elevat double precision,
dxf_handle character varying(16),
dxf_angle double precision,
dxf_size double precision,
dxf_text character varying(40),
dxf_attrib character varying(16),
dxf_iid double precision,
contenido character varying(254),
departamen character varying(254),
area_depto character varying(254),
tipo_ubica character varying(254),
tipo_uso character varying(254),
profesor character varying(254),
pas character varying(254),
investigac character varying(254),
docente character varying(254),
practica character varying(254),
otros character varying(254),
the_geom geometry(MultiPolygon,3857),
CONSTRAINT c2_shape_pkey PRIMARY KEY (gid)
)
WITH (
OIDS=FALSE
);
ALTER TABLE c2_shape
OWNER TO postgres;
-- Index: c2_shape_the_geom_idx
-- DROP INDEX c2_shape_the_geom_idx;
CREATE INDEX c2_shape_the_geom_idx
ON c2_shape
USING gist
(the_geom);
---------------------------------------------------------------------------------------------------------------
File "parcels_popup.html" in C:\ms4w\apps\geomoose2\maps
<!-- MapServer Template -->
<div>
<b>Identificador:</b> [dxf_text]<br/>
<b>Contenido:</b> [contenido]<br/>
<br/>
<a href="javascript:GeoMOOSE.startService('feature_report', {'src' : 'edificio_c2_espacios/C2-ALBERT_EINSTEIN', 'dxf_text' : '[dxf_text]'});">View Parcel Report</a>
</div>
---------------------------------------------------------------------------------------------------------------
Here are the files that i have in the templates folder -> C:\ms4w\apps\geomoose2\maps\templates, modified to my postgis layer
identify.html
<!-- MapServer Template -->
<tr bgcolor="#DEE5EB"><td colspan="2"><b><u>ESPACIOS</u></b></tr>
<tr>
<td align="right"><b>IDENTIFICADOR:</b></td>
<td>[dxf_text]</td>
</tr>
<tr>
<td align="right"><b>CONTENIDO:</b></td>
<td>[contenido]</td>
</tr>
identify.map
<!-- MapServer Template -->
<a id="[dxf_text]" class='sprite-control sprite-control-find-selected' style="padding-left: 22px" parcel-shape="[shpxy]" href="javascript:GeoMOOSE.zoomToPointsList(dojo.byId('[dxf_text]').getAttribute('dxf_text'), 'EPSG:3857');">[dxf_text]</a><br/>
[contenido]<br/>
<br/>
search_result.html
<!-- MapServer Template -->
<b>Identificador:</b> <a data-pin="[dxf_text]" id="gm-parcel-[dxf_text]" class='sprite-control sprite-control-find-selected' style="padding-left: 22px" parcel-shape="[shpxy]" href="javascript:GeoMOOSE.zoomToPointsList(dojo.byId('[dxf_text]').getAttribute('parcel-shape'), 'EPSG:3857');">[dxf_text]</a><br/>
<b>Contenido:</b> [contenido]<br/>
<hr/>
search_header.html
<!-- MapServer Template -->
<a target="_blank" href="php/mailing_labels.php?queryid=[QUERYID]&output=pdf">PDF Mailing Labels</a><br/>
<a target="_blank" href="php/mailing_labels.php?queryid=[QUERYID]&output=html">HTML Mailing Labels</a><br/>
<a target="_blank" href="php/mailing_labels.php?queryid=[QUERYID]&output=csv">CSV Mailing Labels</a><br/>
<br/>
<div style="display: [SHOW_FOLLOWUP]"/>
<a href="javascript:GeoMOOSE.startService('buffered_select_followup', {shape: '[SHAPE_WKT]', select_layer: '[SELECT_LAYER]', query_layer: '[SELECT_LAYER]', selection_buffer: [SELECTION_BUFFER]})">Buffer these results</a>
<br/><br/>
</div>
select_result.html
<!-- MapServer Template -->
<table>
<tr>
<td><b>IDENTIFICADOR:</b></td><td>[dxf_text]</td>
</tr>
<tr>
<td><b>Contenido:</b></td>
<td>[contenido]</td>
</tr>
</table>
When I use the "Identify" tool, the result is always the same, only the ground coordinates of the point is displayed but does not display information postgis layer. For example:
Detailed information for the area you clicked on the map ...
Ground Coordinates
X: 108.95263671875
Y: 300.091796875
Disclaimer: This information is distributed as Being demonstation data only. You should not use the data for any other purposes.
Can anyone please help me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geomoose-users/attachments/20150526/4f09828d/attachment-0001.html>
More information about the Geomoose-users
mailing list