Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to make an popup InfoTool in OpenLayers with a Mapserver file. Everything is working fine now. But when I click on the map I gives a double output. So I get for instance: cityname, citycode, cityname, citycode

I cannot find the problem. I think it has something to do with the mapfile.

MAP # start ************************************

NAME "bag"
EXTENT 6180 300854 287160 629230
STATUS ON
DEBUG ON
UNITS METERS
CONFIG "MS_ERRORFILE" "mapserv.log"
CONFIG "PROJ_LIB" "c:\proj\nad\"
TRANSPARENT ON
SYMBOLSET "symbols\agnsymbols.sym"  
FONTSET "fonts\fonts.list"

PROJECTION
    "init=epsg:28992"
    "ellps=bessel"
END

WEB
    IMAGEPATH "\tmp"
    IMAGEURL "\tmp\\"
    #TEMPLATE "template\woonplaats.html"
    METADATA
        WMS_TITLE "Geoserver.nl BAG service"
        WMS_ABSTRACT "Geoserver.nl BAG service"
        WMS_ACCESSCONSTRAINTS "none"
        WMS_ONLINERESOURCE "http://geo.nl/bag/mapserv.cgi?map=test_stefan.map&service=wms"
        WMS_SRS "EPSG:28992"
        #WMS_ENABLE_REQUEST "*"
        #OWS_SCHEMAS_LOCATION "http://ogc.dmsolutions.ca"
        WMS_FEATURE_INFO_MIME_TYPE "text/html"
    END
END

OUTPUTFORMAT
    NAME png
    DRIVER AGG/PNG
    MIMETYPE image/png
    IMAGEMODE RGB
END 

# Start of LAYER DEFINITIONS ---
# Woonplaats layer ---
LAYER
    NAME "Woonplaats"
    CONNECTION "user=user password=password dbname=dbname host=localhost port=5432"
    CONNECTIONTYPE postgis
    DATA 'geometrie from agn.woonplaats using unique wnpcode using srid=28992'
    METADATA
        WMS_TITLE "Woonplaats"
        WMS_ABSTRACT "Woonplaats"
        #GML_INCLUDE_ITEMS "all"
        #WMS_INCLUDE_ITEMS "all"
        #OWS_INCLUDE_ITEMS "all"
        RESULT_FIELD "woonplaats" 
    END
    PROJECTION
        "init=epsg:28992"
    END
    EXTENT 6180 300854 287160 629230
    STATUS ON
    DUMP TRUE
    TYPE POLYGON
    UNITS METERS
    SIZEUNITS PIXELS
    TOLERANCE 0
    TOLERANCEUNITS PIXELS
    TEMPLATE "template\woonplaats.html"
    CLASS
        MAXSCALEDENOM 200000
        STYLE
            OUTLINECOLOR 61 61 61
            WIDTH 4
        END
        STYLE
            OUTLINECOLOR 161 161 161
            WIDTH 2
        END
    END
    CLASS
        MINSCALEDENOM 200000
        STYLE
            OUTLINECOLOR 61 61 61
            WIDTH 1
        END
    END
END

END # End of Mapfile

The template file is as follows:

<!-- MapServer Template -->
 <tr>
       <td>Woonplaats</td>
       <td>[item name=woonplaats format=$value escape=none]</td>
       <td>[item name=wnpcode format=$value escape=none]</td>
     </tr>

Hope someone can give me some more insight

share|improve this question
2  
It might be helpful to see the exact GetFeatureInfo request made (perhaps the layer is mentioned twice?) and you should also confirm that the features are not in fact doubled in the postgis table. –  Frank Warmerdam Oct 18 '12 at 22:07
    
It would also be potentially useful to see the layers in your mapfile too. –  DavidF Oct 19 '12 at 1:03
    
@ Frank: Thanks. The features are indeed doubled in the postgis table. I did check this before, but was looking at the wrong database. So this question is answered :) –  Stefan Oct 22 '12 at 9:59

1 Answer 1

up vote 0 down vote accepted

This question is answered by Frank. The features were doubled in the postgis table.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.