public abstract void GetQueryLayers(GISService service, ref List<GISLayerInfo> layers);
 public abstract Task<bool> GetServiceDetails(GISService activeService);
 public abstract bool GetMap(GISService activeService, List<GISLayerInfo> mapLayers, GISEnvelope mapEnvelope, double zoomLevel, string requestString);
 public abstract string GetMapImage(GISService activeService, List<GISLayerInfo> mapLayers, GISEnvelope mapEnvelope, double zoomLevel, int width, int height);
Exemple #5
0
 public string GetMapImage(GISService activeService, List<GISLayerInfo> mapLayers, GISEnvelope mapEnvelope, double zoomLevel, int width, int height)
 {
     return Controller.GetMapImage(activeService, mapLayers, mapEnvelope, zoomLevel, width, height);
 }
 public abstract bool GetMap(GISService activeService, double centerX, double centerY, double zoomLevel);
 public abstract bool GetMap(GISService activeService);
 internal static void AddServiceInfo(GISService service, XmlReader infoReader)
 {
     while (infoReader.Read())
     {
         switch (infoReader.Name)
         {
             case "ENVIRONMENT":
                 break;
             case "PROPERTIES":
                 AddPropertyInfo(service, infoReader);
                 break;
             case "LAYERINFO":
                 service._baseLayers.Add(AddLayerInfo(infoReader, true));
                 break;
         }
     }
 }
 internal static GISLayerInfo Create(GISService activeService, GISEnvelope gISEnvelopes)
 {
     return new OGCLayer() { _id = activeService._serviceName, _isVisible = activeService.IsEnabled, _name = activeService.Name, _baseExtent = gISEnvelopes };
 }
 //public abstract bool ExecuteQuery(GISService activeService, GISLayerInfo queryLayer, GISEnvelope queryEnvelope, int maxFeaturesReturned);
 public abstract void GetImageLayers(GISService service, List<GISLayerInfo> layers);
Exemple #11
0
        internal void RaiseServiceDetailResponse(GISService service)
        {
            Controller.RequestProcessing = false;

            try
            {
                if (OnServiceDetailRequestComplete != null)
                {
                    OnServiceDetailRequestComplete(this, service);
                }
            }
            catch { }
        }
Exemple #12
0
        //public bool ExecuteRequest(string requestXml, List<GISLayerInfo> layers, GISEnvelope envelope)
        //{
        //    return Controller.GetMap(ActiveService, layers, envelope, Controller.SetZoomLevel(envelope, ActiveService._baseExtent), requestXml);
        //}

        public bool SetActiveService(string service)
        {
            if (_services != null)
            {
                var svc = from x in _services where x.Name == service select x;

                if (svc.Count() > 0)
                {
                    _activeService = svc.First();
                    return true;
                }
                else
                {
                    var svc2 = from x in _services where x.Id == service select x;

                    if (svc2.Count() > 0)
                    {
                        _activeService = svc2.First();
                        return true;
                    }
                    else
                    {
                        _activeService = Controller.CreateService(service);
                        _services.Add(_activeService);
                        return true;
                    }
                }
            }
            else
            {
                _services = new List<GISService>();
                _activeService = Controller.CreateService(service);
                _services.Add(_activeService);
                return true;
            }

            //return false;
        }
