Esempio n. 1
0
 public void setup()
 {
     Desc = Helper.Description();
     Assert.That(Desc, Is.Not.Null);
     Map = Helper.Default();
     Assert.That(Map, Is.Not.Null);
 }
        private static Capabilities.WmsServiceDescription GetDescription()
        {
            Capabilities.WmsServiceDescription description
                = new Capabilities.WmsServiceDescription("Acme Corp. Map Server", "http://roadrunner.acmecorp.com/ambush");

            // The following service descriptions below are not strictly required by the WMS specification.

            // Narrative description and keywords providing additional information 
            description.Abstract = "Map Server maintained by Acme Corporation. Contact: [email protected]. High-quality maps showing roadrunner nests and possible ambush locations.";
            description.Keywords = new string[3];
            description.Keywords[0] = "bird";
            description.Keywords[1] = "roadrunner";
            description.Keywords[2] = "ambush";

            //Contact information 
            description.ContactInformation.PersonPrimary.Person = "John Doe";
            description.ContactInformation.PersonPrimary.Organisation = "Acme Inc";
            description.ContactInformation.Address.AddressType = "postal";
            description.ContactInformation.Address.Country = "Neverland";
            description.ContactInformation.VoiceTelephone = "1-800-WE DO MAPS";
            //Impose WMS constraints
            description.MaxWidth = 1000; //Set image request size width
            description.MaxHeight = 500; //Set image request size height

            return description;

        }
Esempio n. 3
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                HttpRequest request = context.Request;
                Uri         uri     = request.Url;
                string      url;
                string      absoluteUri = uri.AbsoluteUri;
                if (uri.Query.Length > 0)
                {
                    string s = absoluteUri.Replace(uri.Query, String.Empty);
                    url = s;
                }
                else
                {
                    url = absoluteUri;
                }

                Map map = MapHelper.InitializeMap();
                Capabilities.WmsServiceDescription description = GetDescription(url);
                WmsServer.ParseQueryString(map, description);
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
                throw;
            }
        }
Esempio n. 4
0
        private static Capabilities.WmsServiceDescription GetDescription()
        {
            Capabilities.WmsServiceDescription description
                = new Capabilities.WmsServiceDescription("Acme Corp. Map Server", "http://roadrunner.acmecorp.com/ambush");

            // The following service descriptions below are not strictly required by the WMS specification.

            // Narrative description and keywords providing additional information
            description.Abstract    = "Map Server maintained by Acme Corporation. Contact: [email protected]. High-quality maps showing roadrunner nests and possible ambush locations.";
            description.Keywords    = new string[3];
            description.Keywords[0] = "bird";
            description.Keywords[1] = "roadrunner";
            description.Keywords[2] = "ambush";

            //Contact information
            description.ContactInformation.PersonPrimary.Person       = "John Doe";
            description.ContactInformation.PersonPrimary.Organisation = "Acme Inc";
            description.ContactInformation.Address.AddressType        = "postal";
            description.ContactInformation.Address.Country            = "Neverland";
            description.ContactInformation.VoiceTelephone             = "1-800-WE DO MAPS";
            //Impose WMS constraints
            description.MaxWidth  = 1000; //Set image request size width
            description.MaxHeight = 500;  //Set image request size height

            return(description);
        }
Esempio n. 5
0
 protected GetFeatureInfo(Capabilities.WmsServiceDescription description, 
     GetFeatureInfoParams @params) : base(description)
 {
     if (@params == null) 
         throw new ArgumentNullException("params");
     _params = @params;
 }
Esempio n. 6
0
        public override void ProcessRequest(IContext context)
        {
            string url = GetFixedUrl(context.Request);

            Capabilities.WmsServiceDescription description = GetDescription(url);
            Map map = GetMap(context.Request);

            WmsServer.ParseQueryString(map, description, 10, null, context);
        }
Esempio n. 7
0
        protected AbstractHandler(HandlerParams @params)
        {
            if (@params == null)
                throw new ArgumentNullException("params");

            this.context = @params.Context;
            this.map = @params.Map;
            this.description = @params.Description;
            this.ignorecase = @params.IgnoreCase;
        }
Esempio n. 8
0
        /// <summary>
        ///     Gets the description
        /// </summary>
        /// <param name="url"></param>
        /// <returns></returns>
        private Capabilities.WmsServiceDescription GetDescription(string url)
        {
            var description = new Capabilities.WmsServiceDescription("Map Server", url)
            {
                MaxWidth  = 0,
                MaxHeight = 0,
                Abstract  = "Map Server.",
                Keywords  = new[] { "cuba", "roads", "poi" }
            };

            return(description);
        }
Esempio n. 9
0
        protected AbstractHandler(HandlerParams @params)
        {
            if (@params == null)
            {
                throw new ArgumentNullException("params");
            }

            this.context     = @params.Context;
            this.map         = @params.Map;
            this.description = @params.Description;
            this.ignorecase  = @params.IgnoreCase;
        }
Esempio n. 10
0
 internal static Capabilities.WmsServiceDescription Description()
 {
     Capabilities.WmsServiceDescription desc = new Capabilities.WmsServiceDescription("Test Server", "http://localhost/sharpmap");
     desc.MaxWidth  = 500;
     desc.MaxHeight = 500;
     desc.Abstract  = "SharpMap Test Server";
     desc.Keywords  = new[] { "sharpmap", "test", "server" };
     desc.ContactInformation.PersonPrimary.Person       = "John Doe";
     desc.ContactInformation.PersonPrimary.Organisation = "SharpMap Inc";
     desc.ContactInformation.Address.AddressType        = "postal";
     desc.ContactInformation.Address.Country            = "Neverland";
     desc.ContactInformation.VoiceTelephone             = "1-800-WE DO MAPS";
     return(desc);
 }
