示例#1
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));
        }