Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created December 11, 2012 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geobabbler/4261050 to your computer and use it in GitHub Desktop.
Save geobabbler/4261050 to your computer and use it in GitHub Desktop.
Snippet showing use of FGDB API extension methods
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();
Response.ContentType = "application/json";
object result = this.Content(rval);
return result as ActionResult;
@geobabbler
Copy link
Author

This is an ASP.NET MVC snippet showing the use of ToGeoJSON extension method for the File Geodatabase API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment