Aug
1
Connection MapFile layer to PostGIS (c# mapscript tutorial, part 7)
Filed Under GIS, MapServer, PostGIS, devs, .NET, Tutorials, MapServer Tutorial for C# mapscript (ASP .NET) | 9 Comments
First I am going to show the difference between connecting the MapFile to a shapefile layer and to a PostGIS layer, then I will show how to adapt your MapFile to work with PostGIS.
Shapefile Connection
Here is a sample connection from MapFile to a shapefile called "compfun".
First you need to declare the path to the shape data (SHAPEPATH).
Then for each shapefile layer you have to set the shapefile's data source (DATA) that is the name of the shapefile.
Here the shapefile is named compfun.shp so DATA is set to "compfun".
Note that NAME can be anything, it means how in your MapFile want to call the shapefile layer.