Tuesday, September 15, 2009

Comprehensive Look at the Geoweb (Part 3 and 4)

The the story continues... I have been off and on the buzzword "Geoweb" for several years. I am now back on it so I set out to try and take a real look at the Geoweb, at least for the sake of academics. The term is bantered about a bunch and we all have our own take on what it really is. My goal was to try to comprehensively define the geoweb based on well documented patterns, models and architectures that currently exist within the web (part 1 and part 2 of this 4 part series) as well as from a purely organic perspective. Here are the slides that were used for this discussion. I can post my lectures as well if anyone is interested.



In summary, I came up with what I think is a very nice analogy in an attempt to somehow concisely define the Geoweb. I use the analog of an ecosystem defined as:

“An ecosystem is a natural unit consisting of all plants, animals and micro-organisms (biotic factors) in an area functioning together with all of the physical (abiotic) factors of the environment. Ecosystems can be permanent or temporary. An ecosystem is a unit of interdependent organisms which share the same habitat. Ecosystems usually form a number of food webs…” (Ecosystem, 2009)

Using this, we can begin to crosswalk components of the geoweb to the notion of an ecosystem. The geoweb as a unit of something finite, is composed of biotic and abiotic factions. Biotic factors including users, participants, perceptions (top-down vs. bottom-up), change and usability. Abiotic factors such as architectures, standards, formats, specs, platforms, etc... There are a number of relationships that exist between these factors, each with their own microprocesses but all interdependent in varying ways. Finally, portions of the the geoweb are permanent and some are temporary, depending on all of the factors (and their associated relationships) listed above.

If nothing else, have a look at the references cited section at the end of the slides. It includes alot of great materials from many leaders in the community that are worthwhile having a look at.


Ecosystem. (2009, August 26). In Wikipedia, The Free Encyclopedia. Retrieved 17:10, August 26, 2009, from http://en.wikipedia.org/w/index.php?title=Ecosystem&oldid=310197121

Monday, August 31, 2009

Tips and Tricks For the Geo Soloist

Imagine this scenario, a well educated, highly trained GIS/Geo professional is working for a small organization (county, environmental consulting, NGO, small federal agency, startup etc). Characteristics of such an organization typically include small budgets, pressure to maximize ROI of the organizations geospatial infrastructure, minimal resources (few people), you get the idea. This person is faced with meeting internal needs, typically required to perform the geoanalyses aligned with the organization's fundamental business processes ("I need a map off...") and is also tasked with presenting the valuable collection of geospatial products the small organization produces to the world. This professional is also commonly faced with requests from management that are typically articulated with something like:

"Hey GeoPro, I saw this great something or other at a business luncheon today, can we do that with our stuff."

If this scenario sounds familiar, you may be a Geo Soloist. Generally speaking, a Geo Soloist works completely independently of the rest of the business process and are seen by other professionals within the organization as the "technology guy/gal" or "web guy/gal" or "GIS guy/gal." They work in professional cultures that really don't understand the Geo trade, and typically work closely with non-Geo specialists such as scientists or engineers. A Geo Soloist can be thought of as a "jack of all trades" a "master of none" or a "polymath," commonly required to play the role of GIS analyst, business analyst, project manager, developer, DBA and evangelist, depending on the current project's needs or the issue of the day.

Italian polymath Leonardo da Vinci, scientist, mathematician, engineer, inventor, anatomist, painter, sculptor, architect, botanist, musician and writer.

The role of Geo Soloist is not for the faint of heart. It can be challenging and frustrating in that it requires compromises, minimized expectations, and can be disadvantageous. However, it is also a gift. It provides the opportunity to tackle a wide range of problems, provides a wide spectrum of experiences, and fosters resourcefulness, agility and ingenuity.

