示例#1
0
 public ActionResult States()
 {
     try
     {
         var           path        = Server.MapPath("/App_Data/mvc_samples.gdb");
         Geodatabase   gdb         = Geodatabase.Open(path);
         Table         statesTable = gdb.OpenTable("\\us_states");
         RowCollection rows        = statesTable.Search("*", "STATE_NAME LIKE 'M%'", RowInstance.Recycle);
         var           rval        = rows.ToGeoJson();
         gdb.Close();
         //gdb.Dispose();
         Response.ContentType = "application/json";
         object result = this.Content(rval);
         return(result as ActionResult);;
     }
     catch { return(null); }
 }