[Geomoose-users] GeoMoose 3 - AGS Legend Support

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Geomoose-users] GeoMoose 3 - AGS Legend Support

chughes
Is there support for AGS legends in GeoMoose 3? Particularly for vector
layers with multiple classes where the meaning of the symbology isn't readily
apparent.

I tried turning on the legend for the ags services in the demo (railroads
and the Nat Geo world map) and was unsuccessful.

Best,
Chris

--
Chris Hughes

GIS Analyst
Lincoln County Surveyor Department 
880 NE 7th St. l Newport, OR 97365
Tel: (541) 574 1283

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

Brent Fraser
Hi Chris,
 
 I haven't looked into AGS legend yet, but my guess is no, neither
type="ags" or type="ags-vector" support legends.
 
 A longer answer:
 
   Both type="ags" and type="ags-vector" are for accessing ArcGIS Servers
with MapServer endpoints (they do not access FeatureServer endpoints)  
Responding to Legend requests is an option when setting up the AGS server
(and it looks like most don't?).   And AGS servers can serve different
formats of legends
(https://developers.arcgis.com/rest/services-reference/legend-map-service-.h
tm) and different kinds
https://developers.arcgis.com/rest/services-reference/query-legends-map-serv
ice-.htm).
 
 
 Best Regards,
 Brent Fraser
 
 
 -------- Original Message --------

> From: "Christopher Hughes" <[hidden email]>
> Sent: June 12, 2020 9:20 AM
> To: "GeoMoose Users" <[hidden email]>
> Subject: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>
> Is there support for AGS legends in GeoMoose 3? Particularly for vector
> layers with multiple classes where the meaning of the symbology isn't
> readily
> apparent.
>
> I tried turning on the legend for the ags services in the demo
(railroads

> and the Nat Geo world map) and was unsuccessful.
>
> Best,
> Chris
>
> --
> Chris Hughes
>
> GIS Analyst
> Lincoln County Surveyor Department
> 880 NE 7th St. l Newport, OR 97365
> Tel: (541) 574 1283
> _______________________________________________ Geomoose-users mailing
list [hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users


_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

James Klassen
In GeoMoose, vector layers are styled and rendered in the browser rather than by the server. Thus, I would expect legends for ags-vector to behave the same as any other vector layer.  If that isn't currently the case for ags-vector then that is an oversight/bug.

On 6/12/20 1:19 PM, Brent Fraser wrote:

> Hi Chris,
>    
>   I haven't looked into AGS legend yet, but my guess is no, neither
> type="ags" or type="ags-vector" support legends.
>    
>   A longer answer:
>    
>     Both type="ags" and type="ags-vector" are for accessing ArcGIS Servers
> with MapServer endpoints (they do not access FeatureServer endpoints)
> Responding to Legend requests is an option when setting up the AGS server
> (and it looks like most don't?).   And AGS servers can serve different
> formats of legends
> (https://developers.arcgis.com/rest/services-reference/legend-map-service-.h
> tm) and different kinds
> https://developers.arcgis.com/rest/services-reference/query-legends-map-serv
> ice-.htm).
>    
>    
>   Best Regards,
>   Brent Fraser
>    
>    
>   -------- Original Message --------
>> From: "Christopher Hughes" <[hidden email]>
>> Sent: June 12, 2020 9:20 AM
>> To: "GeoMoose Users" <[hidden email]>
>> Subject: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>>
>> Is there support for AGS legends in GeoMoose 3? Particularly for vector
>> layers with multiple classes where the meaning of the symbology isn't
>> readily
>> apparent.
>>
>> I tried turning on the legend for the ags services in the demo
> (railroads
>> and the Nat Geo world map) and was unsuccessful.
>>
>> Best,
>> Chris
>>
>> --
>> Chris Hughes
>>
>> GIS Analyst
>> Lincoln County Surveyor Department
>> 880 NE 7th St. l Newport, OR 97365
>> Tel: (541) 574 1283
>> _______________________________________________ Geomoose-users mailing
> list [hidden email]
> https://lists.osgeo.org/mailman/listinfo/geomoose-users
>
>
> _______________________________________________
> Geomoose-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/geomoose-users

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

Brent Fraser
So much documenting to do...
 
 
 AFAIK, GM3 has two kinds of legends: static and dynamic (my terms)
 
 Static you add to the mapbook for vector layers as type="html" (so you
code CSS styling in the mapbook), or type="img" and you supply a graphic
file.
 
 Dynamic is only for map-source types of "mapserver" (and maybe "wms"?) and
the legend will be created on the server composed of the rendered features.
 I think GM only supports image legends, not JSON ,etc.
 
 So currently, GM 3 does not support a dynamic (data server-generated)
legend for vector data sources.
 
 Brent
 
 
 -------- Original Message --------
> From: "Jim Klassen" <[hidden email]>
> Sent: June 12, 2020 12:37 PM
> To: [hidden email]
> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>
> In GeoMoose, vector layers are styled and rendered in the browser rather
than by the server. Thus, I would expect legends for ags-vector to behave
the same as any other vector layer.  If that isn't currently the case for
ags-vector then that is an oversight/bug. On 6/12/20 1:19 PM, Brent Fraser
wrote: > Hi Chris, > > I haven't looked into AGS legend yet, but my guess
is no, neither > type="ags" or type="ags-vector" support legends. > > A
longer answer: > > Both type="ags" and type="ags-vector" are for accessing
ArcGIS Servers > with MapServer endpoints (they do not access FeatureServer
endpoints) > Responding to Legend requests is an option when setting up the
AGS server > (and it looks like most don't?). And AGS servers can serve
different > formats of legends >
(https://developers.arcgis.com/rest/services-reference/legend-map-service-.h
 > tm) and different kinds >
https://developers.arcgis.com/rest/services-reference/query-legends-map-serv
 > ice-.htm). > > > Best Regards, > Brent Fraser > > > -------- Original
Message -------- >> From: "Christopher Hughes" <[hidden email]>
>> Sent: June 12, 2020 9:20 AM >> To: "GeoMoose Users"
<[hidden email]> >> Subject: [Geomoose-users] GeoMoose 3 -
AGS Legend Support >> >> Is there support for AGS legends in GeoMoose 3?
Particularly for vector >> layers with multiple classes where the meaning
of the symbology isn't >> readily >> apparent. >> >> I tried turning on the
legend for the ags services in the demo > (railroads >> and the Nat Geo
world map) and was unsuccessful. >> >> Best, >> Chris >> >> -- >> Chris
Hughes >> >> GIS Analyst >> Lincoln County Surveyor Department >> 880 NE
7th St. l Newport, OR 97365 >> Tel: (541) 574 1283 >>
_______________________________________________ Geomoose-users mailing >
list [hidden email] >
https://lists.osgeo.org/mailman/listinfo/geomoose-users > > >
_______________________________________________ > Geomoose-users mailing
list > [hidden email] >
https://lists.osgeo.org/mailman/listinfo/geomoose-users 
_______________________________________________ Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users


_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

James Klassen
I think you are basically correct.  A couple of minor points:

Keep in mind that the legend graphic file could be any URL that returns an image and doesn't necessarily need to point to a static file on the web server.  So, for example, it could be a legend or preview imaged generated from a WMS request (or other URL). However, I suspect that you are correct that it will be 'static' as in it will only be loaded once per GeoMoose session rather than updated as the map view changes.

Also, an HTML legend can be all sorts of creative with what is included (<a>, CSS background-image: url(...), etc.).


The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts for 'wms' and 'wfs' where GeoMoose does the url='/cgi-bin/mapserv?map=<file>&' substitution for you (using the values from config.js).  (Long ago, the 'mapserver' layer type actually made a Mapserver 'mode=map' request, but it has been using WMS behind the scenes since at least GeoMoose 2.6.)


Rant/aside/tangent:

Personally, I don't like the mapserver layer types and think that this path rewrite stuff is better done on the web server so access is consistent with other WxS clients (like QGIS).

I have Apache setup with Actions and RewriteRules so that '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE environment variable set to '/srv/datasets/some.map' behind the scenes.

This also allows for using Apache to manage access to individual mapfiles as well as separates mapfiles in the logs because every request isn't just /cgi-bin/mapserv with the actual mapfile being potentially hidden in a POST.  This also uses Apache to be sure the .map file exists and is under the /srv/datasets tree before executing the request (so things like '..' in the path don't let people tell mapserver to access other places on your server).

