0

I'm trying to use this mapfile that I made:

MAP
  IMAGETYPE PNG
  EXTENT -90.000124 41.000032 -88.000044 42.000035
  SIZE 1600 800
  IMAGECOLOR 255 0 1 

OUTPUTFORMAT
  NAME png
  DRIVER AGG/PNG
  MIMETYPE "image/png"
  IMAGEMODE RGBA
  EXTENSION "png"
  FORMATOPTION "GAMMA=0.75"
 TRANSPARENT ON
END

LAYER
  NAME poly
  STATUS OFF
  TYPE POLYGON
  CONNECTIONTYPE POSTGIS
  CONNECTION "host=127.0.0.1 dbname=matt user=postgres password=postgres"
  DATA "the_geom from g41088"
  OPACITY 50
    CLASS
      NAME g41088P
        STYLE
          COLOR 200 200 200 
          OUTLINECOLOR 0 0 0
        END
    END
END

#LAYER
#  NAME line
#  STATUS OFF
#  TYPE LINE
#  CONNECTIONTYPE POSTGIS
#  CONNECTION "host=127.0.0.1 dbname=matt user=postgres password=postgres"
#  DATA "the_geom from g41088"
#   CLASS
#     NAME g41088L
#       STYLE
#         COLOR 0 0 0 
#       END
#   END
#END
END

But it only works when I have the second layer commented out. I can't figure out for the life of me what's wrong with it. I'm trying to do the same thing that this tutorial is doing, but with PostGis support.

2 Answers 2

3

your

NAME line

is probably causing the error, as "line" is a reserved mapfile keyword. Try with

NAME "line"

As a rule of thumb, you should always quote strings in a mapfile, even though the parser does allow strings that are not a reserved keyword to be left unquoted.

0

Perhaps you need to define the projection there or in the WEB section. Also it could be related to the mapserver executable, probably it's not located in the cgi-bin directory, so this isn't accessible in your HTML code. Try these links, especially the getCapabilities to see what error messages you get:

http://lists.maptools.org/pipermail/ms4w-users/2010-May/001541.html http://www.postgresql.org/message-id/[email protected] http://osgeo-org.1560.x6.nabble.com/still-have-problem-when-add-postgis-layer-on-mapserver-mapfile-td4997860.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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