Thursday, July 30, 2009

Loading Modules in Flex

I have in the works an article on map interfaces. Its challenging to provide the map and metadata on, say, a point clicked on the map. Maybe its a marker for a house for sale. I click on the marker, where do I display the price, images, descriptions etc? Pop up, draggable boxes, open a new page. Lots of choices, some better than others. Flex actually increases the possible cool options here.

My article was driven by a new local search application I am writing. I'm debating whether to load modules within the application. With this in mind, I have built a demo. Right click and you can view the code. This does the following:
1) Loads modules on the fly based on user button click; next or previous(note the use of an interface)
2) Allows the main application to call methods in the loaded module.
3) The modules listen to events fired from the main application
4) The text in the main application is localised; so button labels can be switched from English to Spanish.

Take a look at the code or download it to test. In the project properties ->flex modules, you will need to have the two modules included. So they are compiled with the application.

The demo is potentially a base for building mapping applications. Or applications which include a mapping module.

John Peel and Redwoods

Just back from vacation in Bay area, California. Those redwood forests are wonderlands to me. To think the place was once filled with such trees. How could we let loggers cut them all down .... I digress.

Plenty to write about on the conference scene. With vacations and work I have had to follow The ESRI business and GeoWeb conferences via twitter and blogs. Still I'll gather peoples feedback in my next post and add some comment.

With vacation thoughts still in mind. I'm a big music fan. Mostly my interest is in new bands, from all genres. One of my heroes (if I can use such a nonsense term) was John Peel. A unique radio DJ and person. His shows were broadcast on BBC radio 1 from his home near Ipswich in England. Often he would begin his introduction to "the new song by Extreme Noise Terror", by describing the antics of the wasps outside his window. His two hour show was one of life's pleasures. Like many I miss his wit and observations (he passed away while on vacation in Peru in 2004). Anyway, a book of his music reviews was released at the end of last year. There is one review of the book on Amazon by Richard Fudge, I felt it needed reprinting. Not only for how beautifully it is written but its content:

