Archive for July, 2006

In which I become assimilated

TheBorgAs some of you know, I have been a Java programmer for over 5 years and I have enjoyed programming in that language. There have been times when people have tried to entice me to switch to a Microsoft language and I have always said no. Well today I am writing code in C#. Although it is hard for me, I am going to try and keep my complaining to a minimum. I will probably be doing most of my future development in C# (.NET 2.0). Here are my reasons for switching:

  1. I am going to need to extend ArcGIS desktop as a good chunk of my daily work, which is not currently supported with Java
  2. My new employer is strictly an MS house. I know I can write Java on MS OS’s but it is not quite as tight as MS integration.
  3. I will probably not be doing much web dev anymore, mostly desktop applications. Maybe some web services, though I doubt it. In addition to working with ArcGIS I will also be working with Excel, Access, and SQL Server and it is all just easier if I use MS products.

I chose C# because it’s syntax is close enough to Java that I should be in good shape for understanding the core language.

Before I ask my questions first some quick comments.

  1. I am sad about cutting back on the amount of Java I use. I may still do some Java work since the Libraries for individual based simulations and spatial functions (gratuitous link to the Ramsey .NET discussion) are more robust and mature in Java. I will be doing some of that work so I will turn to Java for that.
  2. Man! MS development is expensive. Java developers are truly spoiled by great low-cost (best IDE ever!) or free IDEs with a ton of great libraries and free and open source libraries/application servers/cool stuff. I know some of this is coming to .NET land but they have a long way to go. Seems like most things in this universe cost, and some cost quite a bit.
  3. It makes me feel a bit dirty - there I said it. Its not a big deal and I am almost over it already but still. This must be what it feels like someone who is a Red Sox fan becoming a Yankees fan (though that is probably a bigger deal).

So now on to my questions

  1. I knew a bunch of the places to hang out in Java land but I don’t know them yet in .NET land. I hear that MSDN, The Code Project, and GotDotNet are some good places to hang out. Are there others? Is there an IRC channel for people interested in .NET on freenode. I assume #mono might be one place but are there others?
  2. Is there a good place to go to understand Visual Studio 2005? There are a lot of books and tips on C# but not much giving a tour on how to work with VS2005. Since so much seems to depend on how MS wants you to work I would like to understand VS better - solution files, projects, GACs, registry settings, adding Assemblies… Can someone help a brutha out.
  3. What is the embedded db for .NET 2005 (what do I use on my WinCE device)?

And a final word to my Java developer compatriots who may ask “how could you do it?” Well this morning I went out into the field and picked up 3 life list birds: Ash Throated Flycatcher, the White-Tailed Kite, and Yellow-billed magpie. Last week I ran animal habitat models for habitat conservation planning. This week I am designing and working on a geodatabase for a nature preserve. So while I like Java, I love my new work.

C’mon now add to the GIS blogosphere and answer some of my questions or leave some other pithy comment that I shall ponder for hours…

Helpful tools for doc’ing geodatabases

This is more of a bookmark to myself. Found these on ArcScripts, first is Geodatabase Designer 2, put out by ESRI’s Richie Carmichael. Does a very nice job of spitting out the XML (or HTML) that documents the contents of the GeoDB in excruciating (a.k.a. helpful) detail. The next is Geodatabase Diagrammer for ArcGIS 9, originally written by Mr. Zeiler (a.k.a. author of the best book to the ESRI way of viewing the world) which was updated by Greg Nichols for Arc 9. This utility help you make those pretty GeoDB diagrams.

Both of these work swimmingly unless there is an error in the geodb in which case they spit out an error and stop or just crash (in order by application). Where are the utils for fixing corrupted PGDBs?

Reverse Engineering a geodb

Can’t be done. Good to know but disappointing. That was another one of the nice parts of the ER modelling in Visio - point it at the DB, click a button, viola, instant ER Diagram.

Just found a good post by Dave B. where he talks about the same problem. He went down the comparing XML route to look for changes but he still doesn’t get pretty pictures in the UML diagram.

What I want is to be able to use the existing geodb as a starting point for the UML and then modify the diagram to create my new schema. I just want UML roundtripping for geodatabases - is that so wrrronnggg…

Public Service Announcement on XMI export from Visio 2003

For those of you interested in designing your GeoDB schemas in Visio 2003, please be aware of two issues.

  1. By default the install in ArcGIS does not put the files in the right place to enable XMI export. There is a tech doc on this as this is a know issue.
  2. They do forget to mention that you need to copy the DTD, found in the same folder as the add-on, to the same location as your exported XMI. (Update: this information is documented on the data models tips  and tricks site).

I know we need to use UML here since you can even diagram Feature Class Extensions, Domains, and other “Cool Behavior ” ™, but ER diagrams are so much easier. I used to use Visio 2000 Ent for all my DB diagramming since I am a visual person by default. I have also found it easier working with clients when you show them a picture of their DB rather than just saying “well, there is a table for this and a table for that”. Relationships are much easier to visualize than describe, especially when things get complicated.

On Geo-Business Objects and Dave’s excellent post

Dave has an interesting post about working with data in a geodatabase but “avoiding” the geodatabase API (Dave Bouwman - Geodatabase Kung-Fu: Geo-Business Objects). I had been grappling with this recently as I start to take on a project that has data in a personal GeoDB and a plain old Access Db. I wanted them to be in the same DB since eventually I would like to move this into SQL server.