This does require a patch to mapserver or the setting the "ows_onlineresource" metadata in every mapfile so the links in GetCapabilites responses point to the right spot.


Something like:

         <Directory "/usr/lib/cgi-bin">
                 AllowOverride None
                 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch

                 # Only allow specified CGI-BIN files
                 Require all denied

                 # Mapserver
                 <Files "mapserv">
                         Require all granted

                         SetEnv MS_ERRORFILE "stderr"
                         SetEnv MS_MAP_NO_PATH "true"

                         RewriteEngine on
                         RewriteCond %{env:REDIRECT_HANDLER} ^mapserver
                         RewriteCond %{PATH_INFO} ^/datasets/(.*)
                         RewriteRule .* - [C,env=MS_MAPFILE:/srv/datasets/%1]
                         RewriteRule .* - [L]

                         RewriteRule .* - [F]
                 </Files>
         </Directory>

         <Directory "/srv/datasets/">
                 Require all denied

                 Action mapserver /cgi-bin/mapserv
                 AddHandler mapserver .map
                 <Files "*.map">
                         Require all granted
                 </Files>
         </Directory>
         Alias /datasets/ /srv/datasets/



On 6/12/20 2:05 PM, Brent Fraser wrote:

> So much documenting to do...
>    
>    
>   AFAIK, GM3 has two kinds of legends: static and dynamic (my terms)
>    
>   Static you add to the mapbook for vector layers as type="html" (so you
> code CSS styling in the mapbook), or type="img" and you supply a graphic
> file.
>    
>   Dynamic is only for map-source types of "mapserver" (and maybe "wms"?) and
> the legend will be created on the server composed of the rendered features.
>   I think GM only supports image legends, not JSON ,etc.
>    
>   So currently, GM 3 does not support a dynamic (data server-generated)
> legend for vector data sources.
>    
>   Brent
>    
>    
>   -------- Original Message --------
>> From: "Jim Klassen" <[hidden email]>
>> Sent: June 12, 2020 12:37 PM
>> To: [hidden email]
>> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>>
>> In GeoMoose, vector layers are styled and rendered in the browser rather
> than by the server. Thus, I would expect legends for ags-vector to behave
> the same as any other vector layer.  If that isn't currently the case for
> ags-vector then that is an oversight/bug. On 6/12/20 1:19 PM, Brent Fraser
> wrote: > Hi Chris, > > I haven't looked into AGS legend yet, but my guess
> is no, neither > type="ags" or type="ags-vector" support legends. > > A
> longer answer: > > Both type="ags" and type="ags-vector" are for accessing
> ArcGIS Servers > with MapServer endpoints (they do not access FeatureServer
> endpoints) > Responding to Legend requests is an option when setting up the
> AGS server > (and it looks like most don't?). And AGS servers can serve
> different > formats of legends >
> (https://developers.arcgis.com/rest/services-reference/legend-map-service-.h
>   > tm) and different kinds >
> https://developers.arcgis.com/rest/services-reference/query-legends-map-serv
>   > ice-.htm). > > > Best Regards, > Brent Fraser > > > -------- Original
> Message -------- >> From: "Christopher Hughes" <[hidden email]>
>>> Sent: June 12, 2020 9:20 AM >> To: "GeoMoose Users"
> <[hidden email]> >> Subject: [Geomoose-users] GeoMoose 3 -
> AGS Legend Support >> >> Is there support for AGS legends in GeoMoose 3?
> Particularly for vector >> layers with multiple classes where the meaning
> of the symbology isn't >> readily >> apparent. >> >> I tried turning on the
> legend for the ags services in the demo > (railroads >> and the Nat Geo
> world map) and was unsuccessful. >> >> Best, >> Chris >> >> -- >> Chris
> Hughes >> >> GIS Analyst >> Lincoln County Surveyor Department >> 880 NE
> 7th St. l Newport, OR 97365 >> Tel: (541) 574 1283 >>
> _______________________________________________ Geomoose-users mailing >
> list [hidden email] >
> https://lists.osgeo.org/mailman/listinfo/geomoose-users > > >
> _______________________________________________ > Geomoose-users mailing
> list > [hidden email] >
> https://lists.osgeo.org/mailman/listinfo/geomoose-users
> _______________________________________________ Geomoose-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/geomoose-users
>
>

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

