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); }
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); }
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); }
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); }