Esempio n. 11
0
 private static Capabilities.WmsServiceDescription GetDescription(string url)
 {
     Capabilities.WmsServiceDescription description = new Capabilities.WmsServiceDescription("Acme Corp. Map Server", url);
     description.MaxWidth  = 500;
     description.MaxHeight = 500;
     description.Abstract  = "Map Server maintained by Acme Corporation. Contact: [email protected]. High-quality maps showing roadrunner nests and possible ambush locations.";
     description.Keywords  = new[] { "bird", "roadrunner", "ambush" };
     description.ContactInformation.PersonPrimary.Person       = "John Doe";
     description.ContactInformation.PersonPrimary.Organisation = "Acme Inc";
     description.ContactInformation.Address.AddressType        = "postal";
     description.ContactInformation.Address.Country            = "Neverland";
     description.ContactInformation.VoiceTelephone             = "1-800-WE DO MAPS";
     return(description);
 }
Esempio n. 12
0
 private static Capabilities.WmsServiceDescription GetDescription(string url) 
 {
     Capabilities.WmsServiceDescription description = new Capabilities.WmsServiceDescription("Acme Corp. Map Server", url);
     description.MaxWidth = 500;
     description.MaxHeight = 500;
     description.Abstract = "Map Server maintained by Acme Corporation. Contact: [email protected]. High-quality maps showing roadrunner nests and possible ambush locations.";
     description.Keywords = new[] { "bird", "roadrunner", "ambush" };
     description.ContactInformation.PersonPrimary.Person = "John Doe";
     description.ContactInformation.PersonPrimary.Organisation = "Acme Inc";
     description.ContactInformation.Address.AddressType = "postal";
     description.ContactInformation.Address.Country = "Neverland";
     description.ContactInformation.VoiceTelephone = "1-800-WE DO MAPS";
     return description;
 }
Esempio n. 13
0
 public override void ProcessRequest(HttpContext context)
 {
     try
     {
         HttpRequest request = context.Request;
         string      url     = GetFixedUrl(request);
         Capabilities.WmsServiceDescription description = GetDescription(url);
         Map map = this.GetMap(request);
         WmsServer.ParseQueryString(map, description, 10, null);
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex);
         throw;
     }
 }
Esempio n. 14
0
        public HandlerParams(HttpContext context, Map map,
                             Capabilities.WmsServiceDescription description,
                             bool ignoreCase)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }
            if (map == null)
            {
                throw new ArgumentNullException("map");
            }

            this.context     = context;
            this.map         = map;
            this.description = description;
            this.ignoreCase  = ignoreCase;
        }
Esempio n. 15
0
        public void ProcessRequest(HttpContext context)
        {
            try
            {
                HttpRequest request = context.Request;
                Uri         uri     = request.Url;
                string      url;
                string      absoluteUri = uri.AbsoluteUri;
                if (uri.Query.Length > 0)
                {
                    string s = absoluteUri.Replace(uri.Query, String.Empty);
                    url = s;
                }
                else
                {
                    url = absoluteUri;
                }
                Capabilities.WmsServiceDescription description = GetDescription(url);

                Map    map;
                string type = request.Params["MAP_TYPE"];
                if (String.Equals(type, "OL", StringComparison.InvariantCultureIgnoreCase))
                {
                    map = MapHelper.OpenLayers();
                }
                else if (String.Equals(type, "PM", StringComparison.InvariantCultureIgnoreCase))
                {
                    map = MapHelper.PolyMaps();
                }
                else
                {
                    string format = String.Format("unsupported map type: '{0}'", type);
                    throw new NotSupportedException(format);
                }
                WmsServer.ParseQueryString(map, description);
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
                throw;
            }
        }
Esempio n. 16
0
 public GetFeatureInfoPlain(Capabilities.WmsServiceDescription description,
                            GetFeatureInfoParams @params) : base(description, @params)
 {
 }
Esempio n. 17
0
 public GetFeatureInfoPlain(Capabilities.WmsServiceDescription description) :
     base(description)
 {
 }
Esempio n. 18
0
 protected AbstractHandler(Capabilities.WmsServiceDescription description)
 {
     _description = description;
 }
Esempio n. 19
0
 public GetMap(Capabilities.WmsServiceDescription description) :
     base(description)
 {
 }
Esempio n. 20
0
 public HandlerParams(HttpContext context, Map map,
                      Capabilities.WmsServiceDescription description) :
     this(context, map, description, true)
 {
 }
Esempio n. 21
0
 protected AbstractHandler(Capabilities.WmsServiceDescription description)
 {
     _description = description;
 }
Esempio n. 22
0
 protected AbstractGetFeatureInfoText(Capabilities.WmsServiceDescription description,
                                      GetFeatureInfoParams @params) : base(description, @params)
 {
 }
Esempio n. 23
0
 protected GetFeatureInfo(Capabilities.WmsServiceDescription description) :
     this(description, GetFeatureInfoParams.Empty)
 {
 }
Esempio n. 24
0
 protected AbstractGetFeatureInfoText(Capabilities.WmsServiceDescription description) :
     base(description)
 {
 }