Select to view content in your preferred language

ArcIMS - NOAA

1226
4
07-19-2011 11:46 AM
BrianLeroux
Frequent Contributor
I am trying to bring in the layers from NOAA Nowcoast using ArcIMS connection but it is extremely slow due to the number of layers in that connection. They also have WMS but the resolution on some of the items is very bad using WMS. My question is, is there a way to specify which layers I want to bring in to my map using ArcIMS? I appreciate any help.
0 Kudos
4 Replies
BrianLeroux
Frequent Contributor
Steve- Thanks for your reply. I am atempting to use your method but when connecting to the nowcoast.noaa.gov ArcIMS server, it is just locking up AGX for long periods of time. I am not sure why this is happening. Using ArcGIS Desktop I have no issue connecting and layers display fairly quickly.

If anyone has a chance to (or has in the past) connect to http://nowcoast.noaa.gov ArcIMS server, please let me know if it works for you. I have never connected to an IMS server in AGX before. Hopefully there is not a known issue with this.

Thanks..

Dim theMapItem As MapItem
        Dim m_disp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay

        'Define the connection properties 
        Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(ServiceType.Ims, New Uri("http://nowcoast.noaa.gov"), "nowcoast")
        'Create a new ServiceLayer 
        Dim svcLayer As ServiceLayer = New ServiceLayer(connProps)
        'Name Layer
        svcLayer.Name = "Hurricane Track"
        'Connect to Service
        Dim connected As Boolean = svcLayer.Connect()
        'Add the layer to the map.
        'Check to see whether the connection was successful 
        If (connected) Then
            'Add the layer to the map. 
            theMapItem = svcLayer.FindByName("Tropical Cyclone Track Lines")
            If Not (theMapItem Is Nothing) Then
                theMapItem.RemoveFromParent()
                theMapItem = Nothing
            End If
            m_disp.Map.ChildItems.Add(svcLayer)
        Else
            'Investigate connection issue.
            MsgBox("Server Connection Failed!")
            Dim status As ConnectionStatus = svcLayer.ConnectionStatus
            If status.HasError Then
                System.Diagnostics.Debug.Print(status.ErrorString)
            End If

        End If
0 Kudos
BrianLeroux
Frequent Contributor
I just realized that this is to remove layers from the service. I thought it was just choosing which ones to show. I actually need to remove about 100 layers from the srvice. This is not going to be fun. But if it  the only way to do it, so be it.
0 Kudos
BrianLeroux
Frequent Contributor
That worked perfectly on a IMS server hosted by USGS. I can't get it to work on the nowcoast server. It just hangs AGX up. At this point is seems more like an issue with AGX than anything else. As I said before the connection to nowcoast to ArcGIS Desktop works great.
0 Kudos
BrianLeroux
Frequent Contributor
Well I am getting closer. The following code allows me to add only the layers I want. The only problem is that the layers show up in the contents but nothing is on the map display. Any ideas?

 Dim m_disp As MapDisplay = ESRI.ArcGISExplorer.Application.Application.ActiveMapDisplay


        'Define the connection properties 
        Dim connProps As ServiceConnectionProperties = New ServiceConnectionProperties(ServiceType.Ims, New Uri("http://nowcoast.noaa.gov"), "nowcoast")

        'Create a new ServiceLayer 
        Dim svcLayer As ServiceLayer = New ServiceLayer(connProps)
        'Name Layer
        svcLayer.Name = "Hurricane Track"
        'Connect to Service
        Dim connected As Boolean = svcLayer.Connect()

        'Array list of layers to connect to 
        Dim LayerList As New ArrayList()
        LayerList.Add("Tornado Warnings")
        LayerList.Add("Flood Warnings")
        LayerList.Add("Flash Flood Warnings")
        LayerList.Add("Severe Thunderstorm Warnings")
        LayerList.Add("Extreme Wind Warnings")

        'Check to see whether the connection was successful and add layers from Array List
        If (connected) Then
            For Each NOAALayer As String In LayerList
                For Each lyr As ServiceChildLayer In svcLayer.ChildItems

                    If lyr.Name = NOAALayer Then
                        lyr.Visible = True
                        m_disp.Map.ChildItems.Add(lyr)
                    Else
                        lyr.Visible = False
                    End If
                Next
            Next
        Else
            'Investigate connection issue.

            Dim status As ConnectionStatus = svcLayer.ConnectionStatus
            MsgBox("Server Connection Failed!" & status.ErrorString)
            If status.HasError Then
                System.Diagnostics.Debug.Print(status.ErrorString)
            End If

        End If

    End Sub
0 Kudos