As far as I can tell, John Peel was a fine human being and as avid and influential a music fan as ever existed. This collection of columns published in various British magazines from the 1970s till his death in 2004 shows what an amazingly good writer he was too. I haven't enjoyed a music book this much in I don't know how long--chiefly because his wry sense of humor and nimble wordcraft are hilarious. As I read the book, I would share occasional columns with my wife--and there were times when we laughed so hard we gasped for breath.
As a DJ, Peel was eager to share any music that he found interesting or exciting, and as a result listeners to his radio show could potentially hear anything from anywhere by anybody. There are elements of the unusual in the book, but for the most part Peel deals with mainstream music and culture (certainly mainstream if you're an indie or World music fan) and this book works somewhat as a one-man overview of music from the last half of the 20th century. Having said that, Peel is indelibly British and his columns are therefore packed with references to British life and culture; as an ex-pat I enjoyed this greatly, but someone not so acquainted with UK life will certainly feel left out at times. Don't let this scare you away. Peel's reflections on the musicians who dazzled him (and his derision of the performers and music-industry types who had little going on but a well-marketed pose) are fascinating and insightful, and they resonate with the enthusiasm that was so much of Peel's radio demeanor.
Music writing can too often be pompously self-important. Peel, always self-effacing, is serious, intelligent, articulate, analytical, informed, and so on--but he steers well clear of the pompous.
What is also gratifying about Peel's outlook on life is his appreciation of the decency of human kindness, and his frequently practiced understanding that a few beers can greatly enhance the human experience. I imagine he would have been a great guy to hang out with--and reading this book was a good deal like hanging out with a great guy.

Monday, July 20, 2009

Flex Flash Maps

I mentioned in an earlier post my Flash revisit. The Flash map applications in the London Guardian have always impressed me. I thought I could use Flex as the framework and eventing manager and build a series of flash maps. So a Flex Flash combo. Modularity was also something I wanted to explore. The large Flash applications built by some of the flash mapping companies seem unnecessary. Anyway, the application in its base form is available here. Right click to view the code and/or download.



Note: In the right pane you can zoom in and out by selecting a tool and clicking. Alternatively you can simply use the mouse wheel.

Simple MVC

I have just posted the code for a very simple MVC. Right click and you can see the code and download it. Its very simple. This should give you a feel for the guts of the MVC architecture. Should make understanding Cairngorm and the rest a little easier.

Thursday, July 16, 2009

Location Intelligence

Introduction

We are in the midst of a geospatial revolution. Geo what I hear you saying? Is this geography; maybe maps? Both and more. Specifically we are talking about location. Location in space; how it is visualized and analyzed. In this article we will introduce the new landscape that is geospatial. We will see how we got to today, define terms, compare platforms and segments. Ultimately, we will help you better understand location and its importance to your business.

Let's start at the Beginning

So what is location? At its most basic we are talking about a point in space; you, me, a house, a store, a sale, maybe a delivery. All entities and events have a location. Every business operates in this space.

So we are talking maps then. Yes and no. Maps are simply a way to visualize space. They have context. So driving maps, show roads and settlements. On thematic maps voting patterns across the US may be represented. Changes in city boundaries over time can be shown on temporal maps. More accurately, we are talking about elements or activities which exist or take place respectively in space. A map is merely the representation of these elements or activities, together or in isolation, in space. Maps are images. Humans are wired to best understand information when it is presented in images. Thus maps are a wonderful way to present complex information in understandable ways.

What is Geospatial

Geo is a prefix for any word dealing in some way with the earth. Spatial is from the word space or the boundless, three-dimensional extent in which objects and events occur with relative position and direction. Geospatial is the visualization and analysis of terrestrial geographic datasets. If “geo” is so important to understanding physical assets and the location of people - two critical components to the commerce of goods and services, and therefore business decisions - why has location been an untapped dimension of business? Why has GIS been in the closet for 25 years? And, so why suddenly has its profile been raised? A brief history might be in order.

Proprietary Software v. Spatial Thinking
Geospatial has been dominated by geographic information systems (GIS) for 25 years. GIS was a specialized niche. Desktop applications like ESRI’s ARC/INFO and ArcView allowed users to display points, lines and polygons stored in spatially enabled databases as maps, and to perform spatial analysis on this data. Thus if a store wished to build a new branch it could use a GIS to analyze proposed areas in terms of maybe demographics; we want a high percentage of families with a certain household income within a 5 mile radius of our new store.

The Role of Money
In 1996 Mapquest became the first mapping Internet site, enabling users to turn to the Web for driving directions. ESRI released its IMS product line; MapObjects IMS and ArcView IMS, in 1997. Giving developers tools to build online GIS applications. Though these were key developments it was not until 2005 with the launch of Google Maps that the geospatial revolution truly began. So why was Googles entry into geospatial so impactful? For a number of reasons. First was the amount of money put behind the launch. Take hardware for example, it is thought Google now stores many thousands of terrabytes of spatial data. At the time theis level of spending was unprecedented. Second, they introduced the idea of slippy maps. No longer did users need to wait for a map to load. Maps were tiled and provided a seamless experience. Third they took advantage of AJAX and rich Internet applications (RIA). Google maps was more like a desktop experience. Fourth, they made their API public. Thus it became easy for anybody to add a map to their personal Web site. Lastly, they pulled together and provided in one place a range of different spatial data - roads, satellite, birds eye panoramas - all for free.

Microsoft and Yahoo soon followed Google into the geospatial market. Microsoft have become known for their work with 3-D, birds eye and oblique views. And, like Google, they have put considerable resources behind their geospatial offerings.

The Current Landscape

The last few years have seen dramatic changes in the geospatial landscape. What exactly do we mean by this landscape? Historically, geospatial applications were confined to the desktop and limited to trained GIS programmers and analyst. The geospatial industry has become more than just GIS. It is now part of the Web and mobile experience. Maps are everywhere. There has been a proliferation of business tools enabling the inclusion and analysis of location. Thus we are talking about changes in both the breadth and depth of geospatial. For the technical, a background in geography is no longer a prerequisite. The business professional now has a wealth of new additional tools available to help better understand customers, and organize their business.

Growth within the industry continues at an astonishing rate. Microsoft, Google, Yahoo and Mapquest continue to extend the services they are offering. ESRI, historically dominating the GIS market, have extended their range of products. Many small companies also have entered the geospatial market with more specialized niche products and services.

For both the technical and less technical it is worth exploring how this landscape is changing. The different areas which have emerged, and some of the tools now available.

The Web Dynamic
As mentioned, maps have increasingly become part of the Web experience. A range of so called consumer mapping and map mash ups have emerged. Markers have been added to maps, displaying points of interest (POI’s). Maps have also become more than just points and lines; georeferenced multimedia has been added to the mix. Flickr, for example, have made sharing georeferenced photos popular. Currently around one hundred thousand photos are uploaded to Flickr each day. This has been aided by the fact that many mobile phones now have built in cameras. Consumers, businesses and government agencies have been making use of these services.



Figure 1: The FlakeFinder Web site and example of a ski resort mash up

Desktop or browser plugs-ins like Google Earth and MSN’s Virtual Earth are now popular. These have enabled 3-D maps, views from oblique angles, street level views, flight simulators and non terrestrial views.

GeoSocial Networking
Social networking has recently become very popular; services like Twitter, Facebook and MySpace. The proliferation of mobile devices with built in GPS, has added a new platform for this form of networking. The goal of geosocial networking is to discover places, things, people and events nearby. Thus, for example, when shopping in a mall, your mobile can notify you of others in your network nearby. It can also let you know about sales or special events in real time. Geospatial companies are very active in this space. Examples include Platial which is focused on ‘who and what are nearby’ on the Web. Buzzd and Pelago use Web services like Facebook Connect to share personal networks using mobile devices.

Navigation
Route and network analysis has seen dramatic recent growth. Vehicles increasingly have built in route guide systems like Tom-Tom. These systems can audibly guide you to your destination. They are often networked, thus can provide real time information on congestion, road works and other key network data. On the Web Mapquest have added local information to the existing route and network services they offer.

Mobility
With the popularity of mobile devices, a wide range of geospatial applications have been produced. The IPhone is very notable, with a range of Google map based applications now available. Other mobile providers are following suite, most notably Nokia with its OVI launch.

Tools
The geospatial community is highly active. There many open source tools available. Open source geospatial servers include MapServer and Geoserver. OpenLayers and Modest maps are excellent libraries for building mapping interfaces, while PostGIS extends the Postgres database to be able to handle spatial data.

Rich Internet mapping applications (RIA’s) are an important part of the new geospatial experience. With the adoption of technologies like AJAX and Adobe Flex, increasingly Web applications resemble those running on the desktop. Sophisticated interfaces, which avoid full screen refreshes, are ever more common. Providing users a rich Web geospatial experience.

Data
There has been a proliferation of spatial data sources. Citizens have increasingly become important as providers of this data. During Hurricane Katrina, key location information was provided and mapped by citizens. OpenStreetMap is a highly accurate free base map, built by volunteers. The proliferation of video cameras and sensors, tracking things like local weather conditions, are providing much new data to geospatial systems.



Figure 2: OpenStreetMap data displayed using OpenLayers


Business Intelligence

So how should business professionals be thinking about “geo”? We have discussed the new tools and data now available, but not how these are being directly utilized by businesses.

GIS
From the recent ESRI Business conference GIS summit a number of key business GIS areas were defined:
a) Asset Management
- Oil and Gas - monitoring and managing pipelines
b) Planning & Analysis
- Retail - market analysis and optimizing store distribution; eliminate poor performers and adding new locations.
- Insurance – evaluating risk and determining accurate pricings for the specific location.
- Emergency Services - damage assessment (eg. flooding)
- Land - land developers assessing parcel/land value
c) Field Mobility
- Trucking and delivery - optimum routes and delivery vehicle management.
d) Operational Awareness - asset utilization and supply chain efficiency.

