Sunday, June 10, 2012

Linq2ArcObjects basic version

Introduction

Due to lack of time and also because I have no longer ArcGis desktop on my development environment  I made the code public. This library allows the use of Microsoft  Linq to access rows from attribute tables and feature classes.

To-do’s

I did only limited testing on this library, writing some unit tests could help to stabilize the development of future versions.
A more important job to do is the adding of spatial query possibility. Therefor a special keyword like ‘whereSpatial’ must be added to the Linq syntax.  Not a lot of work, you can look how the attribute query is constructed from the query functionality of the ArcObjects library.  To help the parsing, you have to add special attributes like geometry at the class definition for a feature. This will be needed at the table level and also at attribute level to specify which field contains the geometry contents.

Microsoft has a GUI interface for his Linq to SQL implementation. To eliminate the writing of the table classes, a tool written with ArcObjects engine is useful for generating the classes in C# (or VB.NET). Not a hard job for one that has some experience in processing geodatabases. All information needed in the class definitions is available using ArcObjects methods.
Basic knowledge

The code is written in c#, no VB.NET version is available
You need to have knowledge in the use of attributes defined for classes and properties. Attributes are the driving engine within the Linq parsing.

You need to have knowledge of reading and writing of feature classes. The library can be used with every SDE database. I did no check for the use of file GDB , Access database or shape files.
Code access

I used GIT to make the code public, I did not found another solution. As I am new with GIT , I hope all is correctly transferred.
The repository has the name ‘jpenet / Linq2ArcObjects’ and can be found at https://github.com/
 

Have a lot of programming fun,

Johnny Penet

10/6/2012           Lokeren, Belgium

No comments:

Post a Comment