ThinkGeo.com    |     Documentation    |     Premium Support

NOAA nowCoast Layer performance

Hello,

We are using more and more NOAA nowCoast layers in our app, and it’s great having the ArcGISServerRestLayer in place to make it easy. However, we find the performance of the layers to be an issue. The layers typically load fairly quickly. Once loaded, however, we encounter noticeable delays with the map redrawing when panning, sometimes up to several seconds. These delays are not noticed with the InMemoryFeatureLayers that we add in the app. We use caching, so after the initial drawing at various zoom levels, subsequent redraws are typically faster, but they still could be better.

Is there any other ways we can improve the performance of these nowCoast layers? Is ThinkGeo working on ways to have the ArcGISServerRestLayer redraw faster?

Thanks,
Dib

Hi Dib,

For NOAA layers, I remembered whenever you pan or zoom, it need to require the new image again from server, the cache don’t works for the scenario.

But in fact we also don’t have more experience about use the NOAA nowCoast layers via ArcGISServerRestLayer, so could you please sent us a simple sample about it, we can watch the behavior and see whether it can get enhancement.

Regards,

Ethan

Ethan,

Here is the code we use now, let me know if you have more questions:

Imports ThinkGeo.MapSuite.Layers

Namespace ArcGISRestLayers

Public Class RecentWeatherRadarArcGIS
    Inherits ArcGISRestLayerBase

#Region " Local Fields "

    Private _arcGISLayer As ArcGISServerRestLayer
    Private _serviceData As New nowCoastServices.RecentWeatherRadarImagery
    Private _layerDataDate As Date
    Private Const LAYER_NAME As String = "radar_meteo_imagery_nexrad_time"
    Private WithEvents _updateTimer As New Timer

#End Region

#Region " Properties "

    Public Overrides ReadOnly Property ArcGISRestLayer As ArcGISServerRestLayer
        Get
            Return Me._arcGISLayer
        End Get
    End Property

    Private _updated As Boolean = False
    Public Overrides ReadOnly Property DataUpdated As Boolean
        Get
            Return Me._updated
        End Get
    End Property

    Public Overrides ReadOnly Property LayerDataDate As Date
        Get
            Return Me._layerDataDate
        End Get
    End Property

    Public Overrides ReadOnly Property UpdateMinutes As Integer
        Get
            Return Me._serviceData.UpdateMinutes
        End Get
    End Property

    Public Overrides ReadOnly Property URL As String
        Get
            Return Me._serviceData.ExportURL
        End Get
    End Property

#End Region

#Region " Ctor "

    Public Sub New()
        Me._updateTimer.Interval = 60000 * 4
    End Sub

#End Region

#Region " Public Methods "

    Public Overrides Sub InitializeService()

        Me.InitArcGISServerRestLayer()

    End Sub

#End Region