Serving as a Geo Soloist for many years, I have come up with a manifesto or set of rules to live by that I wanted to share. Many of these are interrelated and this list is not comprehensive but hopefully you will find something that rings home to you. They are in not particular order.
  1. Don't start from scratch: There are good "starting points" where someone else has done much of the legwork. An example of this might be some of the sample web map applications that ESRI provides for their new API's.
  2. Maximize documentation efficiency: This does not mean "do as little as possible." A Geo Soloist is typically working independently so documentation needs to serve their needs only (one benefit of not working in a group, say a team of developers). The other issue is that robust or extensive documentation takes time and requires maintenance given rapid changes. Maintenance also requires alot of time, something that is precious to all of us but especially to a Soloist. Documentation is important, just keep it relevant.
  3. Simplicity: Keep things simple. Workflows, expectations, requirements, everything. This concept should be a no-brainer but gets lost somehow. Make it your primary goal. Keep is part of every discussion.
  4. Don't get caught in a worm burrows. It is easy to do so be aware when you begin digging. Use well established patterns. Copy success stories and tweek as needed.
  5. Stay away from the bleeding edge: Use well established best practices and standards (when appropriate). Follow what the industry is doing and monitor grassroots efforts. Keep yourself educated about where the bleeding edge is and take a couple of steps back from it.
  6. Pillage: Use resources that are already available. There are so many great resources and given the vibrant, collaborative, brother/sisterhood we work in within the geospatial community, realize that someone has probably already done what you are trying to do and they are probably willing to share.
  7. Be resourceful: Student internships, collaborative funding relationships, cooperative agreements.
  8. Embrace the vacuum: This is counter intuitive to most of my other suggestions but exists in a different plane, more closely aligned to day-to-day workflows. We are taught to not work in a vacuum. I agree, but when you are working by yourself (at least as it relates to your immediate trade), trying to meet the needs of your immediate stakeholders, productivity can be very high if you do it your way. The vacuum can be a tool that lowers barriers. An example might be trying to over-collaborate (if there is such a thing) with those who are not specialists in our trade. Don't ask for permission, just do it.
  9. Be aware: Make sure you are aware of what is going on in the industry. Pick and choose patterns, best practices, standards etc. established by leaders in our community. Social networking tools such as Twitter are a great was to stay connected and informed. Be in touch with industry "buzz." Subscribe to leading industry blog sites that are relevant to your work.
  10. Manage the managers: Be sure to sell the concepts, but you are the ONE. Don't oversell but don't undersell. Manage expectations but don't underestimate your capabilities.
  11. Stay Agile: Embrace change, position yourself to manage change. Don't rest on what you know or what you are comfortable with. Don't be afraid of stepping outside your comfort zone. While the Agile process is typically thought of as a software development method, it expresses concepts that can be extended into all aspects of technology management. Have a look at it.
  12. Never stop learning: This should go without saying but it takes effort. We work on a platform that is like quicksand, ever-changing and it can swallow us up if we aren't nimble. The learning process doesn't have to be formal, simply read one blog a day or tackle 1 chapter in that nasty SQL book this week...then another next week....then another.
If you have others please let me know. In addition, I would like to pose a question to all of the GeoPros out there: Is the skillset/work experience of a Geosoloist (jack of all trades) desirable from the perspective of potential employers or is specialization?



For those of you who have been following my blog, don't worry, I haven't forgotten about parts 3 and 4, just taking more effort than first thought.

Friday, August 14, 2009

Web 2.0 and the Geoweb Part 2: Web 2.0 Patterns

Building upon part 1 of this series of lectures slides, part 2 actually examines (albeit at a pretty high level) well documented Web 2.0 patterns active in the Geoweb. Once again, the primary source of my research related to Web 2.0 patterns comes from Web 2.o Architectures by James Governor and et.al among others. Future lectures (parts 3 and 4) will comprehensively examine the Geoweb, using these Web2.0 patterns as a foundation as well as concepts examined by Geoweb experts related to usability, formats, discovery, architecture, etc....

Parts 3 and 4: Comprehensive look at the Geoweb

Wednesday, August 12, 2009

Web 2.0 and the Geoweb Part 1: Web 2.0 Examples

As I have mentioned earlier, I am ramping up for the upcoming semester and am feverishly prepping. My course, "Introduction To the Geoweb" is part of the Master of Engineering/GIS offered at the University of Colorado at Denver.

In the coming weeks, I intend to share materials I will be presenting to my students to all of you in hopes of getting some constructive feedback from the experts--YOU! I won't be sharing everything, just some selected materials that I think can benefit from some "participatory lecture development" if there is such a thing. I will also be citing much of the work that many of you have contributed so your feedback is critical.

