[mapserver-users] postgres layer not visible

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Jan 15 07:02:34 PST 2015


Hi,

This is another reported issue with a pmapper demo, kassandraxx had similar troubles yesterday. Is there some workshop going on, I do not remember any mails about pmapper since many years.

Kassandraxx sent the following report which seems to mean that MapServer is using a deprecated function name "GeomFromText" while recent PostGIS supports only "ST_GeomFromText".



shp2img -m pmapper_demo.map -o test.png
msDrawMap(): Image handling error. Failed to draw layer named 'Ager Firmanus'. <br>
msPostGISLayerWhichShapes(): Query error. Error (ERROR:  function
geomfromtext(u                              nknown, integer) does not exist
LINE 1: ...geom,"gid" from "ager_firmanus" where the_geom && GeomFromTe...
                                                             ^
HINT:  No function matches the given name and argument types. You might need
to                               add explicit type casts.
) executing query: select
encode(ST_AsBinary(ST_Force_2D("the_geom"),'NDR'),'hex                             
') as geom,"gid" from "ager_firmanus" where the_geom &&
GeomFromText('POLYGON((2                              52691.191155437
4727437.25648659,252691.191155437 4871219.56915799,425287.594538                             
208 4871219.56915799,425287.594538208 4727437.25648659,252691.191155437
4727437.                              25648659))',32633) <br>


We should know these things at least:

- Which MapServer version is used?
- Where is that pmapper demo?
- Who made and maintains it?
- When it has last time proved to work?

We would also need badly new good Mapserver tutorials and  samples and I apologize that I have not been helping with making such even I have had some plans for that.

-Jukka Rahkonen-



Jeff McKenna wrote:

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
>
>
>


_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list