Skip to content

Instantly share code, notes, and snippets.

@geobabbler
Created December 11, 2012 18:59
Embed
What would you like to do?
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