The collection of materials I intend to share is tentatively termed "Web2.0 and the Geoweb." My hope during this series of lectures is to expose students to well documented Web 2.0 patterns and examples as a foundation for further exploration of the Geoweb. Some have suggested that a detailed look at web architectures and http are warranted before this discussion. Rest assured, the students will be prepared for these more advanced concepts.

The primary source of my research related to Web 2.0 patterns and examples comes from Web 2.o Architectures by James Governor and others. It is a good piece, articulating web2.0 patterns in a formal way and has worked nicely for foundational discovery. I have also incorporated materials from several additional sources that have proven adequate.

The story I hope to weave reads something like this: the Geoweb (which I think I can fully embrace) has roots, much of which can be described using well document Web 2.0 patterns. These patterns are best described using real world examples which can then be articulated formally using a standard method of description. This framework then serves as the foundation for further discussions mapping these patterns and subsequent reference models and architectures to Geoweb concepts, some of which have been stewing for some time and others which have emerged recently.

With that said, part 1 of 4 (or maybe 5) slides follow. These are subject to change which goes without saying. Be aware that these are lecture slides so there is a fair amount of text. Students get a little "bent without bullets."

I will be posting my recorded lectures as well. Continue to Part 2: Web 2.0 Patterns.

Friday, August 7, 2009

Back On The Geoweb Bandwagon

I am officially on the Geoweb bandwagon! I think this is the third time I have declared this in recent years, admittedly a bit premature in my previous attempts but I'm all in this time. The Geoweb has finally come of age. To give you some context, I have been a part-time instructor for several years now, teaching a number of GIS courses in the Master of Engineering Program (GIS) at the University of Colorado @ Denver. My favorite course over the years has been my web GIS course. While the most challenging given the ever changing landscape in this area, it is where my interest lies. The problem has been, what the heck do I call this course.

I have been following the Geoweb09 activities this year remotely and have had the opportunity to attend a couple of times, even dating back to its previous form, GML days. The term "Geoweb" and its numerous incarnations (Geospatial Web) have been bantered about for a few years, mostly in the context of this gathering. A couple of years ago, I actually called my course "Introduction to the Geoweb" but struggled with the label given the immaturity of the platform. Web2.0 stuff was just kicking in and my perception until recently was that the Geoweb was nothing more than some neogeos throwing up markers on a Google Map with little or no appreciation, knowledge, etc. of traditional (and very important) GIS concepts such as spatial relationships (topologies), projections, spatial analysis, etc. In addition, given my old-school roots in GIS, not having "GIS" in the course title was like having a marg without Grand Marnier--it worked and it was still decent but just wasn't right. Needless to say, I backtracked. So over the next couple of years, my labels for the course included "Introduction to Distributed GIS" and "Introduction to Internet GIS."

Those days are over now. The course is now officially recalled "Introduction to The Geoweb." This corny personal journey mimics that maturation process of the Geoweb itself. We all knew it was there and wanted to embrace it, but a few chips had to fall before we could really do so. The Geoweb is now walking. In fact, it is more like a toddler who can really move but who is a bit unpredictable.

I have been researching a number of great materials related to the Geoweb, much of which has been coming out of the Geoweb conference, and other materials which have been around for awhile. Based on these sources, I hope to develop a comprehensive look at the Geoweb that I will be sharing this semester with my students. I also plan to post these materials for some "crowd sourced lecture development" (if there is such a thing) as well so stay tuned.

Monday, July 6, 2009

ArcGIS Server Sample Flex Viewer: TwitterFeedWidget



I have been thinking about how Twitter could be used to enhance the capabilities/user experience of a web mapping system and came op with some decent stories. The first would be providing users with access to a feed dedicated to the application which contains information about it including updates, news, changes, downtimes, etc. The second would be users who wish to perform searches of Twitter content that may be related to the map and eventually, overlaying geolocated Tweets onto the map. These (and the fact that I just wanted to poke around the Twitter API) gave me enough of an excuse to start messing with the Twitter API. I ended up with a simple little widget that allows users to search for tweets within a specified geographic location, in this case, a circle. Nothing earth shattering but still maybe somewhat useful. Before giving you some of the nuts and bolts of this, I want to be sure and reference the materials I used:

