Re: AW: [MAPSERVER-USERS] Hiding overviews

2008-04-04 Thread Pål Kristensen

Hi Daniel!

Thanks for creating the ticket! I don't mean to rush you, but have you had
the time to commit the changes to SVN yet? Anyway, thanks again for the
quick response.



dmorissette wrote:
> 
> 
> FYI I have created a ticket for this:
> http://trac.osgeo.org/mapserver/ticket/2562
> 
> I can't commit this to SVN right now (I'm in the middle of other changes 
> in my source tree) but will try to get back at it ASAP.
> 
> Daniel
> -- 
> Daniel Morissette
> http://www.mapgears.com/
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Hiding-overviews-tp15845320p16498566.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: AW: [MAPSERVER-USERS] Hiding overviews

2008-03-27 Thread Pål Kristensen

Thanks!

I really appreciate the quick response, and the effort you developers put in
to meet the needs of the MapServer community users. 

Regards,
Pål Kristensen


Daniel Morissette-2 wrote:
> 
> 
> FYI I have created a ticket for this:
> http://trac.osgeo.org/mapserver/ticket/2562
> 
> I can't commit this to SVN right now (I'm in the middle of other changes 
> in my source tree) but will try to get back at it ASAP.
> 
> Daniel
> -- 
> Daniel Morissette
> http://www.mapgears.com/
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Hiding-overviews-tp15845320p16335723.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: AW: [MAPSERVER-USERS] Hiding overviews

2008-03-26 Thread Daniel Morissette

Pål Kristensen wrote:


Yes, this is indeed what I'm trying to achieve. I can't answer for others,
but for what I've read it looks like the described behavior is what most
people wants. I guess someone would like the ability to totally hide some
layers from the capabilities document, but in my opinion that's more of a
cosmetic need not to disclose to the user how the layers are organized
internally in mapserver. After all a layer without a name is not queryable,
and that is the main objective. 



FYI I have created a ticket for this:
http://trac.osgeo.org/mapserver/ticket/2562

I can't commit this to SVN right now (I'm in the middle of other changes 
in my source tree) but will try to get back at it ASAP.


Daniel
--
Daniel Morissette
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: AW: [MAPSERVER-USERS] Hiding overviews

2008-03-26 Thread Pål Kristensen

Hi! Daniel!

Yes, this is indeed what I'm trying to achieve. I can't answer for others,
but for what I've read it looks like the described behavior is what most
people wants. I guess someone would like the ability to totally hide some
layers from the capabilities document, but in my opinion that's more of a
cosmetic need not to disclose to the user how the layers are organized
internally in mapserver. After all a layer without a name is not queryable,
and that is the main objective. 

Regards,
Pål Kristensen


Daniel Morissette-2 wrote:
> 
> Daniel Morissette wrote:
> 
> ... then the following mapfile block...
> 
> LAYER
>NAME layer1
>METADATA
>  "wms_title" "Layer 1"
>  "wms_group_title" "Group 1"
>END
>GROUP group1
>MINSCALE 0
>MAXSCALE 1
>TYPE RASTER
>STATUS ON
>DATA layer1.tif
> END
> 
> LAYER
># NAME intentionally omitted...
>METADATA
>  "wms_title" "Layer 2"
>END
>GROUP group1
>MINSCALE 10001
>MAXSCALE 10
>TYPE RASTER
>STATUS ON
>DATA layer2.tif
> END
> 
> 
> ... produces the following output in GetCapabilities ... this whole 
> group can be turned on/off at once using LAYERS=group1 in the GetMap 
> request. Notice that layer 2 has no name in GetCapabilities which is 
> what we wanted. Omitting the layer name for layer 1 as well would make 
> it non-selectable as well:
> 
>  
>group1
>Group 1
>group1
>
>  layer1
> 
>  Layer 1
>  
>
>
> 
>  Layer 2
>  
>
> 
>  
> 
> 
> We would also need to update the WARNING text to say "optional" instead 
> of Mandatory.
> 
> If this is indeed what you were trying to achieve then please file a 
> ticket and I'll make the required changes in MapServer 5.2.
> 
> Daniel
> -- 
> Daniel Morissette
> http://www.mapgears.com/
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Hiding-overviews-tp15845320p16296685.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: AW: [MAPSERVER-USERS] Hiding overviews

2008-03-25 Thread Daniel Morissette

Daniel Morissette wrote:
I had a quick look at this thread and it seems to me at first that using 
GROUP in all layers corresponding to the same set of overviews should 
allow you to turn all of them on/off at once.




I built a small test case and it seems that the root problem is that the 
function msOWSMakeAllLayersUnique() produces an exception if any layer 
is missing a NAME. In order to allow what you want and make the layer 
name really optional we would need to get rid of that exception.