The dilema for me is that ArcObjects is not “friendly” when working with just plain tables, as compared to some of the cooler Object-Relational technology out there. I used to use hibernate on my Java projects before doing GeoDB work. I loved the way it removed the need to have SQL anywhere in my code. I was using an Object oriented language and I liked how my compiler helped me to code faster, why would I want to drop into relational world (SQL) where all my interactions were through strings.  ArcObjects provides that Object Relational mapping since I work with Objects (IFeature or ITable) to manipulate things in the GeoDB. But there are two problems it presents for me:

1) It is overkill for non-spatial tabular work and is not “standard” in either Java or .NET.  Both of these languages have data structures and forms that know how to work with them. You have to basically write code to translate from ArcObjects data to the way you want it to be for representation.

2) To use the GeoDB API you need to purchase a license from ESRI. If all I want is a form to edit some of the tabular data why would I have to buy an Engine (or Engine GeoDB) license so that my code knows how to interact with the GeoDB. It makes sense that people who will be editing spatial information would use ArcGIS to do that work and that they would have a license. But people just typing information into a form should not need a license for that work.

So I asked around and it seems like I can edit tabular data (and even the tabular part of feature data) without using the ArcObjects API. This makes my life much easier. I can still write code to interact with the non-spatial data in the GeoDB that doesn’t use ArcObjects. Please share your stories if you have done this type of work.

It looks like Dave has taken on wrapping the ArcObject calls so that you can isolate the ArcObjects in a layer of your code and then expose more traditional .NET objects higher up. I think this is a great idea if you have the staff and time to pull it off. He earns extra points for using the XML schema exported from Catalog as the basis for code generation. The drawback here is that you still need a license and install from ESRI to work with this code. I know Dave is in Server land so this is not as big an issue for him.

For me, I could have GIS people updating the Features in the geodb (they have an ESRI license) and field people entering non-spatial data (they don’t need an ESRI license on their machine). This is why I want plain .NET or Java interaction with the attribute data. I don’t want to have to install Engine on a machine just so people can enter tabular data in a form.

In the continuum from pure ArcObjects in all your code to Dave’s approach to pure .NET or Java interaction, there has to be some guidelines or more ideas on when it makes sense (size of project, size of staff, how dependent you want to be on an ESRI license…)

I would love to hear what other people are doing. It seems like most bloggers are Server or IMS developers. I have left that area for now and I would love to also hear from Desktop/SDE people. How do you handle this tension between ESRI’s desire for everything to be in the GeoDB and not wanting to use a Sledgehammer to nail together a birdhouse?

On a related note I would also like to hear stories about using a Personal GeoDB for both ArcGIS work and plain old Access work. Has anyone pulled it off successfully? Co-workers here are quite suspicous that I can do this and not hose the GIS data. I want to use the relationships and forms in Access to build the non-spatial data entry piece.

Forget av 1 - I want my ArcInfo Workstation

Some are calling for the return of ArcView 1 or something simple - forget that! I want Workstation and Coverages. Some of you might say it is archaic and didn’t have the slick gui - well for the “elites” that part doesn’t matter.

Here is why I want workstation back:

  1. First and foremost - it was rock solid
  2. It was fast
  3. Coverages were relatively easy to work with - I have spent most of the day grappling with corrupted shapefiles and I don’t really have a way to fix them.
  4. I didn’t have to grapple with VBA and COM just to script some repetitive work - yeah yeah python and toolboxes would be ok if I felt like Geoprocessing did what is was supposed to do.
  5. There was no corrupt registry settings
  6. I loved the shelf full of documentation. The doc was complete and told me what I needed to know - and they were printed out for me. I really dislike reading off a screen.
  7. It ran on some platforms I still want to use. I would love to be working on Solaris and ESRI is basically the main one holding me back.

There is my nostalgic wish for the day. There are parts I love about ArcMap/ArcCatalog - but having things crash on me and not behave as expected really harshes my mellow…

I know I said I wouldn’t rant but ArcMap is making me cranky right now and I had to get some of it off my chest. I’m looking to the blogsphere for a little lovin’ to cure my crankiness. Somebody leave me a funny comment so I can laugh it off…

I know it’s no longer mine

James has his 9.2 pre-release disks on his desk and I know I no longer work there, but it is fun to watch a product go out in the world that I had a small part (and I mean small) part to work on. I can’t wait to use it as a user…sigh…guess I now have to wait like everyone else.

Released on his own recognizance

My blog went dark since my hosting acct expired and I never really felt like renewing. Let me just give a short but sweet update…

  1. I no longer work for ESRI, I am doing Conservation Biology now for a consulting firm. I decided I like eating sausage more than I like making it.
  2. I am still programming and using ESRI products but it will only be part of my work. The other part will be doing more of what I love in a different field. My PhD is in Ecology and I am going to get a chance to use it.
  3. If you are only interested in GIS stuff be sure to subscribe to the GIS feed because I plan on writing some GIS stuff but not only GIS stuff
  4. Since I am under new management I am going to make this more of a personal blog. I never spoke for ESRI before and I certainly do not speak AT ALL for my new employer.
  5. That being said there will be no juicy office politics aired here and I am going to try to focus on being constructive rather than just snarking. I know I am foregoing some hits but oh well.
  6. I am going to work on the theme some and the widgets so expect changes to the look and feel

With all that said I will now return to my generally unintersting posts arriving at an irregular and far-too-long-between-post frequency.