Some Details on how it works.
It is really pretty simple. The user is able to draw a circle on the map and any tweets that originated from within that location based on the Twitter user's location property are returned as an ATOM Feed. The processes uses the Twitter API geocode parameter where a lat, long and radius of a circle are needed. The widget obtains the lat, long, and radius values from the circle tool. I added a coordinate transformation function to the Circle Tool component to convert the distance units (radius of the circle) to miles from decimal degrees. I used the Great Circle Distance Formula. The ATOM feed is parsed using the Flex XMLSyndication package and is validated using the Flex CoreLib Utility Package (see links above).

Proxy Server
As with any application making cross-domain asynchronous data requests, a proxy server is needed to "fool" the browser security settings. Flex has a nice framework for bypassing this. If the feed host contains a crossdomain.xml file that allows cross-domain access, you are good to go. However, Twitter locks this down (Twitter crossdomain.xml). I have included a proxy server implemented in Java within the package. It is NOT PRODUCTION quality but will get you started. There are other implementations that are easier out there. Have a look at the resources I sited for some other examples.

Known Issues and Limitations
Simply put, there are several limitations with this that make it, lets say, less than production quality. I hope to rectify these soon. These include:
  • I haven't tested the feed results very well. The widget catches feeds that are empty which is good but the way I did this is kind of sloppy. I won't go into it here but if you have questions, I can elaborate.
  • The coordinate transformation for the distance units (radius conversion from DD to miles) I am using is very rough but good enough for this use.
  • It doesn't play very nicely with the map action and map navigation state of the Sample Flex Viewer (SFV). Given that the draw circle component wasn't designed for use with the SFV, it isn't integrated very well with the event driven model the SFV uses. Not to say it isn't a nice component because it is. Using it in the Sample Flex Viewer is just a bit of a stretch. There are alot of issues with this but from a use perspective, users have to keep clicking on the draw circle tool after each use and then state defaults back to the default map navigation (pan). Another problem is if the user trys to change the map action or map navigation state (by selecting another component that does so), during the middle of component use, bad things happen. One of the reasons for this is that I didn't want to make changes to the core by adding custom events, etc. However, I am hopeful that I can improve this without making changes to the core and will look into it.
  • Improvement can be made to the tweet results listing (links to profile, user timeline, etc...).
  • Alot of other testing needs to occur as well. Just running out of time right now.

Wednesday, July 1, 2009

Keeping Your Grass Green (with little water)

This is an odd post and intended for all of you who follow this and aren't geogeeks (sorry nerds but this might interest you as well). This advise is for people with Kentucky Bluegrass lawns (Colorado). So many people have asked me how I keep my grass so healthy and claim I water like crazy. In fact, I am a huge conservationist and try to minimize waste. I promise I have only watered 3 times this year (as of July 1st, 2009). Here is a pic.

Granted, it was a wet Spring for us but I am certain these techniques still apply. Here is the secret:

  • First, assuming you have a lawn with a good foundation and good drainage (nice organics) and it is established, you need to fertilize. This is critical. I use all organic fertilizers. Once a month (more like 1 1/2 months), I apply:
    ---2 parts Richlawn Turffood Pro
    ---1 part Revive granules (kind of expensive but critical)

    I mix these up and apply with a standard spreader. I will leave the amounts to you based or your square footage. It is also critical that you apply the Fall season version of Richlawn in October.
  • Secondly, please mulch. Most modern mowers can mulch. If you don't have one, get one. Bagging grass is a tragedy. You are filling landfills with unneeded waste and the mulch actually helps the sod maintain hydration and ensures that it requires less fertilizer given that you are replenishing the nutrients. One issue is that you will have to mow more often (maybe twice a week if the grass is growing crazy). You can't mulch if your grass is too long.
  • Finally, you must integrate organic material into the subsurface before you lay sod. This is hard to do if you already have a mature landscape but worth mentioning. This means rototilling at least 4 inches of nice organic material into the crappy clay (Typical in Colorado).
That is about it. A couple of items worth mentioning: First, you will have to do this for a couple of years before your lawn responds, don't expect it to respond overnight. You need to train it. Secondly, don't water too much. Kentucky Bluegrass is very drought tolerant if you let it be. If you water too much, it will use the water. Stress it a bit.

Thursday, June 18, 2009

Webmap of US Oil and Gas Production