If we modify msOWSMakeAllLayersUnique() to 'continue' the loop instead 
of returning an exception when it encounters a NULL layer name as follows...


--- mapows.c(revision 7477)
+++ mapows.c(working copy)
@@ -141,10 +169,7 @@
   {
   if (GET_LAYER(map, i)->name == NULL || GET_LAYER(map, 
j)->name == NULL)

   {
-  msSetError(MS_MISCERR,
- "At least one layer is missing a name in map 
file.",

- "msOWSMakeAllLayersUnique()");
-  return MS_FAILURE;
+  continue;
   }
   if (strcasecmp(GET_LAYER(map, i)->name, GET_LAYER(map, 
j)->name) == 0 &&

   msRenameLayer((GET_LAYER(map, j)), ++count) != MS_SUCCESS)



... then the following mapfile block...

LAYER
  NAME layer1
  METADATA
"wms_title" "Layer 1"
"wms_group_title" "Group 1"
  END
  GROUP group1
  MINSCALE 0
  MAXSCALE 1
  TYPE RASTER
  STATUS ON
  DATA layer1.tif
END

LAYER
  # NAME intentionally omitted...
  METADATA
"wms_title" "Layer 2"
  END
  GROUP group1
  MINSCALE 10001
  MAXSCALE 10
  TYPE RASTER
  STATUS ON
  DATA layer2.tif
END


... produces the following output in GetCapabilities ... this whole 
group can be turned on/off at once using LAYERS=group1 in the GetMap 
request. Notice that layer 2 has no name in GetCapabilities which is 
what we wanted. Omitting the layer name for layer 1 as well would make 
it non-selectable as well:



  group1
  Group 1
  group1
  
layer1

Layer 1

  
  


Layer 2

  




We would also need to update the WARNING text to say "optional" instead 
of Mandatory.


If this is indeed what you were trying to achieve then please file a 
ticket and I'll make the required changes in MapServer 5.2.


Daniel
--
Daniel Morissette
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: AW: [MAPSERVER-USERS] Hiding overviews

2008-03-25 Thread Daniel Morissette
I had a quick look at this thread and it seems to me at first that using 
GROUP in all layers corresponding to the same set of overviews should 
allow you to turn all of them on/off at once.


With respect to this proposed change, I don't see why it would be needed 
since the layer.name is optional and if omitted in your layer in the 
mapfile will simply be omitted in the GetCapabilities, giving the 
behavior that you are looking for. The wms_name is a metadata used by 
CONNECTIONTYPE WMS only AFAIK, it should not be used by the WMS server 
code unless I'm mistaken.


I'll have a deeper look and try to better understand the problem and get 
back to you all.


Daniel


Pål Kristensen wrote:
Hi! 

Did you commit this change in the MapServer trunk? 


PS! Has any of you developers seen this thread, and would it be feasible to
add the patch to the trunk?




Eichner, Andreas - SID-NLK wrote:
 


Ok guys. I examined the situation and came to the conclusion that it is
a bug in MapServer.
In the source of mapserver v5.0.2, file mapwms.c, line 1071:


msOWSPrintEncodeParam(stdout, "LAYER.NAME", lp->name, OWS_WARN,
 "%s\n", NULL);

should really be


msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "name",

OWS_NOERR,

"%s\n", NULL);

since the code conflicts with the comment in the code on line 1747 in
the same file which states:
  "Layer Name is optional but title is mandatory."
Which exactly agrees with the specs which states at page 25 of v1.3.0:

"7.2.4.6.2 Title
A  is mandatory for all layers; ..." and

"7.2.4.6.3 Name
If, and only if, a layer has a , then it is a map layer that can
be requested by using that Name in the LAYERS parameter of a GetMap
request. A Layer that contains a  element is referred to as a
"named layer" in this International Standard. If the layer has a Title
but no Name, then that layer is only a category title for all the layers
nested within. A server that advertises a Layer containing a Name
element shall be able to accept that Name as the value of LAYERS
argument in a GetMap request and return the corresponding map. A client
shall not attempt to request a layer that has a Title but no Name."

IMHO this means you can ommit the  but have to provide the
. And if the layer has no name it can simply not be requested in
a GetMap-Request. If I change the code like above I have to provide a
"wms_name" in the METADATA part of the MAP file to make the layer
queryable. If I ommit "wms_name" then the layer get's no  and can
therefore not be requested by the client. IMHO it's then up to the
server whether or not to render that layer which is exactly what I want.
For overviews I want multiple layers where only one is active for a
given scale but which one is up to the server. Therefore a client should
not be able to explicitly request one of them. Instead I group those
layers in a named layer by a GROUP clause.