jmckenna
Administrator
This may also be of some help: a very old demo I created showing
MapServer legends and its code, likely created about 18 years ago by me
no kidding ha: click on the first demo for example (someone recently
asked me to update all of these for MapServer 7 which I did last month):
https://demo.mapserver.org/itasca_legend/  Scroll to the bottom of the
page you can find the mapfile link and the HTML legend code.

HTML legends are still a very powerful part of MapServer.  Might be
applicable here, or at least give you another option.

-jeff





--
Jeff McKenna
MapServer Consulting and Training Services
co-founder of FOSS4G
http://gatewaygeo.com/


On 2020-06-12 4:50 p.m., Jim Klassen wrote:

> I think you are basically correct.  A couple of minor points:
>
> Keep in mind that the legend graphic file could be any URL that returns
> an image and doesn't necessarily need to point to a static file on the
> web server.  So, for example, it could be a legend or preview imaged
> generated from a WMS request (or other URL). However, I suspect that you
> are correct that it will be 'static' as in it will only be loaded once
> per GeoMoose session rather than updated as the map view changes.
>
> Also, an HTML legend can be all sorts of creative with what is included
> (<a>, CSS background-image: url(...), etc.).
>
>
> The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts for
> 'wms' and 'wfs' where GeoMoose does the
> url='/cgi-bin/mapserv?map=<file>&' substitution for you (using the
> values from config.js).  (Long ago, the 'mapserver' layer type actually
> made a Mapserver 'mode=map' request, but it has been using WMS behind
> the scenes since at least GeoMoose 2.6.)
>
>
> Rant/aside/tangent:
>
> Personally, I don't like the mapserver layer types and think that this
> path rewrite stuff is better done on the web server so access is
> consistent with other WxS clients (like QGIS).
>
> I have Apache setup with Actions and RewriteRules so that
> '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE
> environment variable set to '/srv/datasets/some.map' behind the scenes.
>
> This also allows for using Apache to manage access to individual
> mapfiles as well as separates mapfiles in the logs because every request
> isn't just /cgi-bin/mapserv with the actual mapfile being potentially
> hidden in a POST.  This also uses Apache to be sure the .map file exists
> and is under the /srv/datasets tree before executing the request (so
> things like '..' in the path don't let people tell mapserver to access
> other places on your server).
>
> This does require a patch to mapserver or the setting the
> "ows_onlineresource" metadata in every mapfile so the links in
> GetCapabilites responses point to the right spot.
>
>
> Something like:
>
>          <Directory "/usr/lib/cgi-bin">
>                  AllowOverride None
>                  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>
>                  # Only allow specified CGI-BIN files
>                  Require all denied
>
>                  # Mapserver
>                  <Files "mapserv">
>                          Require all granted
>
>                          SetEnv MS_ERRORFILE "stderr"
>                          SetEnv MS_MAP_NO_PATH "true"
>
>                          RewriteEngine on
>                          RewriteCond %{env:REDIRECT_HANDLER} ^mapserver
>                          RewriteCond %{PATH_INFO} ^/datasets/(.*)
>                          RewriteRule .* -
> [C,env=MS_MAPFILE:/srv/datasets/%1]
>                          RewriteRule .* - [L]
>
>                          RewriteRule .* - [F]
>                  </Files>
>          </Directory>
>
>          <Directory "/srv/datasets/">
>                  Require all denied
>
>                  Action mapserver /cgi-bin/mapserv
>                  AddHandler mapserver .map
>                  <Files "*.map">
>                          Require all granted
>                  </Files>
>          </Directory>
>          Alias /datasets/ /srv/datasets/
>
>
>
> On 6/12/20 2:05 PM, Brent Fraser wrote:
>> So much documenting to do...
>>   AFAIK, GM3 has two kinds of legends: static and dynamic (my terms)
>>   Static you add to the mapbook for vector layers as type="html" (so you
>> code CSS styling in the mapbook), or type="img" and you supply a graphic
>> file.
>>   Dynamic is only for map-source types of "mapserver" (and maybe
>> "wms"?) and
>> the legend will be created on the server composed of the rendered
>> features.
>>   I think GM only supports image legends, not JSON ,etc.
>>   So currently, GM 3 does not support a dynamic (data server-generated)
>> legend for vector data sources.
>>   Brent
>>   -------- Original Message --------
>>> From: "Jim Klassen" <[hidden email]>
>>> Sent: June 12, 2020 12:37 PM
>>> To: [hidden email]
>>> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>>>
>>> In GeoMoose, vector layers are styled and rendered in the browser rather
>> than by the server. Thus, I would expect legends for ags-vector to behave
>> the same as any other vector layer.  If that isn't currently the case for
>> ags-vector then that is an oversight/bug. On 6/12/20 1:19 PM, Brent
>> Fraser
>> wrote: > Hi Chris, > > I haven't looked into AGS legend yet, but my guess
>> is no, neither > type="ags" or type="ags-vector" support legends. > > A
>> longer answer: > > Both type="ags" and type="ags-vector" are for
>> accessing
>> ArcGIS Servers > with MapServer endpoints (they do not access
>> FeatureServer
>> endpoints) > Responding to Legend requests is an option when setting
>> up the
>> AGS server > (and it looks like most don't?). And AGS servers can serve
>> different > formats of legends >
>> (https://developers.arcgis.com/rest/services-reference/legend-map-service-.h 
>>
>>   > tm) and different kinds >
>> https://developers.arcgis.com/rest/services-reference/query-legends-map-serv 
>>
>>   > ice-.htm). > > > Best Regards, > Brent Fraser > > > -------- Original
>> Message -------- >> From: "Christopher Hughes" <[hidden email]>
>>>> Sent: June 12, 2020 9:20 AM >> To: "GeoMoose Users"
>> <[hidden email]> >> Subject: [Geomoose-users] GeoMoose
>> 3 -
>> AGS Legend Support >> >> Is there support for AGS legends in GeoMoose 3?
>> Particularly for vector >> layers with multiple classes where the meaning
>> of the symbology isn't >> readily >> apparent. >> >> I tried turning
>> on the
>> legend for the ags services in the demo > (railroads >> and the Nat Geo
>> world map) and was unsuccessful. >> >> Best, >> Chris >> >> -- >> Chris
>> Hughes >> >> GIS Analyst >> Lincoln County Surveyor Department >> 880 NE
>> 7th St. l Newport, OR 97365 >> Tel: (541) 574 1283 >>
>> _______________________________________________ Geomoose-users mailing >
>> list [hidden email] >
>> https://lists.osgeo.org/mailman/listinfo/geomoose-users > > >
>> _______________________________________________ > Geomoose-users mailing
>> list > [hidden email] >
>> https://lists.osgeo.org/mailman/listinfo/geomoose-users
>> _______________________________________________ Geomoose-users mailing
>> list
>> [hidden email]
>> https://lists.osgeo.org/mailman/listinfo/geomoose-users
>>
>>
>
> _______________________________________________
> Geomoose-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/geomoose-users

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

