[mapserver-users] MapServer and shapefile

Mr. Puneet Kishor punk.kish at gmail.com
Thu Oct 4 23:34:48 PDT 2012


On Oct 4, 2012, at 10:56 PM, Fabio Brolese <fabiobrolese-forum at yahoo.it> wrote:

> Trying using shapefile as base layer I didn't find where to put my shapefile and to let them seen by MapServer. The examples say me to set the map file correctly but not where to save the shp files how to say to MapServer where thay are. Is there a directive in the main map file where to set the location of shp files like I set the log file path and etc.
> 
> 

http://mapserver.org/mapfile/map.html

MAP
  SHAPEPATH [filename]
    Path to the directory holding the shapefiles or tiles. 
    There can be further subdirectories under SHAPEPATH.




http://mapserver.org/mapfile/layer.html

LAYER
  DATA [filename]|[sde parameters][postgis table/column][oracle table/column]
    Full filename of the spatial data to process. No file 
    extension is necessary for shapefiles. Can be specified 
    relative to the SHAPEPATH option from the Map Object.






> 
> 
> 
> 
> 
>> ________________________________
>> Da: Cristiano Sumariva <sumariva at gmail.com>
>> A: Fabio Brolese <fabiobrolese-forum at yahoo.it> 
>> Inviato: Martedì 2 Ottobre 2012 13:14
>> Oggetto: Re: [mapserver-users] MapServer and shapefile
>> 
>> 
>> If your map vector is not huge, and processing time is not a problem - something greater then a few seconds for a tile - you can use a WMS layer as base.
>> Just add isBaseLayer true to parameter options on layer.
>> This should be minimal to change.
>> At my sites I did not note WMS overhead on requests.
>> You should know that OpenLayers is greed and will issue several concurrent requests to server. Processing spikes will happen.
>> 
>> 
>> For larger sets you maybe at the need of some cache stuff.
>> Consider using one in a programming language you know in case you need do maintenance in source code.
>> Or if confortable with some, create your particular simple cache maybe an option.
>> 
>> 
>> 2012/10/2 Fabio Brolese <fabiobrolese-forum at yahoo.it>
>> 
>> Yes, sorry, I was talking about OpenLayers.
>>> I understood and is like I did with all the layers I set pointing on PostGIS. I have also a "base layer" set as OpenLayers.Layer.TMS that load image tiles to show the city map. What we want to do is to change the base layer to read the city map from shapfile instead of reading image tiles.
>>> 
>>> 
>>> Do you know if there is a way to do what we want or do I have to reconsider my structure and consider and use it as OpenLayers.Layer.WMS?
>>> 
>>> 
>>> Fabio
>>> 
>>> 
>>> 
>>> 
>>> 
>>>> ________________________________
>>>> Da: Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi>
>>>> A: "mapserver-users at lists.osgeo.org" <mapserver-users at lists.osgeo.org> 
>>>> Inviato: Martedì 2 Ottobre 2012 9:05
>>>> Oggetto: Re: [mapserver-users] MapServer and shapefile
>>>> 
>>>> 
>>>> Hi,
>>>> 
>>>> Because you talk about base layer I think that you are perhaps going to show your map in OpenLayers. If that is the case then the answer is yes and this OpenLayers example shows how it can be done.
>>>> http://dev.openlayers.org/releases/OpenLayers-2.12/examples/wms-untiled.html
>>>> On the Mapserver side you must configure a WMS layer that is using shapefile as
> input data.
>>>> http://www.mapserver.org/ogc/wms_server.html
>>>> 
>>>> 
>>>> -Jukka Rahkonen-
>>>> ________________________________
>>>> Fabio Brolese wrote:
>>>> 
>>>>> Hello everybody,
>>>>> after a long search on Google I'm here to ask you if it's possible to use a shapefile as base layer.
>>>>> Everything I found was on exporting to shapefile or drawing objects from shapefile but nothing saying that I can >use it as base layer.
>>>> 
>>>> Can anyone help me?
>>>> 
>>>> TIA
>>>> 
>>>> Fabio
>>>> _______________________________________________
>>>> mapserver-users mailing list
>>>> mapserver-users at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>>> 
>>>> 
>>>> 
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>> 
>>> 
>> 
>> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list