Mash ups
There are a wide range of examples in this category. These include:
- State promotion - geolocated photos, video and images used to promote a state.
- Retail advertising - adding store locations to maps using markers.
- Real estate – homes for sale eg. http://snapshot.trulia.com/.
- Travel/tourism - destination guide and planning tools eg. http://www.flexmappers.com/videomaps
- Emergency services - geolocated data and photos eg. hurricane Katrina
- Business intelligence - news by location http://www.metacarta .com
- Financial sector - location based news and data.
- Insurance - weather forecasting eg. http://www.weather.com
- Entertainment - book or band tours eg. http://www.thetourmap.com/
- Emergency planning - toxic spills
- Health and medicine - tracking the spread of disease eg. http://www.healthmap.org/swineflu



Figure 3 – Mapping the diffusion of swine flu

- Travel industry planning – flight data eg. http://maker.geocommons.com/maps/4884

Mobile
This includes stand-alone maps or geodata downloaded from the Web
- Travel/Tourism and Federal State Agencies - local transportation information
- Trucking - fleet management
- Planning - parking information; availability by pricing zones
- Travel/Tourism - guided walks, creating routes eg. http://unitedmaps.net
- Travel - directions, traffic congestion eg. http://www.tomtom.com
- Retail - shopping alerts eg. http://www.nearbynow.com/
- Emergency services - evacuation and disaster management
- Retail – guiding drivers to low cost gasoline stations eg. http://www.dash.net

