[mapserver-users] layer data sources more than one

Mr. Puneet Kishor punk.kish at gmail.com
Sun Sep 11 22:18:26 EDT 2011


On Sep 11, 2011, at 9:05 PM, JIAJIA WANG wrote:

> The data in the shapefile are suburb boundaries, but I got several
> shapefiles, one shapefile for one state. I want a map showing the whole
> country's suburb boundaries.
> That's can be done by defining several layers (one layer reads one
> shapefile) in one mapfile. But actually there are not conflicts between
> these shapefiles. So I want to know is there any way to define only one
> layer and read the data from all these shapefiles.


I am pretty sure (but not 100%) that you can have only one data source per layer. That said, you could either combine all the shapefiles into a single countrywide shapefile, or you could create separate layers, and then create a layer group (I am pretty sure you can group the layers into one... its been a long time, and I am just coming back to MapServer, so check the docs). That way, all the different layers for different states will behave as if they are a single layer. From the docs --

GROUP [name]
  Name of a group that this layer belongs to. The group name can then be reference as a regular 
  layer name in the template files, allowing to do things like turning on and off a group of 
  layers at once.

> 
> On Mon, Sep 12, 2011 at 11:17 AM, Mr. Puneet Kishor <punk.kish at gmail.com>wrote:
> 
>> 
>> On Sep 11, 2011, at 8:10 PM, jjwang wrote:
>> 
>>> Hi,
>>> 
>>> I know that the DATA statement should be given a data source of the
>> layer.
>>> What if the data comes from multi shapefiles?
>>> Can I give it a list of shapefiles and how to write it?
>>> 
>> 
>> 
>> Generally a LAYER maps to a shapefile or a table in a db. It is hard for me
>> to imagine how one layer could have data from two or more shapefiles.
>> Perhaps more explanation would help here.
>> 
>> 



More information about the mapserver-users mailing list