May 15, 2009

Optimizing ArcGIS Server

One of my hobbies is experimental sailboat design. And, with anything worth designing the challenges are circular and interconnected; weight, drag, stability, complexity, reliability, speed, performance. Optimization is the usually the balance of these sometimes diametrically apposed factors. If it’s light weight, it may not be reliable, or stable. If it’s stable it may not be fast or light. If it’s fast it may be too complex, unstable and unreliable. The reward in exploring a design is when I find that overlooked and elusive idea that truly can overcome the previous limitations and provide an uncompromised optimization. A solution where I can do something I could not do before; faster, lighter, stronger, simpler and better.

Although most of the things that make published map documents fast and efficient Map Services are likewise good for ArcGIS for AutoCAD, there are a couple things that ArcGIS Server IT managers should consider that are specific to ArcGIS for AutoCAD users. Technically, ArcGIS for AutoCAD uses the ExportMapImage functionality of ArcGIS Server to interact with map services.

Therefore the first order of server business for ArcGIS for AutoCAD is to ensure I have not disabled the ExportMapImage functionality on my map server. Secondly ArcGIS for AutoCAD needs an ArcGIS Server geometry service to project the coordinates of a cached map services if they are different than the coordinate system of the AutoCAD drawing. I do not need a geometry service if both the cached map service and the drawing are in the same coordinate system or when the map service is generated dynamically. ArcGIS for AutoCAD will look for the geometry service on the same server as the map and if it doesn’t find one it looks elsewhere on the internet. If a geometry service is enabled on my map server projecting cached maps for ArcGIS for AutoCAD is faster, if needed.

Better yet, to avoid problems with grainy maps caused by excessive scaling, or the performance hit for re-projecting maps, it’s a good idea to publish my map service in a coordinate system AutoCAD users are likely to be viewing the map. I may have casual mapping users who can view the map service in a geographic coordinate system since they really don’t care what the coordinates are, but generally AutoCAD users are working projected coordinates, like State Plane or UTM. If I expect I will have ArcGIS for AutoCAD users I might consider publishing maps in their commonly used coordinate systems.

Although caching the maps on my map server is a good way to speed things up for most ArcGIS map service viewing applications, it is not necessarily faster for ArcGIS for AutoCAD which still requires that a map image be created, and because of the threshold of discrete scales being set for cashed maps, the quality of the map image could be better if the map service was left to be generated dynamically.

Some of these optimization settings may be at odds with other ArcGIS Server best practices. Both are valid, I might consider creating two different map services, one for ArcGIS for AutoCAD to use and another for general users if I notice performance, or image quality issues due to projections. In most cases the differences are minor, but in combination, and with a large number of users it could become significant.

May 08, 2009

Editing In ArcGIS for AutoCAD?

I have planted a vegetable garden. I don’t expect it will save me much money on food, but I really enjoy the idea of it. The best places in my yard for growing things are either covered by structures, concrete or trees. To create some more space and to thwart the plans of bugs and weeds, I’ve decided to plant my garden in pots on a terraced rolling cart. It’s like the produce stand in the picture, accept it has bins of plants from which I hope to pick fruits and vegetables.

This may sound obvious, but one thing I’ve learned from past agricultural experiments is that it is best to plant things that I actually like to eat rather than things that are just easy to grow! And it is nice to get plants that can keep producing over time rather than all at once.

If I want to allow someone to use AutoCAD to edit data I have in ArcGIS I can give them an AutoCAD copy of a sub-set of the GIS data using the EXPORT TO CAD tool. Before I export the GIS data I can flag it with a unique code of my own creation. This transaction flag can be nothing more than an integer in a field I call “transaction” or a text field. I like to create a text field, and then use the now( ) expression with the ArcGIS CALCULATE tool to create a time stamp string as my transaction code. This is probably something I should automate using a geoprocessing model; select stuff, ADD FIELD, CALCULATE, etc… EXPORT TO CAD.

A feature class will be created in the AutoCAD drawing according to the mapping specification for drawings, along with the attribute schema for the data.

TIP: I want to make sure to only export a selected set of features to avoid pushing thousands of features back and forth that I have no intention of changing. If I want more data for geographic context, I can publish a map service of the same GIS data with ArcGIS Server. I then use ArcGIS for AutoCAD’s ability to use map services to see the full basemap.
Using the attribute editing tools of ArcGIS for AutoCAD and the AutoCAD graphics engine I make edits to my copy of the geometry and attributes of the exported GIS data. If I trust the edits made in AutoCAD and I am confident that ArcGIS can see the appropriate data in the AutoCAD feature class, I can use those changes to update my GIS data. I want any features that are added, modified or deleted to be updated in the geodatabase appropriately.

Now assume that I really really want the changes I made in the AutoCAD file to replace the existing data flagged by my transaction code and still unmodified in the geodatabase. I select my flagged features with my transaction code in the geodatabase, and DELETE them. I use the modified AutoCAD file to replace the data involved in the transaction with the APPEND tool. New features will be added, modified features will be replaced and deleted feature will not be replaced, and therefore deleted.

This rather crude form of editing should be thoroughly tested in each environment and then only performed on a copy of the production data that is then verified for quality control, before changes are accepted. In this workflow I must also accept the fact that the object identifiers will be changed on all of the features in the transaction including objects that didn’t change, since in this version of the workflow everything you exported was flagged as part of the transaction.

If someone else edits the same data that I intend to be editing in AutoCAD, their edits might be overwritten by mine, or if my transaction flags become out of sync or invalid the workflow could be compromised. It is up to me to manage how transactions like this are flagged and processed. I must clean up after myself and guard the state of the database during transactions. Additional consideration would need to be given for the effects of editing features involved topologies, or networks. The bottom line for this workflow is that I am responsible for everything that happens to the data, there are no built-in safeguards.

On my produce cart now are: blackberries, raspberries, cucumbers, eggplant, carrots, onions, squash and tomatoes, in the fall, strawberries, beans and spinach will be likely additions. I’m making frequent trips to my produce stand for tending, and watering. I will automate the watering with a drip system hooked up to my lawn sprinklers.

I look forward to the harvesting.
FREE hit counter and Internet traffic statistics from