public void TestGetClosestWithInvalidPoint()
 {
     using(OSMDataAccessLayer dataAccessLayer = new OSMDataAccessLayer())
     {
         dataAccessLayer.Ways.GetClosestWay(0, 0);
     }
 }
        public void TestGetClosest()
        {
            using(OSMDataAccessLayer dataAccessLayer = new OSMDataAccessLayer())
            {
                var way = dataAccessLayer.Ways.GetClosestWay(38.88688, -9.05550);

                Assert.AreEqual(way.Ref, "A1");
            }
        }
Exemplo n.º 3
0
        public Way GetClosestWay(double lat, double lon)
        {
            DateTime init = DateTime.Now;

            using (OSMDataAccessLayer data = new OSMDataAccessLayer(GetNextConnection()))
            {
                try
                {
                    return data.Ways.GetClosestWay(lat, lon);
                }
                catch (Exception)
                {
                    return null;
                }
            }
        }
Exemplo n.º 4
0
 public Node GetClosestWayNode(double lat, double lon, long wayId)
 {
     using (OSMDataAccessLayer data = new OSMDataAccessLayer(GetNextConnection()))
     {
         try
         {
             return data.Nodes.GetClosestWayNode(lat, lon, wayId);
         }
         catch (Exception)
         {
             return null;
         }
     }
 }
Exemplo n.º 5
0
 public List<Node> GetWayNodes(long wayId)
 {
     using (OSMDataAccessLayer data = new OSMDataAccessLayer(GetNextConnection()))
     {
         try
         {
             return data.Nodes.GetAllFromWay(wayId);
         }
         catch (Exception)
         {
             return null;
         }
     }
 }
Exemplo n.º 6
0
 public Way GetWay(long id)
 {
     using (OSMDataAccessLayer data = new OSMDataAccessLayer(GetNextConnection()))
     {
         try
         {
             return data.Ways.Get(id);
         }
         catch (Exception)
         {
             return null;
         }
     }
 }