How to do it...

Carry out the following steps:

  1. MapServer exposes its map services using mapfile, a text file format, with which it is possible to define the PostGIS layers on the web, enable any vector and raster format supported by GDAL, and specify which services (WMS/WFS/WCS) to expose per layer. Create a new text file named countries.map and add the following code:
 MAP # Start of mapfile NAME 'population_per_country_map' IMAGETYPE PNG EXTENT -180 -90 180 90 SIZE 800 400 IMAGECOLOR 255 255 255 # map projection definition PROJECTION 'init=epsg:4326' END # web section: here we define the ows services WEB # WMS and WFS server settings METADATA 'ows_enable_request' '*' 'ows_title' 'Mapserver sample map' 'ows_abstract' 'OWS services about ...

Get PostGIS Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.