#Region " Private Methods "

    Private Sub InitArcGISServerRestLayer()

        Me._updateTimer.Stop()
        Me._updated = False

        Try
            ' Sets our parameters for image format.
            Me._arcGISLayer = New ArcGISServerRestLayer(Me._serviceData.ExportURI) With {
            .ImageFormat = ArcGISServerRestLayerImageFormat.Png8 '; // we can use the Property 'ImageFormat' instead of the 'format' in parameters. When they coexist, the property is perferred.
            }
            AddHandler Me._arcGISLayer.SendingWebRequest, AddressOf Me.Agrl_SendingWebRequest

            ' Sets our parameters for transparency
            Me._arcGISLayer.Parameters.Add("transparent", "true")

            ' Specifies the layerId(s) you wish to display.  0,1,2 etc
            Me._arcGISLayer.Parameters.Add("layers", "show:3") 'layer 3 is the radar graphic without region borders
            'Me._arcGISLayer.Parameters.Add("validtime", Now.AddMinutes(-60))

            ' Specifies the layer and field you wish to query(layerid: field).  in this example, the layerid is 2 and the data field to query is POP1999.
            'arcGisLayer.Parameters.Add("layerdefs", String.Format("2:POP1999{0}", "> 100000"))
            Me._arcGISLayer.IsVisible = True
            Me._layerDataDate = Me.GetImageDate(LAYER_NAME, 3)

        Catch ex As Exception

        End Try

        Me._updateTimer.Start()

    End Sub

    Private Sub GetImage(ByVal URL As String) 'As System.Drawing.Image

        Dim radarURL As String '= "https://nowcoast.noaa.gov/arcgis/rest/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/export"
        radarURL = "https://nowcoast.noaa.gov/arcgis/rest/services/nowcoast/radar_meteo_imagery_nexrad_time/MapServer/export?bbox=-169.8.15.4.-63.5,60.5&bboxSR=&layers=show:3&layerDefs=&size=&imageSR=&format=png&transparent=false&dpi=400&time=&layerTimeOptions=&dynamicLayers=&gdbVersion=&mapScale=&f=image"

        Dim Request As System.Net.HttpWebRequest = Net.HttpWebRequest.Create(radarURL)
        Dim Response As System.Net.HttpWebResponse
        Dim ll As Int16 = 1

        Response = CType(Request.GetResponse, System.Net.WebResponse)
        If Request.HaveResponse Then
            If Response.StatusCode = Net.HttpStatusCode.OK Then
                Dim anImage As Image = System.Drawing.Image.FromStream(Response.GetResponseStream)
                anImage.Save("d: \holder\radar.png")
            End If
        End If

    End Sub

    Private Sub _updateTimer_Tick(sender As Object, e As EventArgs) Handles _updateTimer.Tick
        Me._layerDataDate = Me.GetImageDate(LAYER_NAME, 3)
        Me._updated = True
    End Sub

    Protected Overrides Sub Dispose(disposing As Boolean)
        Me._updateTimer.Stop()
        Me._updateTimer.Dispose()
    End Sub

#End Region

End Class

End Namespace

Namespace nowCoastServices
Public Class RecentGOESWeatherSateliteImagery
Implements InowCoastService

    Private Const URL As String = "https://nowcoast.noaa.gov/arcgis/rest/services/nowcoast/sat_meteo_imagery_time/MapServer"

    Public ReadOnly Property ServiceURL As String Implements InowCoastService.ServiceURL
        Get
            Return URL
        End Get
    End Property

    Public ReadOnly Property ServiceURI As Uri Implements InowCoastService.ServiceURI
        Get
            Return New Uri(URL)
        End Get
    End Property

    Public ReadOnly Property ExportURL As String Implements InowCoastService.ExportURL
        Get
            Return Me.ServiceURL & "/export"
        End Get
    End Property

    Public ReadOnly Property ExportURI As Uri Implements InowCoastService.ExportURI
        Get
            Return New Uri(Me.ServiceURL & "/export")
        End Get
    End Property

    Public ReadOnly Property UpdateMinutes As Integer Implements InowCoastService.UpdateMinutes
        Get
            Return 10
        End Get
    End Property

End Class

End Namespace

        nowCoastRestLayer.InitializeService()

        'add and show
        Me._NOAAOverlay.Layers.Add(nowCoastRestLayer.URL, nowCoastRestLayer.ArcGISRestLayer)
        Me._NOAAOverlay.IsVisible = True

Hi Dib,

Thanks for your code, but I think you should want to upload a simple sample or the class file instead of paste the code in post, it will lose the format and hard to read.

I build a sample based on your code, but it looks I met two problems:

  1. The bounding box format is strange in your test url, so I don’t know what’s the correct extent for map.
  2. When I tried to render the url (https://nowcoast.noaa.gov/arcgis/rest/services/nowcoast/sat_meteo_imagery_time/MapServer/export) by ArcGISServerRestLayer class, it throw 403 forbidden error from server.

Could you please modify the sample so it can reproduce your issue? So our developer can look into this problem.

9115.zip (105.0 KB)

Regards,

Ethan