[mapserver-users] some help on basic template (a beginner question)

Antonio Rodríguez antonio.raju at gmail.com
Fri May 25 02:04:26 PDT 2012


Hi,

I've been following the beginners tutorial and after searching the
archives (probably not so extensively) I couldn't find what I'm doing
wrong. I had arrived just at example1-9 and I can't find the way to
match my file.map to my index.html. The webserver is working fine. I'm
able to execute my file.map but when I try to visualise and execute a
personal version of example1-9 I always got stuck at this point:

msLoadMap(): Regular expression error. MS_DEFAULT_MAPFILE_PATTERN
validation failed. msEvalRegex(): Regular expression error. String
failed expression test.

My computer and files configuration are :

/etc/apache2/sites-available/default

<VirtualHost *:80>
	ServerAdmin webmaster at localhost
	ServerName cordillera
	DocumentRoot /home/admin-root/cordillera

 (rest omitted)
--------------------------------------------------------------------------------------------------------------------------------------------

/etc/hosts

127.0.0.1	cordillera
---------------------------------------------------------------------------------------------------------------------------------------------

File structure:

/home/admin-root/cordillera
			/datos_mapserver (.shp and .tiff files)
			/tmp
			    /ms_tmp
			index.html
			lagos_rios_dem.map

--------------------------------------------------------------------------------------------------------------------------------------------
cat index.html (is just a modification of example1-9.html)

<!--mapserver template-->
<html>
  <head>
    <title>MapServer Cordillera</title>

  </head>
  <body bgcolor="#FFFFFF">

    <center><h2>MapServer Cordillera Application (ms v5.4)</h2></center>
    <p><hr><p>
    <!-- START OF MAPSERVER FORM -->
        <form name="mapserv" method="GET" action="/cgi-bin/mapserv">
          <!-- HIDDEN MAPSERVER CGI VARIABLES -->
          <input type="hidden" name="map" value="[map]">
          <input type="hidden" name="imgext" value="[mapext]">
          <input type="hidden" name="imgxy" value="[center]">
	  <input type="hidden" name="zoom" value="0">
	  <input type="hidden" name="layer" value="relieve">
	  <input type="hidden" name="layer" value="aster-dem">
	  <input type="hidden" name="mode" value="browse">
	  <div align="center">
	    <table border="1" cellpadding="0" cellspacing="0">
	      <tr>
                <td>
		  <!-- THE INTERACTIVE, DYNAMICALLY CREATED MAP -->
		  <input type="image" name="img" src="[img]"
                    width="400" height="300">
		</td>
              </tr>
	    </table>
	  </div>
	</form>
        <!-- END OF MAPSERVER FORM -->
 </form>

    <p><hr>
    <table width="100%"><tr><td align="right">This site running
MapServer v. 5.4</td></tr></table>
  </body>
</html>
--------------------------------------------------------------------------------------------------------------------------------------------

cat lagos_rios_dem.map

MAP
  IMAGETYPE      PNG24
  EXTENT         -78 -10.5 -76.4 -8.25
  SIZE          700 1000
  SHAPEPATH      "datos_mapserver"
  IMAGECOLOR     255 255 255

WEB
   TEMPLATE  'index.html'
   IMAGEPATH '/home/admin-root/cordillera/tmp/ms_tmp'
   IMAGEURL  '/ms_tmp/'
END

LAYER

	NAME	relieve
	DATA	"mapa_de_relieve"
	STATUS	OFF
	TYPE	RASTER
	OFFSITE	65 73 72
	TRANSPARENCY 80

END

LAYER

    NAME         aster-dem
    DATA         "mapa_de_color"
    STATUS       OFF
    TYPE         RASTER
    OFFSITE      65 73 72
    TRANSPARENCY 70

  CLASS
	EXPRESSION ([pixel] >= 5479 AND [pixel] < 6800)
      STYLE
        COLORRANGE  250 250 255  255 255 255
        DATARANGE   5479 6800
      END
    END

END

  LAYER # Lagos
    NAME         lagos
    DATA         lagos
    STATUS       OFF
    TYPE         LINE
    TRANSPARENCY 60

    CLASS
      NAME       "Lagos"
      STYLE
        COLOR    0 0 232
      END
    END
  END

  LAYER
    NAME         rios
    DATA         rios
    STATUS       OFF
    TYPE         LINE
    TRANSPARENCY 60
    CLASS
      NAME       "Rios"
      STYLE
        COLOR    0 0 200
      END
    END
  END

END

--------------------------------------------------------------------------------
Thanks in advance!

Antonio


More information about the mapserver-users mailing list