예제 #1
0
        public void GetLantiAndLontiTest()
        {
            LanAndLon res = GetLanAndLon.GetLatAndLonByWord("北京");
            LanAndLon ll  = new LanAndLon(39.904030, 116.407526, "北京市", 1);

            Assert.AreEqual(res.lat, ll.lat);
            Assert.AreEqual(res.lon, ll.lon);
            Assert.AreEqual(res.strPlace, ll.strPlace);
        }
예제 #2
0
        public void GetLantiAndLonTest()
        {
            string    title = "新疆克孜勒苏州乌恰县发生3.2级地震 震源深度8千米";
            var       res   = GetLanAndLon.GetLatAndLonByTitle(title);
            LanAndLon ll    = new LanAndLon(39.719310, 75.259228, "新疆维吾尔自治区克孜勒苏柯尔克孜自治州乌恰县", 3);

            Assert.AreEqual(res.lat, ll.lat);
            Assert.AreEqual(res.lon, ll.lon);
            Assert.AreEqual(res.strPlace, ll.strPlace);
        }
예제 #3
0
파일: Crawler.cs 프로젝트: yanwen0614/PM
        protected LanAndLon GetLocation(string Title)
        {
            LanAndLon ll = null;

            ll = GetLanAndLon.GetLatAndLonByTitle(Title);
            String sqlKeyTitleTable = "insert into LocationPOI (Place,Lontitude,Latitude) " +
                                      " values ('" + ll.strPlace + "'," + ll.lon + "," + ll.lat + ")";

            DB.Update(sqlKeyTitleTable);
            return(ll);
        }
예제 #4
0
파일: Crawler.cs 프로젝트: yanwen0614/PM
        protected void UpdateDB(string Title, short casetype, CaseStruct caseStruct)
        {
            var ll = GetLanAndLon.GetLatAndLonByTitle(Title);

            caseStruct.Casetype = casetype;
            caseStruct.Address  = ll.strPlace;
            caseStruct.Lat      = ll.lat;
            caseStruct.Lon      = ll.lon;//数据加载至casestruct
            DB.Update(caseStruct.GetSql());
            InsertTitle2Hashtable(caseStruct.Title);
            UpdateTrainSet(Title, casetype);
        }