[mapserver-users] postgres layer not visible
Jeff McKenna
jmckenna at gatewaygeomatics.com
Thu Jan 15 06:35:14 PST 2015
Hi Pasquale,
I always test my mapfile with the shp2img commandline utility
(http://mapserver.org/utilities/shp2img.html). An example command would be:
shp2img -m pmapper_demo.map -o ttt.png -map_debug 3
That utility is often a massive help to diagnosing problems with layers. :)
-jeff
--
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/
On 2015-01-15 9:58 AM, Maiorano Pasquale wrote:
> Dear Sirs,
>
> I followed a Youtube tutorial trying to show a couple of shape file
> previously save on postgres DB. I modified the pmapper_demo.map and the
> related config_xxx.xml. When a run the following page
> /http://localhost/pmapper/map_default.phtml?config=gabon/ nothing
> happens. I created the following folder
> /C:\ms4w\apps\pmapper\pmapper-4.3.2\config\gabon/ where I stored the
> /pmapper_demo.map/. In the dir config I stored the file
> /config_gabon.xml/. You can find hereinafter the file pmapper_demo.map:
>
> ################################################################################################
>
>
> # Adapt settings in map file <tt>pmapper_demo.map</tt> for the following
> tags to match settings
>
> # on your machine (see additionally MapServer documentation for detailed
> information):
>
> #
>
> # MAP
>
> # SHAPEPATH
>
> # FONTSET
>
> # SYMBOLSET
>
> #
>
> # WEB
>
> # IMAGEPATH
>
> # IMAGEURL
>
> #
>
> ##################################################################################################
>
> #
>
> # Start of map file
>
> #
>
> MAP
>
> EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125
>
> UNITS meters
>
> #EXTENT -15 30 40 70
>
> #UNITS dd
>
> SIZE 600 500
>
> SHAPEPATH "../../../pmapper_demodata"
>
> SYMBOLSET "../common/symbols/symbols-pmapper.sym"
>
> FONTSET "../common/fonts/msfontset.txt"
>
> RESOLUTION 96
>
> IMAGETYPE png
>
> INTERLACE OFF
>
> #CONFIG "PROJ_LIB" "C:/proj/nad/"
>
> PROJECTION
>
> "proj=tmerc"
>
> "lat_0=0"
>
> "lon_0=12"
>
> "k=0.9996"
>
> "x_0=500000"
>
> "y_0=500000"
>
> "datum=WGS84"
>
> "units=m"
>
> "no_defs"
>
> END # PROJECTION
>
> #
>
> # Start of web interface definition
>
> #
>
> WEB
>
> TEMPLATE "map.html"
>
> IMAGEPATH "/ms4w/tmp/ms_tmp/"
>
> IMAGEURL "/ms_tmp/"
>
> METADATA
>
> #"MAPFILE_ENCODING" "ISO-8859-1"
>
> #"ows_title" "WMS Demo Server"
>
> #"ows_onlineresource" "http://wms.yourserver.org?owskey=test&"
>
> #"ows_srs" "EPSG:3035 EPSG:4326"
>
> END # Metadata
>
> END # Web
>
> #
>
> # Start of Reference map definition
>
> #
>
> REFERENCE
>
> EXTENT 83684.2557031431 48040.09765625 455660.392391208 642189.8125
>
> IMAGE "../../images/gabon.png"
>
> SIZE 199 149
>
> COLOR -1 -1 -1
>
> OUTLINECOLOR 255 0 0
>
> END # Reference
>
> #
>
> # Start of legend object
>
> #
>
> LEGEND
>
> STATUS OFF
>
> IMAGECOLOR 255 255 255
>
> # OUTLINECOLOR 0 0 0
>
> POSITION ll
>
> KEYSIZE 18 12
>
> KEYSPACING 10 5
>
> TEMPLATE "void"
>
> LABEL
>
> TYPE TRUETYPE
>
> FONT "FreeSans"
>
> SIZE small
>
> POSITION AUTO
>
> COLOR 0 0 89
>
> OUTLINECOLOR 255 255 255
>
> ANTIALIAS TRUE
>
> END
>
> END
>
> #
>
> # Start of ScaleBar definition
>
> #
>
> SCALEBAR
>
> STATUS off
>
> TRANSPARENT off
>
> INTERVALS 4
>
> SIZE 200 3
>
> UNITS kilometers
>
> COLOR 250 250 250
>
> OUTLINECOLOR 0 0 0
>
> BACKGROUNDCOLOR 100 100 100
>
> STYLE 0
>
> POSTLABELCACHE true
>
> LABEL
>
> COLOR 0 0 90
>
> #OUTLINECOLOR 200 200 200
>
> SIZE small
>
> END # Label
>
> END # Reference
>
> # SYMBOLS USED IN PMAPPER
>
> # - 'circle' always necessary (used e.g. for highlight)
>
> # - 'square' used in currecnt map file
>
> # Symbols can also be defined via tag SYMBOLSET (see above)
>
> Symbol
>
> Name 'circle'
>
> Type ELLIPSE
>
> Filled TRUE
>
> Points
>
> 1 1
>
> END
>
> END
>
> Symbol
>
> Name 'square'
>
> Type VECTOR
>
> Filled TRUE
>
> Points
>
> 0 1
>
> 0 0
>
> 1 0
>
> 1 1
>
> 0 1
>
> END
>
> END
>
> #================== START OF LAYER SECTION =====================#
>
> LAYER
>
> CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres'
> password='nicoletta' sslmode=disable"
>
> CONNECTIONTYPE POSTGIS
>
> DATA 'the_geom FROM "gabon_coastline_riproiettato" USING UNIQUE GID
> USING SRID=5223'
>
> EXTENT 131038.078125 48040.09765625 433953.28125 642189.8125
>
> METADATA
>
> "ows_title" "gabon_coastline_riproiettato"
>
> END # METADATA
>
> NAME "gabon_coastline_riproiettato"
>
> PROJECTION
>
> "proj=tmerc"
>
> "lat_0=0"
>
> "lon_0=12"
>
> "k=0.9996"
>
> "x_0=500000"
>
> "y_0=500000"
>
> "datum=WGS84"
>
> "units=m"
>
> "no_defs"
>
> END # PROJECTION
>
> STATUS ON
>
> TILEITEM "location"
>
> TYPE LINE
>
> UNITS METERS
>
> CLASS
>
> NAME "gabon_coastline_riproiettato"
>
> STYLE
>
> COLOR 121 8 226
>
> WIDTH 1
>
> END # STYLE
>
> END # CLASS
>
> END # LAYER
>
> LAYER
>
> CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres'
> password='nicoletta' sslmode=disable"
>
> CONNECTIONTYPE POSTGIS
>
> DATA 'the_geom FROM "public"."Fiumi_riproiettato" USING UNIQUE gid
> USING UNIQUE 5223'
>
> EXTENT 150981.730577697 166673.281916046 346296.768620565 389978.665308564
>
> METADATA
>
> "ows_title" "Fiumi_riproiettato"
>
> END # METADATA
>
> NAME "Fiumi_riproiettato"
>
> PROJECTION
>
> "proj=tmerc"
>
> "lat_0=0"
>
> "lon_0=12"
>
> "k=0.9996"
>
> "x_0=500000"
>
> "y_0=500000"
>
> "datum=WGS84"
>
> "units=m"
>
> "no_defs"
>
> END # PROJECTION
>
> STATUS ON
>
> TILEITEM "location"
>
> TYPE LINE
>
> UNITS METERS
>
> CLASS
>
> NAME "Fiumi_riproiettato"
>
> STYLE
>
> COLOR 62 186 93
>
> WIDTH 1
>
> END # STYLE
>
> END # CLASS
>
> END # LAYER
>
> LAYER
>
> CONNECTION "dbname='gabon' host=localhost port=5432 user='postgres'
> password='nicoletta' sslmode=disable"
>
> CONNECTIONTYPE POSTGIS
>
> DATA 'the_geom FROM "public"."Confini_Gabon_SR_GabonTM" USING
> UNIQUE gid USING UNIQUE 5223'
>
> EXTENT 128874.546875 56689.61328125 781735.125 760206.0625
>
> METADATA
>
> "ows_title" "Confini_Gabon_SR_GabonTM"
>
> END # METADATA
>
> NAME "Confini_Gabon_SR_GabonTM"
>
> PROJECTION
>
> "proj=tmerc"
>
> "lat_0=0"
>
> "lon_0=12"
>
> "k=0.9996"
>
> "x_0=500000"
>
> "y_0=500000"
>
> "datum=WGS84"
>
> "units=m"
>
> "no_defs"
>
> END # PROJECTION
>
> STATUS OFF
>
> TILEITEM "location"
>
> TYPE POLYGON
>
> UNITS METERS
>
> CLASS
>
> NAME "Confini_Gabon_SR_GabonTM"
>
> STYLE
>
> COLOR 133 45 126
>
> OUTLINECOLOR 0 0 0
>
> WIDTH 1
>
> END # STYLE
>
> END # CLASS
>
> END # LAYER
>
> END #Map
>
> Have you got any ideas where I am wrong?
>
> Any advice will be appreciated.
>
> Pasquale Maiorano
>
>
>
More information about the MapServer-users
mailing list