Category: Developer

Coded Value Domains in the Geodatabase

Often, when I am teaching Introduction to Programming ArcObjects using the Java Platform I get questions asking me how to do something.  In particular, a lot of questions come up with respect to the Geodatabase API.  In this article, I’d like to focus on one of the more commonly asked questions I get asked while teaching introductory level programming classes: How to Setup Coded Value Domains!

Before we explore the code for creating coded value domains inside a geodatabase, let’s look at why these domains are valuable to developers.  Probably one of the most common errors inside a database is typos.  It’s really nice when we, as developers, can eliminate these typos or errors at the time the data is entered into the database at creation or while it is being maintained, right?  Well, one such tool that we have in our arsenal is coded value domains.  There are also range domains and subtypes,  stay tuned for future blog postings (hint, hint…).   Domains allow us to pre-define an allowable set of values for a given attribute (i.e. field, column) in our geodatabase.  Why is this important? Well, from the end user’s perspective, they no longer need to type in the value upon data creation or when they update information in a database.  They will actually have a drop down box that will show them the set of possible options to choose from, thus eliminating the possibility of typos.  This gives us greater confidence in the integrity of our databases; however, it’s still possible for an end user to select an incorrect value (but at least it will be spelled correctly, right?).

The question then becomes, “Well, how do I write code to achieve this functionality?”  The answer is simple and can be understood in the following 3 step workflow:

Step 1: Instantiate the coded value domain class

Step 2: Add the domain to the geodatabase (remember that domains are a property of the geodatabase)

Step 3: Apply the domain to the field of interest

These steps give a high-level overview of exactly what we will replicate in code below. 

The following example is going to use a highway network for the entire United States. The data set can actually be found in your samples > data folder that is installed with your Engine SDK.  You can also see the full source code posted on the code gallery at the following location.  In this scenario, we have an attribute titled “ADMIN_CLASS”, which represents an Administration Classificaiton for the different types of highways we have represented in our dataset.  For this example, there are three categories that will be represented with our coded value domain.  First, INT represents Interstate.  Second, SHW, represents State Highway. Finally, UHW, represents US HighwayThe code snippet below will show snippets of code that are used to build this coded value domain and apply it to a field within a feature class inside a geodatabase.

Step 1: Instantiate the coded value domain class.



CodedValueDomain codedValueDomain = new CodedValueDomain();

codedValueDomain.addCode(“INT”, “Interstate”);

codedValueDomain.addCode(“SHW”, “State Highway”);

codedValueDomain.addCode(“UHW”, “US Highway”);


In this step, we simply instantiate our coded value domain and add the codes.

Step 2:  Add the domain to the Geodatabase

workspace.addDomain(codedValueDomain);

In this step, the workspace object is pointing to our geodatabase of interest (see code gallery example for details in the code).

Step 3:  Apply the domain to the field of interest.

//Get the attributes from the feature class
Fields fields = (Fields) featureClass.getFields();

//Get the index position of admin. class. field
int fieldIndex = fields.findField(“ADMIN_CLASS”);

//Get the field to apply the domain
Field field = (Field) fields.getField(fieldIndex); 

//Code to check that field and domain have the same data type…

//Apply domain to the field
featureClass.alterDomain(fieldName, codedValueDomain);

In this step, we need to get the fields from the feature class to figure out what the index position is of the field we wish to apply the domain to.  We then use the findField() to retrieve the index position and use that index position to retrieve the field object representing the administration classification attribute. After doing some checks in the code, we finally set our domain to the field using the alterDomain() on the feature class.

That’s it for building your very own coded value domain.  Hope you find this useful for defining and setting up your own domains in your editing applications.  Next time, I’ll talk about range domains and shortly after subtypes to add even more to your arsenal when trying to keep your database integrity.

-=Steve

Posted in Developer | Leave a comment

ArcGIS Developers: Road Map for the 2009 User Conference

If you’re a developer and you’re headed to the User Conference this year, here’s a “cheat sheet” of the sessions, activities and events that you might be interested in. 

The links below have search filters set so you can browse quickly.  Enjoy!

Sessions – Learn

Here are some of the key developer sessions offered this year.  To view all of the developer sessions, you can search by the Developer track in tracks listing.

Pre-conference Sessions (all day)

Technical Workshops

Demo Theaters

Paper Sessions

Special Interest Groups  Meetings (All)

Islands – Talk to developers

The ESRI development teams are always available to answer questions at the product and developer islands.  We definitely recommend that you visit the islands if you want to chat with ESRI staff about developer products, directions, tools and SDKs or ask specific questions about your own development projects.

Technical Support Island – Get questions answered

This is another great developer resource.  You can walk up and schedule an appointment with ESRI Support and other technical staff to get answers to your developer-related questions.

User Software Applications Fair – Show your applications

If you developed an application for your organization, you might be interested in this contest to showcase your application.  The fair runs Tues-Thursday and there are three categories to enter:

  1. Embedded GIS (Component-based applications e.g. ArcGIS Engine)
  2. Desktop (Applications that extend existing applications e.g. ArcMap extensions)
  3. Web-based (Web browser applications e.g. ArcGIS Server API)

EDN Team  

Posted in Developer | Tagged , , | Leave a comment

Welcome to the Java Resource Center

When I entered college at UCLA, I remember that they had a weekend orientation for incoming freshmen. It was held in the summer before the fall quarter was to begin. It was great – you got to meet other incoming freshmen, make friends, and learn about the processes and procedures. I am not sure I would have ever figured out how to enroll in classes without the help of the orientation. The information was available in manuals and guides but it wasn’t in a form that was easily understood by incoming freshmen and it wasn’t easy to find the information.

That’s what we are trying to do at the Java Resource Center. We have a great community of Java developers and a ton of great information available for Java developers but we have never had an orientation that gets you started. On the Java Resource center we have striven to use language that Java Developers will understand and take you to the content for the most common tasks.

Let me take you through the some of the highlights of the Java Resource Center:

  • The ArcGIS Java Blog is an opportunity for us at ESRI to share best practices, solicit your feedback, and highlight product features that hopefully will make your life easier.
  • The Help tab points you to the latest documentation that’s relevant for Java developers. I personally have this one bookmarked.
  • The welcome page is the page that should help get you oriented, leading you to the resources you need to build web apps, consume soap services, build Swing apps, and extend ArcGIS.
  • The Communities tab takes you to the existing communities we have for the ArcGIS Server Web ADF and ArcGIS Engine. There you will find a code gallery where developers like you are sharing their code, a media gallery from presentations we have given, and forums to get answers to questions.

To complete the welcome to the Java Resouce Center I would like to share a photo of a lot of the development folks working on Java and Unix products at ESRI.

 

Posted in Developer | Tagged , , | Leave a comment

Recovery.gov and the GIS Community – Next Week!

The US economic recovery stimulus plan is underway and Recovery.gov is the online vehicle for keeping everything transparent to the public.  This kind of proactive openness from government is refreshing and confidence building.

But transparency works both ways.  Next week (starting April 27th) the Recovery Accountability and Transparency Board wants to hear from the IT community.  They want more ideas on how the Recovery.gov site can be improved with information technology.

From their site:

“What ideas, tools, and approaches can make Recovery.gov a place where all citizens can transparently monitor the expenditure and use of recovery funds?”

The front page suggests you can mark your calendars and “check back for the web link”.

Your know-how

As GIS professionals and developers, we know how this technology can be used to collect, manage, analyze, display, work with, and disseminate spatial information.  We know how to process data, then present it effectively to the user, giving them simple intuitive tools for seeing what they want to see quickly.  

In short, YOU know what can be added to Recovery.gov to make it better in these ways.  Jump in and tell them how.  And then vote on the ideas.  Represent your interests and those of the GIS community.

Suggestions

Take the conversation beyond simply web mapping and visualization.  That’s a powerful front-end, but GIS is the engine to help determine what to visualize.  Talk about the need for open standards for interoperability, quality data, geographic analysis, modeling, system architecture, and engaging in geospatial workflows that GIS professionals know so well.  Describe how for decades GIS has been a key part of the strong foundation for open government, transparency, and accountability. 

State and local governments have already started.  Maryland is one example of a state leading the way.

Here are ESRI’s ideas and position on how GIS can best help.  This is what ESRI will be bringing to the conversation.

Business opportunities 

Crisis and need feed creativity and innovation, both powerful traits of Americans throughout history.

As these systems are implemented connecting all levels of government, this work also clearly provides new business opportunities for firms doing GIS, especially developers. 

 

What a great way to get involved!  Now is the time.  Be heard.

 

Links

1.  What each state is doing

2.  Facebook Group:  Recovery Dialogue: IT Solutions

3.  Twitter Feed:  @natldialogue    hashtag #RecoveryGIS (new, but let’s start some activity)

 

- EDN Team

 

Posted in Developer | Leave a comment

DevSummit 2009: Post Conference Survey Feedback

Many thanks to the more than 200 attendees who took the time to answer the DevSummit post conference survey. We had a lot of valuable feedback that was both positive and negative for various items at the conference. As for the open-ended questions, we received over 600 unique comments and suggestions. In the end, this feedback will only make next year’s conference even better!

 

Here are some areas you identified that need improvement:

-          There weren’t enough ArcGIS Desktop/non-Web developer sessions

-          Need more advanced sessions describing how-to’s and lessons learned

-          The level and depth of PreSummit session content needs to be reexamined

-          Try not to cram too much material into the sessions

-          Internet connectivity access could have been better

Some areas that you thought went well:

-          The vast majority of attendees (99.5%) would recommend the DevSummit to a colleague

-          Many positive comments about direct access to development teams and other ESRI staff

-          The Keynote speaker David Chappell was a huge hit

-          The User presentations were very positively received and well attended

-          Networking opportunities with other developers

Since the technical sessions are always one of the most valuable resources at the conference, here’s a graph showing what you said about the value of the session content.

 

 

 

We also we received a lot of positive feedback from developers who weren’t able to attend that benefited from information being tweeted by people at the conference. If you missed it, the Twitter account for the summit is @ESRIDevSummit and the hashtag is #devsummit if you want to continue to follow the before, during or after conversations. So, keep your eyes open for more of this type of activity at future conferences, such as the User Conference in San Diego. 

 

Thanks again to all who attended, and if you have something additional to share that will benefit the planning for next year please post a comment.

 

EDN Team

 

 

Posted in Developer | Tagged , | Leave a comment

ArcGIS Resource Centers: Code Gallery Blog Series

We would like to introduce this new blog series for the ArcGIS Resource Centers.

This series focuses specifically on the Resource Center Code Galleries.  It will cover a wide range of topics including tips and tricks on how to use the galleries, posts highlighting new content, website updates, and hints on how to work with the galleries more effectively. 

We’ll also be showcasing some of the best entries here as well, so be sure to stay tuned. 

NOTE: If you are not familiar with the Resource Centers, you may want to review this article to learn more about the key features.

Let’s first get started with a little Q/A. 

What are the code galleries?
What galleries are avaiable?
What can I do with the galleries?
    Browse 
    Search 
    View it Live
    Download
    Upload
    Feedback




What are the code galleries?

The code galleries are an online collaboration tool that you can use to share code and exchange ideas with others in the community. 

If you browse the entries, you’ll find they contain a wide range of applications and samples.  Some are short, specific examples of how to accomplish a given task, while others are more elaborate solutions to real-world problems.  Others include code for applications that were shown in presentations at the DevSummit .  

What galleries are available?

In total, there are 16 galleries available for a number of different developer communities:   

ArcGIS Desktop and Engine: .NET  Java
ArcGIS Server:  .NET ADF  Java ADF  JavaScript API  JSAPI for Google  JSAPI for VE  Flex  Silverlight
ArcGIS Mobile:  .NET

Geoprocessing:
 Model and Script
Business Analyst Extension:  Desktop  Server

Water Utilities: Template
 

 

What can I do with the galleries?
 

Browse for Entries

1.  Navigate to one of the Code Galleries above.
2. 
Select a field (name, rating, date added…) to sort the entries.
3. 
Select the entry itself to get more information.

 

Search for Entries

1.  Navigate to one of the Code Galleries.
2.  Type in a key word in the Search box at the top.

3.  Filter your results by selecting the “Code Gallery” node.

 

View an Entry “Live”
 

1.  Find the sample of interest.
2.  If the “View it Live” link is available, click on the link.

 Tip:  This feature is only enabled if the author who uploaded the entry specified a URL to the application online or a URL to a video that demonstrates how the application works.  



Download an Entry 


1. 
Find the sample of interest.
2. 
Click on the download link.

 

Upload an Entry

1.  Package all of your code, data and a Readme.txt file in one .zip file (max size 30 MB).
2. 
Go to the appropriate code gallery and create a new entry.
3. 
Fill out the information for your submission (title, description and requirements…) and submit.

 

Tip:  You will need to create or login to your ESRI Global Account to upload a sample.  If you don’t have one, go here.  

Leave Feedback
1. Log in with your ESRI Global Account and click the rating star.
2. Leave comments at the bottom of the entry.

 
Tip: If you download code, you might also want to subscribe to the RSS feed so you can be notified of any new comments!  Authors often post helpful information here or they’ll make a post when changes are made to the code or new versions are available. 



In Conclusion

Whether you are just browsing for a solution or you would like the upload and share something with the community, the code galleries are an important resource for everyone. 

Tip:  If you want to know when new entries are made, be sure to subscribe to the RSS feeds for each gallery so you are notified automatically.  

Lastly, if you have any feedback on the galleries, feel free to leave them on the gallery pages themselves or on this post as well. 

Thank you. 
EDN Team 

 

Posted in Developer | Tagged , , | 1 Comment

ArcGIS Developer Poll Results – Most Valued DevSummit Presentation

Thank you for participating in the last survey.  When the final scores were tallied, the Technical Sessions were voted the most valuable, followed by the User Sessions, Plenary Sessions, Presummit Seminars and Demo Theaters.  We were glad to see the User Sessions were highly valued this year!  Hopefully we can offer more next year.

The next poll is coming soon.

EDN Team

 

Posted in Developer | Tagged , , , | Leave a comment

ArcGIS Developers: Status Report #2 on DevSummit 2009 Videos

We are proud to announce that all of the technical session recordings are now posted online and available for viewing. You’ll find the recordings in two locations:

Resource Centers:  The Media Galleries provide the full session descriptions, videos, and links to PowerPoints and code (if applicable) for each presentation.  The videos are categorized by the type of community you are in; for example,  ArcGIS Desktop > DS2009: Introduction to ESRI’s Developer Technologies. 

  • DevSummit Proceedings:  The Developer Summit 2009 proceedings page  provides a master list of all of the recordings.  Each entry links back to the associated video and media in the Media Gallery.If you are looking for a particular video by name, you might find it helpful to search this page first. 

Three user presentations are also viewable, and more will be uploaded this week.  We’ll keep you posted as they become available. Here’s what’s ready today:

Using OpenLayers with ArcGIS Server REST API, presented by James Fee

Building RESTful Apps and Services Using MVC, presented by Brian Noyle

Unit Testing 101: Building Testable Applications, presented by Dave Bouwman

Keep in mind, once you are in the Media Gallery you have two viewing options.  You can either use the embedded Flash Player to view the video at 800 x 600, or you can download the WMV file and watch it locally with the Windows Media Player at a slightly higher resolution of 1024×768.  

Thanks again for your patience and we hope you find these helpful!

EDN Team

Posted in Developer | Tagged , , | 2 Comments

ArcGIS Developer: New name for the ArcObjects Blog

The “ArcObjects Development Blog” has been renamed and is now the “ArcGIS Developer Blog”.   

In this blog, you can expect to find similar posts, but they’ll now have a wider “ArcGIS developer” focus.  This means you’ll find more developer content in the form of How To<’>s and Did you know articles, resource summaries, and highlights about activity in the ArcGIS developer community. 

You’ll also be happy to know that the RSS feed hasn’t changed, so there’s no need to re-subscribe. 

As always, we encourage feedback, so feel free to leave suggestions for future articles as well as comments on posts. 

We’ll also be posting a number of new ArcGIS developer polls, so stay tuned.

Thanks in advance for participating in the online ArcGIS developer community. 

EDN Team

 

 

 

Posted in Developer | Tagged , , | Leave a comment

Status Report on DevSummit 2009 Videos

We know you are anxious to see this year’s DevSummit videos, so we wanted to give you a status report of where we are.  We have just published a number of videos in the Media Galleries and we are still processing a number of others.  We are also still linking the videos to the code galleries, so we appreciate your patience as we get everything wired up for you.

In the galleries you will find following types of videos:

  • Plenary session
  • PreSummit sessions
  • Technical sessions
  • User sessions
  • Demo Theaters*

* Since the demo theaters weren’t recorded, we have made them available as  automated “slide shows”, but they do not have  audio. 

If you don’t see the video you are looking, for then we recommend subscribing to the RSS feed in the Media Gallery of interest to be notified automatically notified of updates.  We expect it will take a week or two to get all of them uploaded. 

Lastly, when you are through watching a video, don’t forget to rate and leave comments!

Enjoy and thanks again for your patience.

EDN Team

 

Posted in Developer | Tagged , , | Leave a comment