James Klassen
In reply to this post by James Klassen
I think your use of static/dynamic is fine.

My point is, with a little creativity, there is a lot of potential power in the 'static' legends beyond what is shown in the demo.  And it might be worth documenting that to get people thinking about what they could do with it.

I'm be happy for the Apache trick to land in the docs.  I've been using MapServer that way for ~15 years.  Only reason it isn't in the docs already is when I first came up with it, I was told it was too complicated, so I dropped it.

On 6/12/20 3:15 PM, Brent Fraser wrote:

> See comments below
>    
>    
>    
>   -------- Original Message --------
>> From: "Jim Klassen" <[hidden email]>
>> Sent: June 12, 2020 1:50 PM
>> To: [hidden email], [hidden email]
>> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>>
>> I think you are basically correct.  A couple of minor points:
>>
>> Keep in mind that the legend graphic file could be any URL that returns
> an image and doesn't necessarily need to point to a static file on the web
> server.  So, for example, it could be a legend or preview imaged generated
> from a WMS request (or other URL). However, I suspect that you are correct
> that it will be 'static' as in it will only be loaded once per GeoMoose
> session rather than updated as the map view changes.
>> Also, an HTML legend can be all sorts of creative with what is included
> (<a>, CSS background-image: url(...), etc.).
>    
>   Yeah, static isn't a very good term, but I was trying to illustrate that
> the legend will not change on a pan/zoom as it could with type="mapserver"
> or "wms" if there a zoom sensitive layers set up on the data server.
>    
>    
>> The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts for
> 'wms' and 'wfs' where GeoMoose does the url='/cgi-bin/mapserv?map=<file>&'
> substitution for you (using the values from config.js).  (Long ago, the
> 'mapserver' layer type actually made a Mapserver 'mode=map' request, but it
> has been using WMS behind the scenes since at least GeoMoose 2.6.)
>    
>   Yes, and the move to standard protocols (like wms, wfs) is a good thing.
> In fact to test wfs I just created a mapsource like so:
>    
>       <map-source name="wfs-polygons"           type="wfs" >
>          <url>http://localhost/cgi-bin/mapserv.exe</url>
>          <param name="map"
> value="C:/ms4w/apps/gm3-demo-data/demo/parcels/parcels.map"/>
>          <param name="typename" value="ms:parcels"/>
>          <layer name="default" title="wfs Polygons">
>    
>   But there may have been some problems with some Mapserver versions in the
> past (search the GM source for "wgs84Hack")
>
>>
>> Rant/aside/tangent:
>>
>> Personally, I don't like the mapserver layer types and think that this
> path rewrite stuff is better done on the web server so access is consistent
> with other WxS clients (like QGIS).
>> I have Apache setup with Actions and RewriteRules so that
> '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE environment
> variable set to '/srv/datasets/some.map' behind the scenes.
>> This also allows for using Apache to manage access to individual mapfiles
> as well as separates mapfiles in the logs because every request isn't just
> /cgi-bin/mapserv with the actual mapfile being potentially hidden in a
> POST.  This also uses Apache to be sure the .map file exists and is under
> the /srv/datasets tree before executing the request (so things like '..' in
> the path don't let people tell mapserver to access other places on your
> server).
>> This does require a patch to mapserver or the setting the
> "ows_onlineresource" metadata in every mapfile so the links in
> GetCapabilites responses point to the right spot.
>>
>> Something like:
>>
>>          <Directory "/usr/lib/cgi-bin">
>>                  AllowOverride None
>>                  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>
>>                  # Only allow specified CGI-BIN files
>>                  Require all denied
>>
>>                  # Mapserver
>>                  <Files "mapserv">
>>                          Require all granted
>>
>>                          SetEnv MS_ERRORFILE "stderr"
>>                          SetEnv MS_MAP_NO_PATH "true"
>>
>>                          RewriteEngine on
>>                          RewriteCond %{env:REDIRECT_HANDLER} ^mapserver
>>                          RewriteCond %{PATH_INFO} ^/datasets/(.*)
>>                          RewriteRule .* -
> [C,env=MS_MAPFILE:/srv/datasets/%1]
>>                          RewriteRule .* - [L]
>>
>>                          RewriteRule .* - [F]
>>                  </Files>
>>          </Directory>
>>
>>          <Directory "/srv/datasets/">
>>                  Require all denied
>>
>>                  Action mapserver /cgi-bin/mapserv
>>                  AddHandler mapserver .map
>>                  <Files "*.map">
>>                          Require all granted
>>                  </Files>
>>          </Directory>
>>          Alias /datasets/ /srv/datasets/
>>
> Ooo! Nice!  How about finding a spot in the docs for that?
>
>
>

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

