Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colored_fat_arrows vector style #163

Closed
tdrwenski opened this issue Feb 13, 2024 · 6 comments
Closed

Colored_fat_arrows vector style #163

tdrwenski opened this issue Feb 13, 2024 · 6 comments

Comments

@tdrwenski
Copy link
Contributor

Hi,

I am passing on a request from a TDS user who wants a colored fat arrow vector style, would appreciate any feedback you have on if this is currently possible or requires a new style to be added to edal-java! Thanks!

While I used to prefer the "stumpvec" vector style in TDS4 / ncWMS, there
is no equivalent in TDS5 / ncWMS2. It would presumably be named
"colored_fat_arrows" if vailable, but no such option exists. Instead, the
only colored arrow options are:

  1. colored_sized_arrows
  2. colored_sized_meteorological_arrows
  3. colored_wind_barbs

While there is un-colored "vector_fat_arrows", what I would much prefer
is a "colored_fat_arrows" option. This would be most similar to the prior
"stumpvec" option. What is nice about this are the fatter arrows, which are
easier to see on the map. Furthermore, the sizing of arrows in
"colored_fat_arrows" is redundant for conveying magnitude information since
this is already achieved with the color variations.

So, could a "colored_fat_arrows" style please be added? This would be much
appreciated, as we use "stumpvec" across our various website product pages
and mapping portals. I think it would much improve the visibility of the
vector arrows. Thanks for your time!

@pacioos
Copy link

pacioos commented Feb 15, 2024

One small correction to the ticket. We should have written, "Furthermore, the sizing of arrows in 'colored_sized_arrows' is redundant...". Would really appreciate having the "colored_fat_arrows" option added sooner rather than later. It's likely the last critical hang-up before we can promote TDS5 at our data center, since we relied heavily on the equivalent "stumpvec" style in TDS4/ncWMS 1.x across our various websites. Many thanks in advance for your time and support of this, Reading and Unidata!

@guygriffiths
Copy link
Contributor

guygriffiths commented Feb 15, 2024

You can do this by dropping a new colored_fat_arrows.xml style into your .ncWMS2/.styles directory, and restarting the servlet. The following is just colored_size_arrows with the min and max sizes set to 8 (which is the same as fat_arrows):

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.1.0" xsi:schemaLocation="http://www.opengis.net/sld
StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc"
xmlns:se="http://www.opengis.net/se" xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:resc="http://www.resc.reading.ac.uk">
  <NamedLayer>
    <se:Name>$layerName-dir</se:Name>
    <UserStyle>
      <se:CoverageStyle>
        <se:Rule>
          <resc:ColoredSizedArrowSymbolizer>
            <se:Opacity>$opacity</se:Opacity>
            <resc:ArrowSizeField>$layerName-mag</resc:ArrowSizeField>
            <resc:ArrowColourField>$layerName-mag</resc:ArrowColourField>
            <resc:ArrowMinSize>8</resc:ArrowMinSize>
            <resc:ArrowMaxSize>8</resc:ArrowMaxSize>
            <resc:Range>
              <resc:Minimum>$scaleMin</resc:Minimum>
              <resc:Maximum>$scaleMax</resc:Maximum>
              <resc:Spacing>$logarithmic</resc:Spacing>
            </resc:Range>
            <se:ColorMap>
              <resc:Segment fallbackValue="$bgColor">
                <se:LookupValue>Rasterdata</se:LookupValue>
                <resc:BelowMinValue>$belowMinColor</resc:BelowMinValue>
                <resc:ValueList>
                  <se:Name>$paletteName</se:Name>
                </resc:ValueList>
                <resc:AboveMaxValue>$aboveMaxColor</resc:AboveMaxValue>
                <resc:Range>
                  <resc:Minimum>$scaleMin</resc:Minimum>
                  <resc:Maximum>$scaleMax</resc:Maximum>
                  <resc:Spacing>$logarithmic</resc:Spacing>
                </resc:Range>
                <resc:NumberOfSegments>$numColorBands</resc:NumberOfSegments>
              </resc:Segment>
            </se:ColorMap>
            <resc:ArrowStyle>FAT_ARROW</resc:ArrowStyle>
          </resc:ColoredSizedArrowSymbolizer>
        </se:Rule>
      </se:CoverageStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

Let me know how you get on with it.

@tdrwenski
Copy link
Contributor Author

Thanks for that example @guygriffiths, that is super helpful! I think we may need to add a style directory to the TDS's WMS settings so we can test this out but that should be simple.

@marceloandrioni
Copy link

Hello @tdrwenski, I saw this discussion and would like to make a sugestion. Besides the style directory, it would also be useful to allow the configuration of the Godiva3 viewer in TDS. In the standard ncWMS2/EDAL, this can be done using the godiva3.properties as described here under the "Configuring Godiva3" topic.
One benefit from this would be to allow a TDS admin to set up a different base layer in Godiva3 (from OpenStreetMap, Stamen, Esri, local GeoServer, etc). This way, if there was a problem with the default base layer access (hosted on a Reading server), a different layer could be used.

Thank you.

@tdrwenski
Copy link
Contributor Author

Hi @marceloandrioni, thanks for the suggestion. I have made an issue for is here: Unidata/tds#469

@tdrwenski
Copy link
Contributor Author

Thanks again for the example @guygriffiths! We got it working with the TDS now and it looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants