示例#1
0
 public static void DumpResults(PdbResultLocations locations)
 {
     Assert.IsNotNull(locations, "Null locations object.");
     Assert.IsNotNull(locations.Singles, "Null list of singles.");
     Assert.IsNotNull(locations.Clusters, "Null list of clusters.");
     if (locations.Singles.Count == 0)
     {
         Console.WriteLine("Empty singles list.");
     }
     else
     {
         foreach (PdbPropertyLocation single in locations.Singles)
         {
             Console.WriteLine(single);
         }
     }
     if (locations.Clusters.Count == 0)
     {
         Console.WriteLine("Empty clusters list.");
     }
     else
     {
         foreach (PdbClusterLocation cluster in locations.Clusters)
         {
             Console.WriteLine(cluster);
         }
     }
 }
示例#2
0
        public void TestLocationQuery()
        {
            PdbResultLocations locs = _helper.QueryForLocations(null, _publicRoles,
                                                                -8230000, -8200000, 4960000, 4990000, -8306466, -8164248, 4896833, 5040206);

            DumpResults(locs);
            // Should be number of cols in the DB attributes tables, but also one for the primary key.
            Assert.AreEqual(76, locs.Singles.Count, "Wrong number of single (non-clustered) points.");
            Assert.AreEqual(19, locs.Clusters.Count, "Wrong number of clustered point groups.");
        }
        protected override void InternalGET(System.Web.HttpContext context, HandlerTimedCache cache)
        {
            IList <SecurityRole> roles = UserHelper.GetUserRoles(context.User.Identity.Name);

            IList <IExpression> expressions = PropertiesHandler.ParseExpressions(context);

            PdbTwoTableHelper dataHelper = new PdbTwoTableHelper(Config.GetConfig("PDP.Data"), "Properties", PdbEntityType.Properties);

            // x and y are expected in web mercator.
            PdbResultLocations list = dataHelper.QueryForLocations(expressions, roles,
                                                                   WebUtil.ParseDoubleParam(context, "minx"), WebUtil.ParseDoubleParam(context, "maxx"),
                                                                   WebUtil.ParseDoubleParam(context, "miny"), WebUtil.ParseDoubleParam(context, "maxy"),
                                                                   WebUtil.ParseDoubleParam(context, "minBx"), WebUtil.ParseDoubleParam(context, "maxBx"),
                                                                   WebUtil.ParseDoubleParam(context, "minBy"), WebUtil.ParseDoubleParam(context, "maxBy"));

            context.Response.Write(WebUtil.ObjectToJson(list));
        }