chughes
Thanks for all the feedback!

HTML legends look like they may be a viable option that I need to explore more.

There may be a bug/oversight as I haven't been able to get the legend working for the demo's ags-vector layer
that has its style declared in the map-source (or perhaps the map-source needs to be configured in a certain way
for the legend to show).

Best Regards,

Chris

On Fri, Jun 12, 2020 at 1:44 PM Jim Klassen <[hidden email]> wrote:
I think your use of static/dynamic is fine.

My point is, with a little creativity, there is a lot of potential power in the 'static' legends beyond what is shown in the demo.  And it might be worth documenting that to get people thinking about what they could do with it.

I'm be happy for the Apache trick to land in the docs.  I've been using MapServer that way for ~15 years.  Only reason it isn't in the docs already is when I first came up with it, I was told it was too complicated, so I dropped it.

On 6/12/20 3:15 PM, Brent Fraser wrote:
> See comments below
>   
>   
>   
>   -------- Original Message --------
>> From: "Jim Klassen" <[hidden email]>
>> Sent: June 12, 2020 1:50 PM
>> To: [hidden email], [hidden email]
>> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>>
>> I think you are basically correct.  A couple of minor points:
>>
>> Keep in mind that the legend graphic file could be any URL that returns
> an image and doesn't necessarily need to point to a static file on the web
> server.  So, for example, it could be a legend or preview imaged generated
> from a WMS request (or other URL). However, I suspect that you are correct
> that it will be 'static' as in it will only be loaded once per GeoMoose
> session rather than updated as the map view changes.
>> Also, an HTML legend can be all sorts of creative with what is included
> (<a>, CSS background-image: url(...), etc.).
>   
>   Yeah, static isn't a very good term, but I was trying to illustrate that
> the legend will not change on a pan/zoom as it could with type="mapserver"
> or "wms" if there a zoom sensitive layers set up on the data server.
>   
>     
>> The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts for
> 'wms' and 'wfs' where GeoMoose does the url='/cgi-bin/mapserv?map=<file>&'
> substitution for you (using the values from config.js).  (Long ago, the
> 'mapserver' layer type actually made a Mapserver 'mode=map' request, but it
> has been using WMS behind the scenes since at least GeoMoose 2.6.)
>   
>   Yes, and the move to standard protocols (like wms, wfs) is a good thing.
> In fact to test wfs I just created a mapsource like so:
>   
>       <map-source name="wfs-polygons"           type="wfs" >
>          <url>http://localhost/cgi-bin/mapserv.exe</url>
>          <param name="map"
> value="C:/ms4w/apps/gm3-demo-data/demo/parcels/parcels.map"/>
>          <param name="typename" value="ms:parcels"/>
>          <layer name="default" title="wfs Polygons">
>   
>   But there may have been some problems with some Mapserver versions in the
> past (search the GM source for "wgs84Hack")
>
>>
>> Rant/aside/tangent:
>>
>> Personally, I don't like the mapserver layer types and think that this
> path rewrite stuff is better done on the web server so access is consistent
> with other WxS clients (like QGIS).
>> I have Apache setup with Actions and RewriteRules so that
> '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE environment
> variable set to '/srv/datasets/some.map' behind the scenes.
>> This also allows for using Apache to manage access to individual mapfiles
> as well as separates mapfiles in the logs because every request isn't just
> /cgi-bin/mapserv with the actual mapfile being potentially hidden in a
> POST.  This also uses Apache to be sure the .map file exists and is under
> the /srv/datasets tree before executing the request (so things like '..' in
> the path don't let people tell mapserver to access other places on your
> server).
>> This does require a patch to mapserver or the setting the
> "ows_onlineresource" metadata in every mapfile so the links in
> GetCapabilites responses point to the right spot.
>>
>> Something like:
>>
>>          <Directory "/usr/lib/cgi-bin">
>>                  AllowOverride None
>>                  Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>>
>>                  # Only allow specified CGI-BIN files
>>                  Require all denied
>>
>>                  # Mapserver
>>                  <Files "mapserv">
>>                          Require all granted
>>
>>                          SetEnv MS_ERRORFILE "stderr"
>>                          SetEnv MS_MAP_NO_PATH "true"
>>
>>                          RewriteEngine on
>>                          RewriteCond %{env:REDIRECT_HANDLER} ^mapserver
>>                          RewriteCond %{PATH_INFO} ^/datasets/(.*)
>>                          RewriteRule .* -
> [C,env=MS_MAPFILE:/srv/datasets/%1]
>>                          RewriteRule .* - [L]
>>
>>                          RewriteRule .* - [F]
>>                  </Files>
>>          </Directory>
>>
>>          <Directory "/srv/datasets/">
>>                  Require all denied
>>
>>                  Action mapserver /cgi-bin/mapserv
>>                  AddHandler mapserver .map
>>                  <Files "*.map">
>>                          Require all granted
>>                  </Files>
>>          </Directory>
>>          Alias /datasets/ /srv/datasets/
>>
> Ooo! Nice!  How about finding a spot in the docs for that?
>
>
>

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users


