Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

We have a Mapserver mapfile used in a web app with a lot of layers. We want to publish only some of them with WMS, keeping the others hidden to any WMS request.

It has to be the same mapfile and we need each layer has its NAME attribute specified

Is there any way to do this?

share|improve this question
add comment

5 Answers

up vote 2 down vote accepted

Have a look at this:

http://trac.osgeo.org/mapserver/wiki/HidingLayersInOGCWebServices

or better yet:

http://mapserver.org/development/rfc/ms-rfc-67.html

I don't think it's possible right now, maybe in the forthcoming 6.0 version, according to:

http://trac.osgeo.org/mapserver/ticket/337

share|improve this answer
1  
See the Mapserver RFC 67 for more now mapserver.org/development/rfc/ms-rfc-67.html –  ThomasG77 Feb 21 '11 at 11:29
add comment

Use MapProxy or GeoWebCache to proxy your service. You can specify which layers to include. If your layer is fairly static the caching can improve the performance of your service.

If your WMS is used internally, you can put the regular WMS on one port and the proxied WMS on another port. Or, you can use security in the Web server component to control access.

share|improve this answer
add comment

You could use the STATUS parameter in the LAYER sections of the mapfile.

There are three possible values:

  • default: always generates the layer
  • on: generates the layer only when requested
  • off: never generates the layer

I guess you could use the off value, but maybe you use the mapfile for other purposes. Also, I'm not sure of the behaviour when calling GetCapabilities.

share|improve this answer
    
It doesn't work. Whatever value you put as STATUS, the layer is returned in a GetCapabilities request. And the same for the rest WMS requests –  billmuell Jul 23 '10 at 7:39
    
Bad luck, then. –  Pablo Rodriguez Jul 23 '10 at 8:13
add comment

If you're trying to have layers draw (like background or outline layers) but not allow the requesting client to control them, you might be able to publish the "locked" layers as a separate service, then add them to your "public" service as a raster layer.

See CONNECTIONTYPE WMS.

(Example: http://www.bostongis.com/PrinterFriendly.aspx?content_name=umn_datasources)

You won't be able to directly query those layers from the outside, and it would be possible to turn them all on or off, but they would be visible.

share|improve this answer
add comment

An idea might be to configure a false extend for the layer.

Just use coordinates on the other side of the Earth. The layer will still appears in the layer list, requests will still be possible but if a user simply select it in a GIS software and choose "zoom to layer" he will not see anything and might think that this layer is simply empty or does not work.. A web app knowing the correct extend of the layer should still be able to access it normally.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.