So please check this out. May be we should file a bug report on that.
But I think someone else should confirm this...


Best regards,

Andreas Eichner
 
___

mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users







--
Daniel Morissette
http://www.mapgears.com/
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: AW: [MAPSERVER-USERS] Hiding overviews

2008-03-25 Thread Pål Kristensen

Hi! 

Did you commit this change in the MapServer trunk? 

PS! Has any of you developers seen this thread, and would it be feasible to
add the patch to the trunk?




Eichner, Andreas - SID-NLK wrote:
> 
>  
> 
> Ok guys. I examined the situation and came to the conclusion that it is
> a bug in MapServer.
> In the source of mapserver v5.0.2, file mapwms.c, line 1071:
> 
>> msOWSPrintEncodeParam(stdout, "LAYER.NAME", lp->name, OWS_WARN,
>>  "%s\n", NULL);
> 
> should really be
> 
>> msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "name",
> OWS_NOERR,
>> "%s\n", NULL);
> 
> since the code conflicts with the comment in the code on line 1747 in
> the same file which states:
>   "Layer Name is optional but title is mandatory."
> Which exactly agrees with the specs which states at page 25 of v1.3.0:
> 
> "7.2.4.6.2 Title
> A  is mandatory for all layers; ..." and
> 
> "7.2.4.6.3 Name
> If, and only if, a layer has a , then it is a map layer that can
> be requested by using that Name in the LAYERS parameter of a GetMap
> request. A Layer that contains a  element is referred to as a
> "named layer" in this International Standard. If the layer has a Title
> but no Name, then that layer is only a category title for all the layers
> nested within. A server that advertises a Layer containing a Name
> element shall be able to accept that Name as the value of LAYERS
> argument in a GetMap request and return the corresponding map. A client
> shall not attempt to request a layer that has a Title but no Name."
> 
> IMHO this means you can ommit the  but have to provide the
> . And if the layer has no name it can simply not be requested in
> a GetMap-Request. If I change the code like above I have to provide a
> "wms_name" in the METADATA part of the MAP file to make the layer
> queryable. If I ommit "wms_name" then the layer get's no  and can
> therefore not be requested by the client. IMHO it's then up to the
> server whether or not to render that layer which is exactly what I want.
> For overviews I want multiple layers where only one is active for a
> given scale but which one is up to the server. Therefore a client should
> not be able to explicitly request one of them. Instead I group those
> layers in a named layer by a GROUP clause.
> 
> So please check this out. May be we should file a bug report on that.
> But I think someone else should confirm this...
> 
> 
> Best regards,
> 
> Andreas Eichner
>  
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Hiding-overviews-tp15845320p16274328.html
Sent from the Mapserver - User mailing list archive at Nabble.com.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


AW: [MAPSERVER-USERS] Hiding overviews

2008-03-07 Thread Eichner, Andreas - SID-NLK
 

Ok guys. I examined the situation and came to the conclusion that it is
a bug in MapServer.
In the source of mapserver v5.0.2, file mapwms.c, line 1071:

> msOWSPrintEncodeParam(stdout, "LAYER.NAME", lp->name, OWS_WARN,
>  "%s\n", NULL);

should really be

> msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "name",
OWS_NOERR,
> "%s\n", NULL);

since the code conflicts with the comment in the code on line 1747 in
the same file which states:
  "Layer Name is optional but title is mandatory."
Which exactly agrees with the specs which states at page 25 of v1.3.0:

"7.2.4.6.2 Title
A  is mandatory for all layers; ..." and

"7.2.4.6.3 Name
If, and only if, a layer has a , then it is a map layer that can
be requested by using that Name in the LAYERS parameter of a GetMap
request. A Layer that contains a  element is referred to as a
"named layer" in this International Standard. If the layer has a Title
but no Name, then that layer is only a category title for all the layers
nested within. A server that advertises a Layer containing a Name
element shall be able to accept that Name as the value of LAYERS
argument in a GetMap request and return the corresponding map. A client
shall not attempt to request a layer that has a Title but no Name."

IMHO this means you can ommit the  but have to provide the
. And if the layer has no name it can simply not be requested in
a GetMap-Request. If I change the code like above I have to provide a
"wms_name" in the METADATA part of the MAP file to make the layer
queryable. If I ommit "wms_name" then the layer get's no  and can
therefore not be requested by the client. IMHO it's then up to the
server whether or not to render that layer which is exactly what I want.
For overviews I want multiple layers where only one is active for a
given scale but which one is up to the server. Therefore a client should
not be able to explicitly request one of them. Instead I group those
layers in a named layer by a GROUP clause.

So please check this out. May be we should file a bug report on that.
But I think someone else should confirm this...


Best regards,

Andreas Eichner
 
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users