--
Chris Hughes

GIS Analyst
Lincoln County Surveyor Department 
880 NE 7th St. l Newport, OR 97365
Tel: (541) 574 1283

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

Brent Fraser
This works for me (v3.6.2-beta:
 )
     <map-source name="ags-vector-polygons"    type="ags-vector">
       
<url>https://gis2.co.dakota.mn.us/arcgis/rest/services/DCGIS_OL_Transportati
on/MapServer/21</url>
        <layer name="runways" selectable="true" title="Runways">
            <style><![CDATA[
            {
                "line-color" : "red",
                "line-width" : 2,
                "fill-color": "#FF4500",
                "fill-opacity": 0.20
            }
            ]]></style>
            <legend type="html"><![CDATA[
            <div style='padding-top: 3px; padding-bottom: 5px;'>
                <div style='vertical-align: middle; display: inline-block;
width: 2em; height: 1em;   background-color: rgb(255, 69, 0, 0.2); border:
solid 2px red;'></div>
                <b>Runways</b>
            </div>
            ]]></legend>
 
 
 
 -------- Original Message --------
> From: "Christopher Hughes" <[hidden email]>
> Sent: June 12, 2020 5:10 PM
> To: "GeoMoose Users" <[hidden email]>
> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>
> Thanks for all the feedback!
>
> HTML legends look like they may be a viable option that I need to
explore

> more.
>
> There may be a bug/oversight as I haven't been able to get the legend
> working for the demo's ags-vector layer
> that has its style declared in the map-source (or perhaps the map-source
> needs to be configured in a certain way
> for the legend to show).
>
> Best Regards,
>
> Chris
>
> On Fri, Jun 12, 2020 at 1:44 PM Jim Klassen <[hidden email]>
wrote:
>
> > I think your use of static/dynamic is fine.
> >
> > My point is, with a little creativity, there is a lot of potential
power
> > in the 'static' legends beyond what is shown in the demo. And it might
be
> > worth documenting that to get people thinking about what they could do
with
> > it.
> >
> > I'm be happy for the Apache trick to land in the docs. I've been using
> > MapServer that way for ~15 years. Only reason it isn't in the docs
already
> > is when I first came up with it, I was told it was too complicated, so
I

> > dropped it.
> >
> > On 6/12/20 3:15 PM, Brent Fraser wrote:
> > > See comments below
> > >
> > >
> > >
> > > -------- Original Message --------
> > >> From: "Jim Klassen" <[hidden email]>
> > >> Sent: June 12, 2020 1:50 PM
> > >> To: [hidden email], [hidden email]
> > >> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
> > >>
> > >> I think you are basically correct. A couple of minor points:
> > >>
> > >> Keep in mind that the legend graphic file could be any URL that
returns
> > > an image and doesn't necessarily need to point to a static file on
the
> > web
> > > server. So, for example, it could be a legend or preview imaged
> > generated
> > > from a WMS request (or other URL). However, I suspect that you are
> > correct
> > > that it will be 'static' as in it will only be loaded once per
GeoMoose
> > > session rather than updated as the map view changes.
> > >> Also, an HTML legend can be all sorts of creative with what is
included

> > > (<a>, CSS background-image: url(...), etc.).
> > >
> > > Yeah, static isn't a very good term, but I was trying to illustrate
> > that
> > > the legend will not change on a pan/zoom as it could with
> > type="mapserver"
> > > or "wms" if there a zoom sensitive layers set up on the data server.
> > >
> > >
> > >> The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts
for
> > > 'wms' and 'wfs' where GeoMoose does the
> > url='/cgi-bin/mapserv?map=<file>&'
> > > substitution for you (using the values from config.js). (Long ago,
the
> > > 'mapserver' layer type actually made a Mapserver 'mode=map' request,
but

> > it
> > > has been using WMS behind the scenes since at least GeoMoose 2.6.)
> > >
> > > Yes, and the move to standard protocols (like wms, wfs) is a good
> > thing.
> > > In fact to test wfs I just created a mapsource like so:
> > >
> > > <map-source name="wfs-polygons" type="wfs" >
> > > <url>http://localhost/cgi-bin/mapserv.exe</url>
> > > <param name="map"
> > > value="C:/ms4w/apps/gm3-demo-data/demo/parcels/parcels.map"/>
> > > <param name="typename" value="ms:parcels"/>
> > > <layer name="default" title="wfs Polygons">
> > >
> > > But there may have been some problems with some Mapserver versions
in
> > the
> > > past (search the GM source for "wgs84Hack")
> > >
> > >>
> > >> Rant/aside/tangent:
> > >>
> > >> Personally, I don't like the mapserver layer types and think that
this

