Thanks for your input. I've looked at the DOTS_PER_INCH, but I dont think
it is still a valid parameter in openlayers (at least since the version 6).
But I found out that the arrow density seems to depend on
the devicePixelRatio of the window. As a matter of fact, if I increase
the devicePixelRatio of my browser (to a value similar to the one of my
phone) by zooming it in, I get the same arrow density as the layer
displayed on a smartphone.
So with that information I will be able to create two different sld styles,
one for higher devicePixelRatio (usually smartphones), and one for
lower devicePixelRatio (usually computers).
Thanks everyone for your help!
Julien

Le ven. 9 sept. 2022 à 10:26, Russ Hore <r...@russ-hore.co.uk> a écrit :

> I am no expert in OpenLayers but could the OpenLayers option;
>
> OpenLayers.DOTS_PER_INCH = 25.4 / 0.28;
>
> help? Can it force the DPI to be the same no matter what the Device DPI is.
>
>
> On 9 Sep 2022, at 14:39, Julien Robitaille <robitail...@ogsl.ca> wrote:
>
> By resolution, do you mean the dpi resolution? Or maybe the "resolution"
> of my raster layer (size of georeferenced cells)? The best way to play with
> the concentration of arrows that I found was to play with
> the wms_scale_denominator. So I thought I could make two different sld
> styles, one for computers, and another one for smartphones, with different
> values of wms_scale_denominator. And depending on the screen size and/or
> resolution of screen of the user, one of the two styles would be applied to
> the layer.
> Thanks again,
> Julien
>
> Le jeu. 8 sept. 2022 à 18:16, Jody Garnett <jody.garn...@gmail.com> a
> écrit :
>
>> Please remember to include the user list (so others can answer you) and
>> yeah sorry it does not support pictures.
>>
>> Where is the resolution of your raster determined?
>>
>> Jody
>>
>> On Thu, Sep 8, 2022 at 12:31 PM Julien Robitaille <robitail...@ogsl.ca>
>> wrote:
>>
>>> hello,
>>> As a follow up, I would just need another specification.
>>> Here is the rendering when the dpi is set to 200:
>>>
>>> And here is the rendering when set to 60:
>>>
>>
>> As you can see, the resolution of the image didnt change (same number of
>>> arrows for the same zoom level). Only the size of the arrows have.
>>> Is it the expected result? What I am looking for is a way to decrease
>>> resolution for specific user cases.
>>> Thanks again!
>>> Julien
>>>
>>> Le jeu. 8 sept. 2022 à 12:22, Jody Garnett <jody.garn...@gmail.com> a
>>> écrit :
>>>
>>>> aside: Your messages are being held because of the attached images;
>>>> here is my reply.
>>>>
>>>> The challenge faced here is not particular to geoserver - it is a
>>>> design challenge on how you wish to adapt your map to different
>>>> environments.
>>>>
>>>> You can supply GeoServer with the dpi of the display used  (have
>>>> openlayers pass this information in as a format option) . GeoSerer will
>>>> adjust the sizes appropriately. Much of the other information is available
>>>> as env variables for use when styling.
>>>>
>>>> Reference:
>>>> -
>>>> https://docs.geoserver.org/latest/en/user/services/wms/vendor.html?highlight=dpi#format-options
>>>> -
>>>>
>>>> https://docs.geoserver.org/latest/en/user/styling/sld/extensions/substitution.html#sld-variable-substitution
>>>>
>>>>
>>>> On Thu, Sep 8, 2022 at 8:17 AM Julien Robitaille <robitail...@ogsl.ca>
>>>> wrote:
>>>>
>>>>> Hello!
>>>>> I found out that the difference in size from one zoom level to another
>>>>> one comes from openlayers.
>>>>>
>>>>> But in any cases, what I would like to do is to increase the sizes of
>>>>> the arrows, so it is easier to see. The problem is that the display of
>>>>> those arrows depends a lot on whether the user uses a computer or a
>>>>> smartphone.
>>>>> Here is an example. The first picture is from my computer, and the
>>>>> second one is from my phone.
>>>>> As you can see, the resolution of the arrows is not the same, even at
>>>>> the approximate same zoom level.
>>>>>
>>>>> (images removed)
>>>>>
>>>>
>>>>> As you can see, increasing the size of the arrows would make the app
>>>>> unreadable on the phone.
>>>>> Does anyone know how to address this problem? Is it something that can
>>>>> be fixed by geoserver, or is it more of an openlayers' problem?
>>>>>
>>>>> Thanks a lot for your help!
>>>>> Julien
>>>>>
>>>>> Le mar. 6 sept. 2022 à 10:08, Olivier Gagnon <mcno...@hotmail.com> a
>>>>> écrit :
>>>>>
>>>>>> Hi Julien (je suis aussi du Québec) !
>>>>>>
>>>>>> Have you tried using a fixed value for the Size attribute ?
>>>>>>
>>>>>> ex: <Size>8</Size>
>>>>>>
>>>>>> As I can see in your sld, the size is modified using the Categorize
>>>>>> function.
>>>>>>
>>>>>> Hope this helps. Good Luck!
>>>>>>
>>>>>> Olivier
>>>>>>
>>>>>> Envoyé à partir d’Outlook <http://aka.ms/weboutlook>
>>>>>>
>>>>>> ------------------------------
>>>>>> *De :* Julien Robitaille <robitail...@ogsl.ca>
>>>>>> *Envoyé :* 6 septembre 2022 08:53
>>>>>> *À :* geoserver-users@lists.sourceforge.net <
>>>>>> geoserver-users@lists.sourceforge.net>
>>>>>> *Objet :* [Geoserver-users] proper use of sld to display wms layer
>>>>>>
>>>>>> Hello!
>>>>>> I have a raster layer that displays surface currents.
>>>>>> Everything works great, but there are some details that I wish to get rid
>>>>>> of but dont know how to.
>>>>>> Below, the two pictures show what the layer looks like at a different
>>>>>> zoom level. The first one is zoomed out compared to the second one. As
>>>>>> you can see, the arrows are smaller on the second one. I wish it wasnt 
>>>>>> like
>>>>>> this. I'm trying to make it so that the arrows stay the same size.
>>>>>> I've tried to play around with the wms_scale_denominator property in
>>>>>> my sld, but it doesnt seem to do the trick.
>>>>>>
>>>>>> (images removed)
>>>>>>
>>>>>> Here is my SLD:
>>>>>>
>>>>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>>>>> <StyledLayerDescriptor version="1.0.0"
>>>>>>    xsi:schemaLocation="http://www.opengis.net/sld
>>>>>> StyledLayerDescriptor.xsd"
>>>>>>    xmlns="http://www.opengis.net/sld";
>>>>>>    xmlns:ogc="http://www.opengis.net/ogc";
>>>>>>    xmlns:xlink="http://www.w3.org/1999/xlink";
>>>>>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
>>>>>>   <NamedLayer>
>>>>>>    <Name>currents</Name>
>>>>>>    <UserStyle>
>>>>>>      <Title>currents</Title>
>>>>>>      <FeatureTypeStyle>
>>>>>>        <Transformation>
>>>>>>          <ogc:Function name="ras:RasterAsPointCollection">
>>>>>>            <ogc:Function name="parameter">
>>>>>>              <ogc:Literal>data</ogc:Literal>
>>>>>>            </ogc:Function>
>>>>>>            <ogc:Function name="parameter">
>>>>>>              <ogc:Literal>interpolation</ogc:Literal>
>>>>>>              <ogc:Literal>InterpolationBilinear</ogc:Literal>
>>>>>>            </ogc:Function>
>>>>>>          </ogc:Function>
>>>>>>       </Transformation>
>>>>>>       <Rule>
>>>>>>         <Title>Heading</Title>
>>>>>>         <PointSymbolizer>
>>>>>>          <Graphic>
>>>>>>            <Mark>
>>>>>>              <WellKnownName>extshape://narrow</WellKnownName>
>>>>>>              <Fill>
>>>>>>                <CssParameter name="fill">
>>>>>>                 <ogc:Function name="Categorize">
>>>>>>                   <ogc:Function name="sqrt">
>>>>>>                     <ogc:Add>
>>>>>>                      <ogc:Mul>
>>>>>>                        <ogc:PropertyName>u</ogc:PropertyName>
>>>>>>                        <ogc:PropertyName>u</ogc:PropertyName>
>>>>>>                      </ogc:Mul>
>>>>>>                      <ogc:Mul>
>>>>>>                        <ogc:PropertyName>v</ogc:PropertyName>
>>>>>>                        <ogc:PropertyName>v</ogc:PropertyName>
>>>>>>                      </ogc:Mul>
>>>>>>                     </ogc:Add>
>>>>>>                   </ogc:Function>
>>>>>>                   <ogc:Literal>#e0e2e6</ogc:Literal>
>>>>>>                   <ogc:Literal>0.514</ogc:Literal>
>>>>>>                   <ogc:Literal>#96ade4</ogc:Literal>
>>>>>>                   <ogc:Literal>1.03</ogc:Literal>
>>>>>>                   <ogc:Literal>#376AE2</ogc:Literal>
>>>>>>                   <ogc:Literal>1.542</ogc:Literal>
>>>>>>                   <ogc:Literal>#249D53</ogc:Literal>
>>>>>>                   <ogc:Literal>2.056</ogc:Literal>
>>>>>>                   <ogc:Literal>#F98308</ogc:Literal>
>>>>>>                   <ogc:Literal>2.57</ogc:Literal>
>>>>>>                   <ogc:Literal>#F91A08</ogc:Literal>
>>>>>>                 </ogc:Function>
>>>>>>                </CssParameter>
>>>>>>                <CssParameter name="fill-opacity">
>>>>>>                 <ogc:Function name="Categorize">
>>>>>>                   <ogc:Function name="sqrt">
>>>>>>                     <ogc:Add>
>>>>>>                      <ogc:Mul>
>>>>>>                        <ogc:PropertyName>u</ogc:PropertyName>
>>>>>>                        <ogc:PropertyName>u</ogc:PropertyName>
>>>>>>                      </ogc:Mul>
>>>>>>                      <ogc:Mul>
>>>>>>                        <ogc:PropertyName>v</ogc:PropertyName>
>>>>>>                        <ogc:PropertyName>v</ogc:PropertyName>
>>>>>>                      </ogc:Mul>
>>>>>>                     </ogc:Add>
>>>>>>                   </ogc:Function>
>>>>>>                   <ogc:Literal>0</ogc:Literal>
>>>>>>                   <ogc:Literal>0.001</ogc:Literal>
>>>>>>                   <ogc:Literal>1</ogc:Literal>
>>>>>>                   <ogc:Literal>1000</ogc:Literal>
>>>>>>                   <ogc:Literal>0F</ogc:Literal>
>>>>>>                 </ogc:Function>
>>>>>>                </CssParameter>
>>>>>>             </Fill>
>>>>>>            </Mark>
>>>>>>            <Size>
>>>>>>              <ogc:Function name="Categorize">
>>>>>>                 <!-- Value to transform -->
>>>>>>                <ogc:Function name="sqrt">
>>>>>>                  <ogc:Add>
>>>>>>                   <ogc:Mul>
>>>>>>                     <ogc:PropertyName>u</ogc:PropertyName>
>>>>>>                     <ogc:PropertyName>u</ogc:PropertyName>
>>>>>>                   </ogc:Mul>
>>>>>>                   <ogc:Mul>
>>>>>>                     <ogc:PropertyName>v</ogc:PropertyName>
>>>>>>                     <ogc:PropertyName>v</ogc:PropertyName>
>>>>>>                   </ogc:Mul>
>>>>>>                  </ogc:Add>
>>>>>>                </ogc:Function>
>>>>>>                   <ogc:Literal>13</ogc:Literal>
>>>>>>                   <ogc:Literal>0.514</ogc:Literal>
>>>>>>                   <ogc:Literal>13</ogc:Literal>
>>>>>>                   <ogc:Literal>1.03</ogc:Literal>
>>>>>>                   <ogc:Literal>16</ogc:Literal>
>>>>>>                   <ogc:Literal>1.542</ogc:Literal>
>>>>>>                   <ogc:Literal>19</ogc:Literal>
>>>>>>                   <ogc:Literal>2.056</ogc:Literal>
>>>>>>                   <ogc:Literal>22</ogc:Literal>
>>>>>>                   <ogc:Literal>2.57</ogc:Literal>
>>>>>>                   <ogc:Literal>25</ogc:Literal>
>>>>>>                 </ogc:Function>
>>>>>>            </Size>
>>>>>>            <Rotation>
>>>>>>                <ogc:Function name="toDegrees">
>>>>>>                 <ogc:Function name="atan2">
>>>>>>                    <ogc:PropertyName>u</ogc:PropertyName>
>>>>>>                    <ogc:PropertyName>v</ogc:PropertyName>
>>>>>>                 </ogc:Function>
>>>>>>                </ogc:Function>
>>>>>>            </Rotation>
>>>>>>          </Graphic>
>>>>>>         </PointSymbolizer>
>>>>>>       </Rule>
>>>>>>      </FeatureTypeStyle>
>>>>>>    </UserStyle>
>>>>>>   </NamedLayer>
>>>>>> </StyledLayerDescriptor>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> Thanks a lot for your help!
>>>>>> --
>>>>>>
>>>>>> Julien  Robitaille
>>>>>> Scientifique de données
>>>>>> Data scientist
>>>>>> En télétravail - Working from home
>>>>>>
>>>>>> Visitez notre site web pour en savoir plus sur notre campagne de
>>>>>> communication en cours!
>>>>>> Visit our website to learn more about our ongoing communication
>>>>>> campaign!
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Julien  Robitaille
>>>>> Scientifique de données
>>>>> Data scientist
>>>>> En télétravail - Working from home
>>>>>
>>>>> Visitez notre site web pour en savoir plus sur notre campagne de
>>>>> communication en cours!
>>>>> Visit our website to learn more about our ongoing communication
>>>>> campaign!
>>>>>
>>>>> _______________________________________________
>>>>> Geoserver-users mailing list
>>>>>
>>>>> Please make sure you read the following two resources before posting
>>>>> to this list:
>>>>> - Earning your support instead of buying it, but Ian Turton:
>>>>> http://www.ianturton.com/talks/foss4g.html#/
>>>>> - The GeoServer user list posting guidelines:
>>>>> http://geoserver.org/comm/userlist-guidelines.html
>>>>>
>>>>> If you want to request a feature or an improvement, also see this:
>>>>> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>>>>>
>>>>>
>>>>> Geoserver-users@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>>>>
>>>> --
>>>> --
>>>> Jody Garnett
>>>>
>>>
>>>
>>> --
>>> [image: OGSL Logo] <https://ogsl.ca/>
>>> Julien  Robitaille
>>> Scientifique de données
>>> Data scientist
>>> En télétravail - Working from home
>>> [image: Facebook Logo] <https://www.facebook.com/ogsl.slgo/>    [image:
>>> Twitter Logo] <https://twitter.com/ogsl_slgo/>    [image: LinkedIn Logo]
>>> <https://www.linkedin.com/company/observatoire-global-du-saint-laurent---ogsl/?viewAsMember=true/>
>>> Visitez notre site web pour en savoir plus sur notre campagne de
>>> communication en cours!
>>> Visit our website to learn more about our ongoing communication campaign!
>>> [image: signature-campagne]
>>> <https://ogsl.ca/fr/news/au-coeur-des-donnees/>
>>>
>> --
>> --
>> Jody Garnett
>>
>
>
> --
> [image: OGSL Logo] <https://ogsl.ca/>
> Julien  Robitaille
> Scientifique de données
> Data scientist
> En télétravail - Working from home
> [image: Facebook Logo] <https://www.facebook.com/ogsl.slgo/>    [image:
> Twitter Logo] <https://twitter.com/ogsl_slgo/>    [image: LinkedIn Logo]
> <https://www.linkedin.com/company/observatoire-global-du-saint-laurent---ogsl/?viewAsMember=true/>
> Visitez notre site web pour en savoir plus sur notre campagne de
> communication en cours!
> Visit our website to learn more about our ongoing communication campaign!
> [image: signature-campagne]
> <https://ogsl.ca/fr/news/au-coeur-des-donnees/>
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
>

-- 
[image: OGSL Logo] <https://ogsl.ca/>
Julien  Robitaille
Scientifique de données
Data scientist
En télétravail - Working from home
[image: Facebook Logo] <https://www.facebook.com/ogsl.slgo/>    [image:
Twitter Logo] <https://twitter.com/ogsl_slgo/>    [image: LinkedIn Logo]
<https://www.linkedin.com/company/observatoire-global-du-saint-laurent---ogsl/?viewAsMember=true/>
Visitez notre site web pour en savoir plus sur notre campagne de
communication en cours!
Visit our website to learn more about our ongoing communication campaign!
[image: signature-campagne] <https://ogsl.ca/fr/news/au-coeur-des-donnees/>
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to