The USGS Energy Resources Program recently upgraded the US Oil and Gas Production map service for use in their new web mapping platform called Envision which is based on the ArcGIS Server Sample Flex Viewer. The ERP is actively updating the system to deliver all legacy map services and has recently upgraded the US Oil and Gas Production map (By Laura R.N. Biewick USGS DDS 69-q)

Friday, June 12, 2009

Interesting MTB Routes (South Denver)

I have been a recreational MTB cyclist for a long time. Some of my buds are crazy in the cycling world (http://twitter.com/skinnerchris) but I never could get into it at that level. Not knocking it because guys like @skinnerchris can ride freakishly. Its just not in my DNA.

Anyhow, check out a couple of these routes. These are by no means my favorites but represent those that are not mentioned online much. My favorites have been ridden like mad and have been documented well.

Route 1: In Highlands Ranch. Brand new trails. Not much climbing. Not many people. Smooth, non-technical, leisurely (Hope this crappy GM works. Should show actual trail).

View hr route 1 in a larger map


Route 2: Private property (residents only). Great range. Technical, climbing, private. Got to have an "in" to use these particular trails. Heavy Security by local rangers.



View Ranch Loop in a larger map

Monday, June 1, 2009

ArcGIS Server Sample Flex Viewer: Adding ArcIMS Image Map Service Support

Adding ArcIMS image map service support to the Sample Flex Viewer (SFV) is rather simple and handy for those of you who might have loads of legacy services that might not make the AGS migration any time soon. It is simply a matter of extending the ConfigManager class and MapManager class. You will then need to make a slight modification to any ArcIMS elements in the config.xml file.



Extend the ConfigManager class by adding the following:



//map

var configMap:Array = [];

var mapserviceList:XMLList = configXML..mapservice;

for (i = 0; i < mapserviceList.length(); i++)

{



var msLabel:String = mapserviceList[i].@label;

var msType:String = mapserviceList[i].@type;

var msVisible:Boolean = true;

if (mapserviceList[i].@visible == "false")

msVisible = false;

var msAlpha:Number = 1;

if (!isNaN(mapserviceList[i].@alpha))

msAlpha = Number(mapserviceList[i].@alpha);


//retrieve newly added arcims service host attribute from map service entry

var msHost:String = mapserviceList[i].@host;

var msURL:String = mapserviceList[i];


var mapservice:Object =

{



label: msLabel,

type: msType,

visible: msVisible,

alpha: msAlpha,

url: msURL,



//add newly added host attribute to mapservice object for ArcIMS Map Services

host: msHost



}


configMap.push(mapservice);



}


Continue by extending the MapManager class as follows:


for (i = 0; i < configData.configMap.length; i++)

{



var label:String = configData.configMap[i].label;

var type:String = configData.configMap[i].type;

var url:String = configData.configMap[i].url;

var visible:Boolean = configData.configMap[i].visible;

var alpha:Number = Number(configData.configMap[i].alpha);



//new variable for collecting host attribute for arcims services

var host:String = configData.configMap[i].host;



switch (type.toLowerCase())

{



case "tiled":

{



var tiledlayer:ArcGISTiledMapServiceLayer = new ArcGISTiledMapServiceLayer(url);

tiledlayer.id = label;

tiledlayer.visible = visible;

tiledlayer.alpha = alpha;

map.addLayer(tiledlayer);

break;



}

case "dynamic":

{



var dynlayer:ArcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer(url);

dynlayer.id = label;

dynlayer.visible = visible;

dynlayer.alpha = alpha;

map.addLayer(dynlayer);

break;



}

case "arcims":

{



var arcimslayer:ArcIMSMapServiceLayer = new ArcIMSMapServiceLayer(host,url)

arcimslayer.id = label;

arcimslayer.visible = visible;

arcimslayer.alpha = alpha;

arcimslayer.imageFormat = "jpg"

map.addLayer(arcimslayer);

break;



}



}

}

The entry for the config.xml file would then be something like this:

<mapservice label="2008 Province 31 Assessment" type="arcims" visible="false" alpha="0.7" host="http://certmapper.cr.usgs.gov">prov31_2000</mapservice>

where the value of the element is the map service name. One thing to keep in mind with this is that some of the FLEX api features are not supported for ArcIMS image map services including the identify task. There is also some info on this in the ESRI user forums that may also be helpful.



Wednesday, May 13, 2009

AIR/Flex vs. Silverlight Debate

Now that the ArcGIS Server development platform has finally come of age, many are asking: which platform do I use? There are a number a criteria that enter into this equation and I think others have done a good job of defining these so I will not be discussing them here. The intent of this post is simply to provide you with some of the resources I have found that evaluate at least the 2 RIA platforms ESRI is now providing: Flex and Silverlight. There is alot of chatter/bashing going on and it is often hard to sift through some of the biases so the following are the most resent/unbiased postings I could find. For what its worth, I think they are both great and good for one another. The harder they compete, the better off we all are. Heck, I hope we even start discussing JavaFX in the near future.

The Battle for the RIA Throne: Flex vs. Silverlight
Flash vs. Silverlight: What Suits Your Needs Best?
Video: Air/Flex Silverlight Debate: MS and Adobe evangelists go head to head.

Tuesday, May 12, 2009

USGS Report Released: Energy Resources in SouthWester Wyoming (WLCI)



The USGS Central Region Energy Resources Science Center (Author: Laura R.H. Biewick)recently released a report characterizing oil and gas production within the South Western Wyoming (Wyoming Landscape Conservation Initiative). The report contains a variety of geospatial data, maps and such that are free to the public.

Monday, May 11, 2009

Initial ArcGIS Server Flex API Map Viewer Rollout

The USGS Energy Program is beginning to rollout their latest online mapping application using ArcGIS Server and the Flex API. It is pretty vanilla right now but includes some nice features under the hood including:

1. URL parameter interface
2. Live Map classification widget
3. Separate Map Navigation
4. US Geologic Energy Resources Summary Widget
A whole set of nice features are in the oven including:

1. Metadata and static legend integration
2. Access to over 100 different services
3. Custom widgets based on content type.

Tuesday, April 21, 2009

Formatting Dates In Flex

If you have been working with any of the new AGS apis (at least Flex or DOJO in my experience), you have probably encountered one of these:

Mon Dec 31 17:00:00 MST 2001

This is the date string returned within a query result featureSet.

var assessmentDateString:String = featureSet.attributes[0][assessmentDateLabel];


Not very usable really. However, there is hope! Flex has a nice little class called DateFormatter. DateFormatter does alot of stuff but what is really handy is its ability to parse pretty much any date string into a real date object. The langref gives you all the details on how to do this but converting the date string above into an actual date is a simple as:

private function getFormattedDate(dateString:String):Date
{
var formatter:DateFormatter = new DateFormatter(); formatter.formatString = "EEE MMM DD H:NN:SS YYYY" var newDate:Date = new Date(formatter.format(dateString)); return newDate;
}


Take special notice that the formatString pattern does not try to match the "MST" portion of the date string. This portion is simply ignored. This is not because literal characters aren't allowed, just not caps. Lowercase along with punctuation and numbers can be used in the pattern if needed.

Thursday, April 16, 2009

Greg's Projects

Started a new stream regarding some of my personal projects. The main thrust right now being my basement finish (I am going to try and do it mostly myself). If interested in learning from my screw-ups, have a look.

Greg's Projects Blog

Saturday, March 28, 2009

ArcGIS Server Sample Flex Viewer: Capturing and Using Configuration Data


The Sample Flex Viewer (SFV) uses a simple xml file (config.xml) for application initialization and configuration. Application properties managed by this configuration file include, among others, UI attributes such as banner, title and logo, primary menu configuration, widget management, and layer management.



It is almost a certainty that any customization will require custom configuration settings, either populated by passing in URL parameters (in a future post) or by setting custom properties in the config.xml file. These data can be captured and used by making a few changes to core classes in the SFV. This example focuses on capturing a custom attribute added to one of the existing elements, in this case, the <mapservice> element.


The ultimate goal of this example is to provide some means of categorizing map services identified in the configuration file for display in multiple instances of the livemaps widget, each containing subsets of specific map services. We will do this by adding a custom attribute to the <mapservice> element called group.



<mapservice label="map label" type="dynamic, tiled, arcims, etc" visible="true/false" alpha="0..1" group="wlci">url</mapservice>



Now, getting the data. But first, we need some background. While we won’t be using it directly in this example, it is important to mention the configData class. The configData class does nothing more than provide a place to store the configuration data. It is a collection of arrays which correspond to application functional groups such as UI, menus, maps services, widgets etc. If your intent is to create an entirely new class of configuration data, let’s say for url parameters (more on that in a later post), you would provide the framework for that data in this class. Our example is a bit simpler, we are simply adding a new attribute to an existing class.


The class that does most of the legwork is the configManager. It begins by establishing and HTTPService connection (configService) to the config.xml file and then listens for a result (ResultEvent.RESULT). The important stuff occurs in the handler for this event. Within this handler, an instance of configData is created along with an xml dataset containing the contents of config.xml:



var configData:ConfigData = new ConfigData();

var configXML:XML = event.result as XML;



It then proceeds to parse out the functional collections of data as needed. The following illustrates how it parses out <mapservice> configuration data. This pattern can be used to obtain any attributes added to the mapservice element in the config file.


//================================================

//map

var configMap:Array = [];

var mapserviceList:XMLList = configXML..mapservice;

for (i = 0; i < mapserviceList.length(); i++) {


var msLabel:String = mapserviceList[i].@label;

var msType:String = mapserviceList[i].@type;

var msVisible:Boolean = true;

if (mapserviceList[i].@visible == "false")

msVisible = false;

var msAlpha:Number = 1;

if (!isNaN(mapserviceList[i].@alpha))

msAlpha = Number(mapserviceList[i].@alpha);

var msURL:String = mapserviceList[i];

var mapservice:Object =

{



label: msLabel,

type: msType,

visible: msVisible,

alpha: msAlpha,

url: msURL,



}

configMap.push(mapservice);



}

configData.configMap = configMap;



The previous block of code begins by creating an empty array for populating local data.



var mapserviceList:XMLList = configXML..mapservice;



creates an XMLList of all nodes in the DOM hierarchy called mapservice. The XMLList can then be examined just like an array, stepping through it by using a for statement. Attributes of the elements within the XMLList are then accessed explicitly via the attribute name. For example:



var msLabel:String = mapserviceList[i].@label;



retrieves the value assigned to the label attribute for that particular mapservice node. The value of the node itself is retrieved using the following syntax:



var msURL:String = mapserviceList[i];



For each node instance, a generic object of name/values pairs is then created containing each attribute value along with the value of the node itself. That object is then added to a local array for each node instance and then is assigned to the configData instance upon parsing completion.


For this example, recall that we have added a new attribute called group to each <mapservice> element. To retrieve that value, we simply need to create and assign a new local variable with the attribute value, add it to the generic name/value pairs object and we are golden.



//================================================

//map

...


for (i = 0; i < mapserviceList.length(); i++)

{



...

//retrieve newly added group attribute from mapservice entry

var msGroup:String = mapserviceList[i].@group;

...

var mapservice:Object =

{



...

//add newly added group attribute to mapservice object

group: msGroup,



}



configMap.push(mapservice);

}

configData.configMap = configMap;



Our configData instance now contains the newly added "group" attribute. Once it is completely populated, the CONFIG_LOADED event is dispatched which essentially notifies the application that the configData instance is now available for use. Using the data is even easier. All that is needed is to listen for the CONFIG_LOADED event:



SiteContainer.addEventListener(AppEvent.CONFIG_LOADED, config);



where config is a function whos argument is an event containing the data itself. It is then accessed via the following:



private function config(event:AppEvent):void

{



configData = event.data as ConfigData;



}

This is done by default in the MapManager.mxml component. Have a look at the function called config is this component and you will see that pattern for obtaining data from configData.

private function config (event:AppEvent):void

{

configData = event.data as ConfigData;

....

for (i = 0; i <donfigData.configMap.length; i++)

{

...

var url:String = confData.configMap[i].url;

...

}

}

A nice feature in the Sample Flex Viewer is that the BaseWidget class (that which we extend for all new widgets) exposes the configData object by default. This means we can then obtain data parsed from the config.xml file by the ConfigManager from any widget that extends the BaseWidget. To do this, we do something similar to what the MapManager component does.

for (var i:Number = 0; i <configData.configMap.length; i++)

{

...

var group:string = configData.configMap[i].group.toString();

...

}

Friday, February 27, 2009

What’s New in ArcGIS Server 9.3.1

I just returned from the ESRI Petroleum User’s Group (PUG) conference in Texas. The buzz this year was a little lower than those of an anticipated major release. The featured release during this gathering was 9.3.1. As I mentioned in a previous post, nary a word was mentioned regarding Desktop, it was all about “Web GIS.” Given my professional interest in this platform, this was ok with me. While many of the demos highlighted the various development platforms including the JS and FLEX API’s, a few included new features in 9.3.1. Probably the most anticipated, at least for AGS users, is increased performance for dynamic map serving. As far as I could tell, implementation of this new feature is actually done via a tool designed to help optimize the map document. The demo illustrating this improvement included a side-by-side comparison of the same dynamically generated map service, one that had been “optimized” using the new optimization tool and one that hadn’t. Each map display included a timer depicting load times. Anecdotally, map services which had been “optimized” using the new tool loaded about 3 times as fast. The optimization tool, utilized in ArcMap during the demo, looked at characteristics of the map document including whether the projection of the data frame matched that of the data, whether any data links were missing, scale dependent rendering, symbol level drawing and a couple of others that I missed. The workflow for tool use included an iterative process of optimization and map service preview. The demo was good and even generated a fair amount of applause. However, if faster dynamic map generation centers on checking the characteristics I listed above, don’t hold your breath. It seems to me that most folks are already looking at these sorts of things.


Other features mentioned but not demoed in the 9.3.1 release included the ability to publish to AGS directly from ArcMap and integration of Virtual Earth base data (not Google) directly into the ESRI platform including ArcMap. There was also some discussion about the new sharing framework via ArcGIS Online. While some may say “not another one” this one features content sharing and discovery definitely designed for a GIS pro and not so much for general consumers. Other notable discussions included AGX build 900 and the notion of what ESRI is calling a layer package (not sure if this is 9.3.1 or 9.4). The layer package is simply of was of packages data and cartography for sharing purposes.

Tuesday, February 24, 2009

2009 ESRI Petroleum User Group (PUG) Conference

Today is day two of the 2009 Petroleum User's Group conference. Yesterday featured the standard PUG fair including the usual ESRI plenary "dog and pony" show followed by some really good user presentations. Lead by Clint Brown, the tone of the plenary talks centered on "Web GIS." Highlights included ArcGIS 9.3.1 discussion, demos of the JS and FLEX APIs as well as some discussion about yet another sharing framework being designed via ArcGIS Online. To the dismay of a typically traditional GIS audience, it is clear that the focus of ESRI's R & D/future direction is "Web GIS." I'm not even sure if Desktop was even mentioned. The term "consumable" in the context of data and services was mentioned at least a dozen times with emphasis is user experience oriented towards the Google and VE patterns.

Thursday, February 12, 2009

JS vs Flex ArcGIS Server Sample Viewers

In recent weeks, ESRI has released 2 versions of a sample viewer application based on both their latest development platforms, the JS platform (released January 2009) and the Flex platform (released November 2008, updated February 2009). They both look and function similarly out of the box. Each features a icon oriented navigation bar based on various functional classes including maps, navigation, tools and resources. They both use REST based ArcGIS Server services both dynamically generated and cached very easily (although I was able to add ArcIMS Service Support to the Flex version without much hassle). Each features some pretty nice design patterns which allow developers to worry less about core functionality. Custom functions are implemented as "widgets" which function independently of the software core.

After tinkering with the Flex application for a few weeks and having a look at the JS version, I have a few impressions to share. First, they both use design patterns (Container Event Bus and Dependence Injection) that help decouple core functionality from custom functionality and really make it easy to extend. The flex viewer, based on Adobe's Opensource Flex 3.2 platform is very sexy and alleviates many cross-browser compatibility issues because of its required Flash plugin. Recently released as an opensource project, Flex offers a rich user experience with flashy graphical displays and fluid GUI performance. However, it requires an specific IDE based on the Eclipse IDE called Flex Builder which is rather pricey (ranging from $200.00 - $700.00). I have had the fortune of getting the IDE and have begun some "widget building" myself and have found it to be quite easy. I was able to construct a simple Map Navigation Widget in just a few days without any prior Flex development experience.While I haven't tinkered as much with the JS version, my initial impression is that it is also very slick and does not require a plugin. However, it's sex appeal is lacking a bit compared to the Flex version and it sounds as if (based on comments from the sample download blog) that it has some issues in IE 7.