Navigation
Web based driving and route mapping services.
- Delivery - shortest path eg. http:/www.mapquest.com
- Sales – planning client visits

Geosocial Networking
- Retail advertising - are friends in my network nearby?
- Non profit - sharing ideas/creating community by locations
- Hazards and Disaster Planning – sharing information by location eg. http://en.wikipedia.org/wiki/Collaborative_mapping
- Promotion - geotagged imagery or video eg. http://www.flickr.com



Figure 4 – Geotagged photos mapped in flickr

Other

- Promotion/announcement – location driven announcements using geocoded addresses
- Publishing – interactive flash maps to support articles eg. http://www.guardian.co.uk/flash/0,,1807749,00.html
- Local advertising – finding user locations from computer IP eg. http://www.hostip.info/



Summary

Much of the current business focus is on the why and when of customer behavior; the where remains under explored. Location intelligence is the analysis of the space in which a business operates. It takes in sales, marketing, the supply chain, operations. Maps are the presentation of this spatial data, maybe in combination with spreadsheets and charts. They serve to help both with pattern recognition and as spatial indexes; displaying related data.The recent changes in the geospatial industry has provided additional tools, and data to businesses. Allowing where to be included as a part of business intelligence. In this article, we have focused on the changing geospatial landscape. We have attempted to demystify a rapidly growing industry. And, hopefully demonstrate the importance of location intelligence in the success of any business.

Twitter and Contracting

I follow Jesse wardens blog. He is an ace Flash and Flex developer. Though not an RIA map developer, he has lots of useful tips and tricks on general RIA development. I particularly liked his most recent entry on contracting and twitter

Wednesday, July 15, 2009

Mapping and MVC

I found here a nice article on the Model-View-Control design architecture/pattern. Its a useful pattern to know about and this article lays things out nicely.

Geospatial Thoughts