> > > path rewrite stuff is better done on the web server so access is
> > consistent
> > > with other WxS clients (like QGIS).
> > >> I have Apache setup with Actions and RewriteRules so that
> > > '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE
> > environment
> > > variable set to '/srv/datasets/some.map' behind the scenes.
> > >> This also allows for using Apache to manage access to individual
> > mapfiles
> > > as well as separates mapfiles in the logs because every request
isn't
> > just
> > > /cgi-bin/mapserv with the actual mapfile being potentially hidden in
a
> > > POST. This also uses Apache to be sure the .map file exists and is
under
> > > the /srv/datasets tree before executing the request (so things like
'..'
> > in
> > > the path don't let people tell mapserver to access other places on
your

> > > server).
> > >> This does require a patch to mapserver or the setting the
> > > "ows_onlineresource" metadata in every mapfile so the links in
> > > GetCapabilites responses point to the right spot.
> > >>
> > >> Something like:
> > >>
> > >> <Directory "/usr/lib/cgi-bin">
> > >> AllowOverride None
> > >> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
> > >>
> > >> # Only allow specified CGI-BIN files
> > >> Require all denied
> > >>
> > >> # Mapserver
> > >> <Files "mapserv">
> > >> Require all granted
> > >>
> > >> SetEnv MS_ERRORFILE "stderr"
> > >> SetEnv MS_MAP_NO_PATH "true"
> > >>
> > >> RewriteEngine on
> > >> RewriteCond %{env:REDIRECT_HANDLER} ^mapserver
> > >> RewriteCond %{PATH_INFO} ^/datasets/(.*)
> > >> RewriteRule .* -
> > > [C,env=MS_MAPFILE:/srv/datasets/%1]
> > >> RewriteRule .* - [L]
> > >>
> > >> RewriteRule .* - [F]
> > >> </Files>
> > >> </Directory>
> > >>
> > >> <Directory "/srv/datasets/">
> > >> Require all denied
> > >>
> > >> Action mapserver /cgi-bin/mapserv
> > >> AddHandler mapserver .map
> > >> <Files "*.map">
> > >> Require all granted
> > >> </Files>
> > >> </Directory>
> > >> Alias /datasets/ /srv/datasets/
> > >>
> > > Ooo! Nice! How about finding a spot in the docs for that?
> > >
> > >
> > >
> >
> > _______________________________________________
> > Geomoose-users mailing list
> > [hidden email]
> > https://lists.osgeo.org/mailman/listinfo/geomoose-users
>
>
>
> --
> Chris Hughes
>
> GIS Analyst
> Lincoln County Surveyor Department
> 880 NE 7th St. l Newport, OR 97365
> Tel: (541) 574 1283
> _______________________________________________ Geomoose-users mailing
list [hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users


_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users
Reply | Threaded
Open this post in threaded view
|

Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support

chughes
That is a much improved version of the very basic html legend that I had working!
Thanks for sharing!

Chris

On Fri, Jun 12, 2020 at 4:36 PM Brent Fraser <[hidden email]> wrote:
This works for me (v3.6.2-beta:
 )
     <map-source name="ags-vector-polygons"    type="ags-vector">

<url>https://gis2.co.dakota.mn.us/arcgis/rest/services/DCGIS_OL_Transportati
on/MapServer/21
</url>
        <layer name="runways" selectable="true" title="Runways">
            <style><![CDATA[
            {
                "line-color" : "red",
                "line-width" : 2,
                "fill-color": "#FF4500",
                "fill-opacity": 0.20
            }
            ]]></style>
            <legend type="html"><![CDATA[
            <div style='padding-top: 3px; padding-bottom: 5px;'>
                <div style='vertical-align: middle; display: inline-block;
width: 2em; height: 1em;   background-color: rgb(255, 69, 0, 0.2); border:
solid 2px red;'></div>
                <b>Runways</b>
            </div>
            ]]></legend>



 -------- Original Message --------
> From: "Christopher Hughes" <[hidden email]>
> Sent: June 12, 2020 5:10 PM
> To: "GeoMoose Users" <[hidden email]>
> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
>
> Thanks for all the feedback!
>
> HTML legends look like they may be a viable option that I need to
explore
> more.
>
> There may be a bug/oversight as I haven't been able to get the legend
> working for the demo's ags-vector layer
> that has its style declared in the map-source (or perhaps the map-source
> needs to be configured in a certain way
> for the legend to show).
>
> Best Regards,
>
> Chris
>
> On Fri, Jun 12, 2020 at 1:44 PM Jim Klassen <[hidden email]>
wrote:
>
> > I think your use of static/dynamic is fine.
> >
> > My point is, with a little creativity, there is a lot of potential
power
> > in the 'static' legends beyond what is shown in the demo. And it might
be
> > worth documenting that to get people thinking about what they could do
with
> > it.
> >
> > I'm be happy for the Apache trick to land in the docs. I've been using
> > MapServer that way for ~15 years. Only reason it isn't in the docs
already
> > is when I first came up with it, I was told it was too complicated, so
I
> > dropped it.
> >
> > On 6/12/20 3:15 PM, Brent Fraser wrote:
> > > See comments below
> > >
> > >
> > >
> > > -------- Original Message --------
> > >> From: "Jim Klassen" <[hidden email]>
> > >> Sent: June 12, 2020 1:50 PM
> > >> To: [hidden email], [hidden email]
> > >> Subject: Re: [Geomoose-users] GeoMoose 3 - AGS Legend Support
> > >>
> > >> I think you are basically correct. A couple of minor points:
> > >>
> > >> Keep in mind that the legend graphic file could be any URL that
returns
> > > an image and doesn't necessarily need to point to a static file on
the
> > web
> > > server. So, for example, it could be a legend or preview imaged
> > generated
> > > from a WMS request (or other URL). However, I suspect that you are
> > correct
> > > that it will be 'static' as in it will only be loaded once per
GeoMoose
> > > session rather than updated as the map view changes.
> > >> Also, an HTML legend can be all sorts of creative with what is
included
> > > (<a>, CSS background-image: url(...), etc.).
> > >
> > > Yeah, static isn't a very good term, but I was trying to illustrate
> > that
> > > the legend will not change on a pan/zoom as it could with
> > type="mapserver"
> > > or "wms" if there a zoom sensitive layers set up on the data server.
> > >
> > >
> > >> The layer types 'mapserver' and 'mapserver-wfs' are just shortcuts
for
> > > 'wms' and 'wfs' where GeoMoose does the
> > url='/cgi-bin/mapserv?map=<file>&'
> > > substitution for you (using the values from config.js). (Long ago,
the
> > > 'mapserver' layer type actually made a Mapserver 'mode=map' request,
but
> > it
> > > has been using WMS behind the scenes since at least GeoMoose 2.6.)
> > >
> > > Yes, and the move to standard protocols (like wms, wfs) is a good
> > thing.
> > > In fact to test wfs I just created a mapsource like so:
> > >
> > > <map-source name="wfs-polygons" type="wfs" >
> > > <url>http://localhost/cgi-bin/mapserv.exe</url>
> > > <param name="map"
> > > value="C:/ms4w/apps/gm3-demo-data/demo/parcels/parcels.map"/>
> > > <param name="typename" value="ms:parcels"/>
> > > <layer name="default" title="wfs Polygons">
> > >
> > > But there may have been some problems with some Mapserver versions
in
> > the
> > > past (search the GM source for "wgs84Hack")
> > >
> > >>
> > >> Rant/aside/tangent:
> > >>
> > >> Personally, I don't like the mapserver layer types and think that
this
> > > path rewrite stuff is better done on the web server so access is
> > consistent
> > > with other WxS clients (like QGIS).
> > >> I have Apache setup with Actions and RewriteRules so that
> > > '/datasets/some.map' -> '/cgi-bin/mapserv' with the MS_MAPFILE
> > environment
> > > variable set to '/srv/datasets/some.map' behind the scenes.
> > >> This also allows for using Apache to manage access to individual
> > mapfiles
> > > as well as separates mapfiles in the logs because every request
isn't
> > just
> > > /cgi-bin/mapserv with the actual mapfile being potentially hidden in
a
> > > POST. This also uses Apache to be sure the .map file exists and is
under
> > > the /srv/datasets tree before executing the request (so things like
'..'
> > in
> > > the path don't let people tell mapserver to access other places on
your
> > > server).
> > >> This does require a patch to mapserver or the setting the
> > > "ows_onlineresource" metadata in every mapfile so the links in
> > > GetCapabilites responses point to the right spot.
> > >>
> > >> Something like:
> > >>
> > >> <Directory "/usr/lib/cgi-bin">
> > >> AllowOverride None
> > >> Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
> > >>
> > >> # Only allow specified CGI-BIN files
> > >> Require all denied
> > >>
> > >> # Mapserver
> > >> <Files "mapserv">
> > >> Require all granted
> > >>
> > >> SetEnv MS_ERRORFILE "stderr"
> > >> SetEnv MS_MAP_NO_PATH "true"
> > >>
> > >> RewriteEngine on
> > >> RewriteCond %{env:REDIRECT_HANDLER} ^mapserver
> > >> RewriteCond %{PATH_INFO} ^/datasets/(.*)
> > >> RewriteRule .* -
> > > [C,env=MS_MAPFILE:/srv/datasets/%1]
> > >> RewriteRule .* - [L]
> > >>
> > >> RewriteRule .* - [F]
> > >> </Files>
> > >> </Directory>
> > >>
> > >> <Directory "/srv/datasets/">
> > >> Require all denied
> > >>
> > >> Action mapserver /cgi-bin/mapserv
> > >> AddHandler mapserver .map
> > >> <Files "*.map">
> > >> Require all granted
> > >> </Files>
> > >> </Directory>
> > >> Alias /datasets/ /srv/datasets/
> > >>
> > > Ooo! Nice! How about finding a spot in the docs for that?
> > >
> > >
> > >
> >
> > _______________________________________________
> > Geomoose-users mailing list
> > [hidden email]
> > https://lists.osgeo.org/mailman/listinfo/geomoose-users
>
>
>
> --
> Chris Hughes
>
> GIS Analyst
> Lincoln County Surveyor Department
> 880 NE 7th St. l Newport, OR 97365
> Tel: (541) 574 1283
> _______________________________________________ Geomoose-users mailing
list [hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users




--
Chris Hughes

GIS Analyst
Lincoln County Surveyor Department 
880 NE 7th St. l Newport, OR 97365
Tel: (541) 574 1283

_______________________________________________
Geomoose-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/geomoose-users