Created
December 11, 2012 18:59
-
-
Save geobabbler/4261050 to your computer and use it in GitHub Desktop.
Snippet showing use of FGDB API extension methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an ASP.NET MVC snippet showing the use of ToGeoJSON extension method for the File Geodatabase API.