I started out as a Physical Geographer. The early days of the Internet coincided with my move from England to the US. The possibilities of a geospatial Web led me to GIS in the mid 1990's. I took a Masters degree and dipped my toe into geospatial programming. Over 10 years later I'm still programming. The early geospatial efforts I worked with - MapObjects IMS, ArcIMS and Viewers - were a start. But somewhat unfulfilling for a user; waiting for new map images to reload after pans and zooms was a pain. I always wondered about how the user experience could be improved. This led me to Flash and now Flex or rich internet mapping applications.

My working life is spent surrounded by computer scientists. But, I remain first a geographer second a programmer. People have asked me what that means. I usually reply that I think about my work geospatially. "You mean in terms of maps?" is often the response. It struck me, this is how many think of geography and geospatial.

I'm writing an article for the new LBx Journal. Its aimed at business executives. I'll post it on the blog when I am done. It deals in more depth with this issue. This may form the first in a series exploring geospatial and business. At a basic level how can business take advantage of geospatial? Increasingly I view my work from a business angle. The geospatial community seems focused on the 'building and they will come' approach. If geospatial becomes an integrated part of business, and not separate as it is today, we need to start demonstrating its power to solve business problems. I attend too many geospatial conferences where 'how can we make money' is a central topic. Let's start looking through the lens of a business executive. Understand their perspective, then take our knowledge of geospatial and provide them with solutions. Focus on understanding the problem and monetizing solutions.

Mapping and Sensed Location

Thinking about geospatial, many people focus only on maps. But maps are simply a tool to visualise spatial data. I've recently become interested in sensed locations, or knowing where a user is from GPS or IP geolocation. The latter is fascinating. Taking a best guess at where a user is based on their IP address. There is more on this at the following slideshow

Though there are obviously privacy issues here. Knowing, for example, where a user is when accessing your web site, can help tune the experience. Maybe allowing developers to provide more relevant content.

Local data and search are my current areas of focus. This is very relevant. More on this in subsequent posts.

Thursday, July 2, 2009

Everyblock Code Open Sourced

The source code for Everyblock has been open sourced. You can now access all source code . It is a nice application. Their dilemma has been much discussed; how to make money when the code is required to be open sourced. Reading the blurb in the code release page, one feels there is some degree of resentment about having to go open source. One has to sympathise, but when they agreed on their financing they knew this to be the arrangement. Its odd they did not plan on this when they built their business plan.

Flash CS3 Map Evolution



The Flash CS maps I have been building using AS3 is moving along slowly. I shared a link in an earlier blog entry to the first phase. Most of the time here was spent assembling the assets ie. movieclips of each continent/country/state and supporting XML. The XML is tied to the movieclip via a number - <id>1</id>, sprite 1. Thus I have an all continents swf and individual continents eg. northamerica.swf. These are made up of individual country/state movieclips. Clicking on a continent, loads the individual continent swf. Since Flex is the glue for the swf's, I have used eventing to communicate between each of the swf's; flash to flex, flex to flash. The eventing code I used was an adaptation of code shared by Jason Fincanon. The code is as follows:


The next phase of the map I have also now posted.



Here I have integrated the zoom functionality from Peter Organa (see earlier post). Thus the zoom.swf provided by Peter now listens to which continent was selected and loads the appropriate swf. Now a selected continent can be panned, zoomed into and out. This will allow, in the next phase, geolocated pins to be added to the map.

Wednesday, July 1, 2009

ArcGIS and the IPhone

I took the following from James Fee's blog:

Q: Will ESRI support the iPhone?

Yes, we will support the iPhone as a mobile platform to get maps from ArcGIS Server and do queries and edits on data from ArcGIS Server. We plan on releasing an application for the iPhone later this year and then adding additional capability as part of our 9.4 release. In addition developers can build their own solutions for the iPhone using the REST APIs available from ArcGIS Server.

I didn't think this would be too far away.

On another mobile note. I'm in line for beta testing the Nokia OVI API. Its an interesting process. Nokia have a limited number of beta slots. Once considered you then need to explain the mobile application you plan to build and whether you can get it done in 2 months.