Exemple #13
0
        public async Task<bool> GetServiceDetails(GISService service)
        {
            //if (service.HasLayers) return true;
            //if (Controller.RequestProcessing)
            //    return false;
            //else Controller.RequestProcessing = true;

            return await Controller.GetServiceDetails(service);
        }
        //public abstract string GetMapLegend(GISService activeService, List<GISLayerInfo> mapLayers, GISEnvelope mapEnvelope, double zoomLevel, int width, int height);
        //http://gis.ncdc.noaa.gov/arcgis/rest/services/basemaps/MapServer/legend
        public GISEnvelope SelectEnvelope(GISService activeService)
        {
            if (activeService.HasLayers) // || GetServiceDetails(activeService))
            {
                if (activeService.ActiveLayers.Count > 0)
                {
                    foreach (GISLayerInfo serviceInfo in activeService.ActiveLayers)
                    {
                        if (serviceInfo.IsVisible && serviceInfo.BaseExtent != null)
                        {
                            return serviceInfo.BaseExtent;
                        }
                    }
                }
                else if (activeService.BaseLayers.Count > 0)
                {
                    foreach (GISLayerInfo serviceInfo in activeService.BaseLayers)
                    {
                        if (serviceInfo.IsVisible && serviceInfo.BaseExtent != null)
                        {
                            return serviceInfo.BaseExtent;
                        }
                    }
                }

                if (activeService.BaseExtent != null)
                {
                    return activeService.BaseExtent;
                }
                else return GISEnvelope.TheWorld;
            }
            else if (activeService.BaseExtent != null)
            {
                return activeService.BaseExtent;
            }
            else return GISEnvelope.TheWorld;
        }
 public abstract bool GetMap(GISService activeService, GISEnvelope mapEnvelope);
        //<PROPERTIES>
        //    <FEATURECOORDSYS string="GEOGCS[&quot;GCS_WGS_1984&quot;,DATUM[&quot;D_WGS_1984&quot;,SPHEROID[&quot;WGS_1984&quot;,6378137.0,298.257223563]],PRIMEM[&quot;Greenwich&quot;,0.0],UNIT[&quot;Degree&quot;,0.0174532925199433]]" id="4326" />
        //    <FILTERCOORDSYS string="GEOGCS[&quot;GCS_WGS_1984&quot;,DATUM[&quot;D_WGS_1984&quot;,SPHEROID[&quot;WGS_1984&quot;,6378137.0,298.257223563]],PRIMEM[&quot;Greenwich&quot;,0.0],UNIT[&quot;Degree&quot;,0.0174532925199433]]" id="4326" />
        //    <ENVELOPE minx="100" miny="-50" maxx="180" maxy="5" name="Initial_Extent" />
        //    <ENVELOPE minx="-180" miny="-80" maxx="180" maxy="80" name="Extent_Limit" />
        //    <MAPUNITS units="decimal_degrees" />
        //    <BACKGROUND color="255,255,255" transcolor="255,255,255" />
        //</PROPERTIES>
        internal static void AddPropertyInfo(GISService service, XmlReader propReader)
        {
            string coords = string.Empty;
            GISEnvelope coordsys = null;

            while (propReader.Read())
            {
                if (propReader.NodeType == XmlNodeType.Element)
                {
                    switch (propReader.Name)
                    {
                        case "FILTERCOORDSYS":
                            if (propReader.MoveToAttribute("id"))
                            {
                                coords = propReader.Value;
                            }
                            break;
                        case "ENVELOPE":
                            coordsys = EsriEnvelope.ProcessEnvelopeNode(propReader);
                            coordsys.CoordinateSystem = coords;
                            break;
                    }
                }
                else if (propReader.NodeType == XmlNodeType.EndElement)
                {
                    if (propReader.Name == "PROPERTIES") break;
                }
            }

            service._baseExtent = coordsys;
        }
 public abstract bool GetMap(GISService activeService, GISEnvelope mapEnvelope, List<GISLayerInfo> mapLayers);
        // {"serviceDescription":"","mapName":"Layers","description":"","copyrightText":"","layers":[{"id":0,"name":"Davidson_County","parentLayerId":-1,"defaultVisibility":true,"subLayerIds":null}],"spatialReference":{"wkid":102113},"singleFusedMapCache":true,"tileInfo":{"rows":256,"cols":256,"dpi":96,"format":"JPEG","compressionQuality":75,"origin":{"x":-20037508.342787,"y":20037508.342787},"spatialReference":{"wkid":102113},"lods":[{"level":0,"resolution":156543.033928,"scale":591657527.591555},{"level":1,"resolution":78271.5169639999,"scale":295828763.795777},{"level":2,"resolution":39135.7584820001,"scale":147914381.897889},{"level":3,"resolution":19567.8792409999,"scale":73957190.948944},{"level":4,"resolution":9783.93962049996,"scale":36978595.474472},{"level":5,"resolution":4891.96981024998,"scale":18489297.737236},{"level":6,"resolution":2445.98490512499,"scale":9244648.868618},{"level":7,"resolution":1222.99245256249,"scale":4622324.434309},{"level":8,"resolution":611.49622628138,"scale":2311162.217155},{"level":9,"resolution":305.748113140558,"scale":1155581.108577},{"level":10,"resolution":152.874056570411,"scale":577790.554289},{"level":11,"resolution":76.4370282850732,"scale":288895.277144},{"level":12,"resolution":38.2185141425366,"scale":144447.638572},{"level":13,"resolution":19.1092570712683,"scale":72223.819286},{"level":14,"resolution":9.55462853563415,"scale":36111.909643},{"level":15,"resolution":4.77731426794937,"scale":18055.954822},{"level":16,"resolution":2.38865713397468,"scale":9027.977411},{"level":17,"resolution":1.19432856685505,"scale":4513.988705},{"level":18,"resolution":0.597164283559817,"scale":2256.994353},{"level":19,"resolution":0.298582141647617,"scale":1128.497176}]},"initialExtent":{"xmin":-9718317.13891344,"ymin":4282403.91976706,"xmax":-9605030.75071575,"ymax":4369195.91072496,"spatialReference":{"wkid":102113}},"fullExtent":{"xmin":-20037507.2295943,"ymin":-19971868.8804086,"xmax":20037507.2295943,"ymax":19971868.8804086,"spatialReference":{"wkid":102113}},"units":"esriMeters","supportedImageFormatTypes":"PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,AI","documentInfo":{"Title":"DavidsonFlood","Author":"agsglobe","Comments":"","Subject":"","Category":"","Keywords":""}}
        // "{\"serviceDescription\":\"\",\"name\":\"IP-0AD00EAF/Davidson_County\",\"description\":\"\",\"extent\":{\"xmin\":1646981.21805573,\"ymin\":587616.749700546,\"xmax\":1822910.26351929,\"ymax\":760697.139667511,\"spatialReference\":{\"wkid\":2274}},\"pixelSizeX\":0.98425,\"pixelSizeY\":0.98425,\"bandCount\":3,\"pixelType\":\"U8\",\"minPixelSize\":0,\"maxPixelSize\":0,\"copyrightText\":\"\",\"serviceDataType\":\"esriImageServiceDataTypeRGB\",\"minValues\":[0,0,0],\"maxValues\":[255,255,255],\"meanValues\":[98.79502,120.31811,101.45624],\"stdvValues\":[51.45737,46.51745,48.35864]}"
        internal static void AddServiceInfo(GISService activeService, JSONObject responseString)
        {
            GISEnvelope layerExtent = null;

            foreach (DictionaryEntry s in responseString.getDictionary())
            {
                switch (s.Key.ToString())
                {
                    case "documentInfo":
                        JSONObject obj = s.Value as JSONObject;
                        activeService._serviceName = obj.getString("Title");
                        activeService._keywords = obj.getString("Keywords");
                        activeService._subjects = obj.getString("Subject");
                        //documentInfo
                        //{
                        //    "Title":"U.S. Monthly Extremes",
                        //    "Author":"National Climatic Data Center, NESDIS, NOAA, U.S. Department of Commerce ",
                        //    "Comments":"",
                        //    "Subject":"",
                        //    "Category":"",
                        //    "AntialiasingMode":"None",
                        //    "TextAntialiasingMode":"Force",
                        //    "Keywords":"monthly"
                        //}
                        break;
                    case "serviceDescription":
                        activeService._description = s.Value.ToString();
                        break;
                    case "name":
                        //activeService._serviceName = s.Value.ToString();
                        break;
                    case "description":
                        activeService._description = string.IsNullOrEmpty(activeService._description) ? s.Value.ToString() : activeService._description;
                        break;
                    case "fullExtent":
                        activeService._baseExtent = EsriEnvelope.Create(s.Value as JSONObject);
                        if (layerExtent == null) layerExtent = activeService._baseExtent;
                        break;
                    case "initialExtent":
                        layerExtent = EsriEnvelope.Create(s.Value as JSONObject);
                        if (activeService._baseExtent == null) activeService._baseExtent = layerExtent;
                        break;
                    case "extent":
                        layerExtent = EsriEnvelope.Create(s.Value as JSONObject);
                        if (activeService._baseExtent == null || activeService._baseExtent.Equals(GISEnvelope.TheWorld)) activeService._baseExtent = EsriEnvelope.Create(s.Value as JSONObject);
                        break;
                    case "layers":
                        activeService._baseLayers = EsriLayer.Create(s.Value as JSONArray);
                        break;
                }
            }

            if (activeService._baseLayers.Count == 0)
            {
                activeService._baseLayers.Add(new EsriLayerInfo() { _baseExtent = layerExtent, _id = activeService._serviceName, _name = activeService._serviceName, _type = "Image" });
            }
            else
            {
                foreach (EsriLayerInfo info in activeService._baseLayers)
                {
                    if (info._baseExtent == null) info._baseExtent = layerExtent;
                }
            }
        }
Exemple #19
0
        public bool GetMap(GISService service, GISEnvelope mapEnvelope, List<GISLayerInfo> mapLayers)
        {
            if (Controller.RequestProcessing)
                return false;
            else Controller.RequestProcessing = true;

            return Controller.GetMap(service, mapEnvelope, mapLayers);
        }