Beispiel #1
0
 public virtual void GetData(Tuple <double, double, double, double> bbox)
 {
     try
     {
         using (WebClient wc = new WebClient())
         {
             //Main
             string url          = string.Format(baseUrl, 21, FormatBbox(bbox));
             string jsonResponse = wc.DownloadString(url);
             wc.Headers.Add("Content-Type", "application/json");
             ACstormwater_OBJ.ACServices ob = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse);
             DrawPoly(ob);
             //Private
             url          = string.Format(baseUrl, 22, FormatBbox(bbox));
             jsonResponse = wc.DownloadString(url);
             ob           = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse);
             DrawPoly(ob);
             //Abandoned
             url          = string.Format(baseUrl, 23, FormatBbox(bbox));
             jsonResponse = wc.DownloadString(url);
             ob           = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse);
             DrawPoly(ob);
             //Manhole
             url          = string.Format(baseUrl, 13, FormatBbox(bbox));
             jsonResponse = wc.DownloadString(url);
             ACstormwater_OBJ.ACServicesManhole mh = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServicesManhole>(jsonResponse);
             DrawMarker(mh);
         }
     }
     catch
     {
     }
 }
Beispiel #2
0
 public override void GetData(Tuple <double, double, double, double> bbox)
 {
     try
     {
         using (WebClient wc = new WebClient())
         {
             //Main
             string url          = string.Format(baseUrl, 31, FormatBbox(bbox));
             string jsonResponse = wc.DownloadString(url);
             wc.Headers.Add("Content-Type", "application/json");
             ACstormwater_OBJ.ACServices ob = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse);
             DrawPoly(ob);
             //Main
             url          = string.Format(baseUrl, 32, FormatBbox(bbox));
             jsonResponse = wc.DownloadString(url);
             ob           = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse);
             DrawPoly(ob);
             //Main
             url          = string.Format(baseUrl, 33, FormatBbox(bbox));
             jsonResponse = wc.DownloadString(url);
             wc.Headers.Add("Content-Type", "application/json");
             ob = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse);
             DrawPoly(ob);
             //Main
             url          = string.Format(baseUrl, 34, FormatBbox(bbox));
             jsonResponse = wc.DownloadString(url);
             wc.Headers.Add("Content-Type", "application/json");
             ob = JsonConvert.DeserializeObject <ACstormwater_OBJ.ACServices>(jsonResponse);
             DrawPoly(ob);
         }
     }
     catch
     {
     }
 }
Beispiel #3
0
 public virtual void DrawPoly(ACstormwater_OBJ.ACServices ac)
 {
     foreach (ACstormwater_OBJ.ACFeature feat in ac.features)
     {
         foreach (List <List <double> > paths in feat.geometry.paths)
         {
             List <PointLatLng> points = new List <PointLatLng>();
             foreach (List <double> line in paths)
             {
                 PointLatLng point = new PointLatLng(line[1], line[0]);
                 points.Add(point);
             }
         }
     }
 }
Beispiel #4
0
 public override void DrawPoly(ACstormwater_OBJ.ACServices ac)
 {
     foreach (ACstormwater_OBJ.ACFeature feat in ac.features)
     {
         foreach (List <List <double> > paths in feat.geometry.paths)
         {
             List <string> points = new List <string>();
             foreach (List <double> line in paths)
             {
                 points.Add(line[1].ToString());
                 points.Add(line[0].ToString());
             }
             CAD.DrawPlineFrom2PtList("Parcel", points, 0, true);
         }
     }
 }