[mapserver-users] Build Errors; Currently "msLoadMap(): Unknown identifier. First token must be MAP, this doesn't look like a mapfile. "

Richard Marsden winwaed at gmail.com
Wed Nov 18 23:06:17 EST 2009


Hello,

I have been using MapServer for about 18 months to serve the base maps for
EcoMapCostaRica.com, and more recently, equal-area-maps.com.
Originally, I had a lot of trouble building it for the FreeBSD environment
used by my web host (Pair Networks), but a fellow user (Jason Birch) was
able to help. I believe this was MapServer 5.2, but could be wrong.

In the past week, Pair upgraded the version of FreeBSD/etc on my server, and
not-unexpectedly this broke MapServer.
I've had more success than last time, and I've managed to re-build
MapServer. My build was based on Jason's original instructions, but library
& MapServer versions were bumped to their latest (5.4.2 for MapServer). I
also configured GDAL to use the internal implementations of libtiff and
GeoTIFF, and I skipped PHP  (I don't use PHP MapScript).

Although it built, the two map applications (both based on OpenLayers) are
displaying white tiles instead of their correct MapServer-rendered maps.
I've tried a few things, including trying to use 24 bit AGG-derived images
(interestingly this results in slower display, implying that some of
MapServer's rendering is working? just it isn't displaying anything?).

I wasn't making much progress getting these completed applications to work,
so I thought I would go 'back to basics' and try to get a simple Hello World
to work. I've just re-entered the Hello World from Bill Kropla's "Beginning
MapServer" book. The resulting hello.map and hello.html are included below.
Needless to say, these are not working. I am getting the strange error of:

msLoadMap(): Unknown identifier. First token must be MAP, this doesn't look
like a mapfile.

What is wrong? I can't see anything wrong in my MAP file, unless something
fundamental has changed in the past couple of versions?  Inserting a new
line at the beginning with a "MAP" simply results in a parsing error on line
1!
Is there something to look for in my build process?  I can post the
MapServer config if that will help.

Here is my Hello World HTML:  ( http://www.winwaed.com/playpen/hello.html )

<html>
<head><title>MapServer Hello World</title></head>
<body>
<form method="POST" action="/playpen/mapserv.cgi">
  <input type="submit" value="Click Me">
  <input type="hidden" name="MAP" value="/myhomedir/playpen/hello.map">
  <input type="hidden" name="map_web_imagepath"
value="/myhomedir/playpen/tmp/">
</form>
<img src="[img]" width=400 height=300 border=0>
</body>
</html>


And here is my hello.map file:  ( /playpen/hello.map )

NAME "Hello_World"
SIZE 400 300
IMAGECOLOR 249 245 186
IMAGETYPE png
EXTENT -1.00 -1.00 1.00 1.00
WEB
  TEMPLATE "/myhomedir/playpen/hello.html"
  IMAGEPATH "/myhomedir/playpen/tmp/"
  IMAGEURL "/playpen/tmp/"
END
LAYER
  STATUS default
  TYPE point
  FEATURE
     POINTS 0.0 0.0 END
     TEXT "Hello World"
  END
  CLASS
     STYLE
        COLOR 255 0 0
     END
     LABEL
        TYPE bitmap
     END
  END
END
END



Fundamentally I am trying to get MapServer working on a Pair server
installation (FreeBSD, etc), serving WMS tiles to OpenLayers "MapServer"
layer objects. Source data are Shape files and GeoTIFF tiles. Image delivery
is currently in the form of PNG, which is preferred over JPEG (too lossy)
and GIF (okay for the shapefiles, but not the GeoTIFF-derived imagery).


Hopefully someone has some clues as to what is wrong with the Hello World?
If I can get this to work, it should give me some clues (or even fix) the
main problems I'm having with my applications.


Cheers,

Richard Marsden
http://www.winwaed.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091118/fc7efdd3/attachment-0001.html


More information about the mapserver-users mailing list