samtux
5/22/2014 - 7:39 PM

Mapserver Cluster WFS

Mapserver Cluster WFS

MAP
    FONTSET "fonts.txt"                       
    EXTENT -180 -90 180 90
    IMAGETYPE "png"
    NAME "Aglomerado"
    SIZE 800 600
    STATUS ON
    DEBUG TRUE
    #CONFIG "MS_ERRORFILE" "/var/www/tmp/ms_error.txt"
    UNITS DD

    ######################################  Formatos de salida                               
    OUTPUTFORMAT
        NAME "png"
        MIMETYPE "image/png"
        DRIVER "AGG/PNG"
        EXTENSION "png"
        IMAGEMODE RGB
        TRANSPARENT TRUE
    END # OUTPUTFORMAT                       

    OUTPUTFORMAT
        NAME "png8"
        DRIVER AGG/PNG8
		MIMETYPE "image/png8"
        IMAGEMODE RGB
        EXTENSION "png"
        FORMATOPTION "QUANTIZE_FORCE=on"
        FORMATOPTION "QUANTIZE_COLORS=256"
        FORMATOPTION "GAMMA=0.75"
    END

    OUTPUTFORMAT
        NAME "jpeg"
        DRIVER AGG/JPEG
        MIMETYPE "image/jpeg"
	IMAGEMODE RGB
        EXTENSION "jpg"
        FORMATOPTION "GAMMA=0.75"
    END

    ##########################################  Proyeccion del proyecto                                                                                                                                                                      
    PROJECTION
        "init=epsg:4326"
    END # PROJECTION                      
        
    # Definicion de los simbolos
	SYMBOL
	    NAME "circle"
	    TYPE ellipse 
        POINTS
			1 1
		END # POINTS	
		FILLED true
		ANCHORPOINT 0.5 0.5
	END # SYMBOL
                                                                                                                                                            
    LEGEND
        KEYSIZE 20 10
        KEYSPACING 5 5
        LABEL
            SIZE MEDIUM
            OFFSET 0 0
            SHADOWSIZE 1 1
            TYPE BITMAP
        END # LABEL                             
        STATUS OFF
    END # LEGEND

    ############################################  Inicio de la interfaz Web
 
    WEB
		IMAGEPATH "/var/www/tmp/"
        IMAGEURL "/tmp/"
        METADATA
            "ows_title"                            "Universidad Distrital Francisco Jose de Caldas"
            "ows_onlineresource"  				   "http://localhost/cgi-bin/mapserv?map=/var/www/mapfile/demo_wfs.map"
            "ows_enable_request"                   "*"
            "ows_srs"                              "EPSG:4326"
            "ows_feature_info_mime_type"           "text/html"
            "ows_format"                           "image/png"
            "ows_abstract"                         "Demo WFS"
            "ows_keywordlist"                      "wfs, cluster"
            "ows_accessconstraints"                "Ninguno"
            "ows_addresstype"                      ""
            "ows_address"                          ""
            "ows_city"                             "Bogota"
            "ows_stateorprovince"                  "Bogota D.C"
            "ows_postcode"                         "11011"
            "ows_country"                          "Colombia"
            "ows_contactelectronicmailaddress"     ""
            "ows_contactperson"                    "Samuel Mesa"
            "ows_contactorganization"              "Universidad Distrital Francisco Jose de Caldas"
            "ows_contactposition"                  "Administrador"
            "ows_fees"                             "Ninguno"
            "ows_sld_enabled"                      "true"
        END # Metadata       
    END # WEB                

	##########################################################################################################
	#                        CAPAS DEL SERVICIO
	##########################################################################################################


	LAYER
		NAME "capital_wfs"
		TYPE POINT
		STATUS ON
		CONNECTION "http://demo.mapserver.org/cgi-bin/wfs?TYPENAME=cities"
		CONNECTIONTYPE WFS
		EXTENT -180 -90 180 90
		METADATA
		    "wfs_typename"          "cities"
		    "wfs_version"           "1.0.0"
		    "wfs_connectiontimeout" "80"
		    "wfs_request_method"    "GET"
		    #"wfs_maxfeatures"       "1000"   
		    "ows_tile"              "capitales WFS"
		    "ows_enable_request"    "*"
            "ows_abstract"          "Capitales del mundo WFS"
	    END
		PROJECTION
			"init=epsg:4326"
		END
		#CLUSTER
		#    MAXDISTANCE 20
		#    REGION "elipse"
	    #END # CLUSTER          
		#LABELITEM "Cluster:FeatureCount"
		#CLASSITEM "Cluster:FeatureCount"
		# Rango 1    
		CLASS
			NAME "Cluster 1 a 5"
			#EXPRESSION ("[Cluster:FeatureCount]" IN "1,2,3,4,5")
			STYLE
				SIZE 6
				SYMBOL "circle"
				COLOR 250 159 181
			END # STYLE
		END # CLASS   
    END # Layer

	LAYER
		NAME "capital_gml"
		TYPE POINT
		STATUS ON
		CONNECTION "http://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=cities"
		CONNECTIONTYPE OGR
		EXTENT -180 -90 180 90
		METADATA
		    "wfs_typename"          "cities"
		    "wfs_version"           "1.0.0"
		    "wfs_connectiontimeout" "80"
		    "wfs_request_method"    "GET"
		    #"wfs_maxfeatures"       "1000"   
		    "ows_tile"              "capitales GML"
		    "ows_enable_request"    "*"
            "ows_abstract"          "Capitales del mundo GML"
	    END
		PROJECTION
			"init=epsg:4326"
		END
		CLUSTER
		    MAXDISTANCE 20
		    REGION "elipse"
	    END # CLUSTER          
		LABELITEM "Cluster:FeatureCount"
		CLASSITEM "Cluster:FeatureCount"
		# Rango 1    
		CLASS
			NAME "Cluster 1 a 5"
			EXPRESSION ("[Cluster:FeatureCount]" IN "1,2,3,4,5")
			STYLE
				SIZE 7
				SYMBOL "circle"
				COLOR 253 141 60
			END # STYLE
		END # CLASS
		CLASS
			NAME "Cluster 5 a 10"
			EXPRESSION ("[Cluster:FeatureCount]" IN "6,7,8,9,10")
			STYLE
				SIZE 10
				SYMBOL "circle"
				COLOR 252 78 42
			END # STYLE
			LABEL
				FONT arial
				TYPE TRUETYPE
				SIZE 7
				COLOR 255 255 255
				ALIGN CENTER
				PRIORITY 10
				BUFFER 1
				PARTIALS TRUE
				POSITION cc
			END
		END # CLASS
		CLASS
			NAME "Cluster 10 a 20"
			EXPRESSION ("[Cluster:FeatureCount]" IN "10,11,12,13,14,15,16,17,18,19,20")
			STYLE
				SIZE 14
				SYMBOL "circle"
				COLOR 227 26 28
			END # STYLE
			LABEL
				FONT arial
				TYPE TRUETYPE
				SIZE 7
				COLOR 255 255 255
				ALIGN CENTER
				PRIORITY 10
				BUFFER 1
				PARTIALS TRUE
				POSITION cc
			END
		END # CLASS
		CLASS
			NAME "Cluster > 20"
			EXPRESSION ("[Cluster:FeatureCount]" > "20")
			STYLE
				SIZE 18
				SYMBOL "circle"
				COLOR 177 0 38
			END # STYLE
			LABEL
				FONT arial
				TYPE TRUETYPE
				SIZE 7
				COLOR 255 255 255
				ALIGN CENTER
				PRIORITY 10
				BUFFER 1
				PARTIALS TRUE
				POSITION cc
			END
		END # CLASS
    END # Layer

END # MAP