GIS Location Services in Dynamics CRM

GIS Location Services in Dynamics CRM

A design paper about implementing GIS-based services for a local Council in Dynamics CRM, structuring address data, and delivering location services in the form of WebAPI endpoints via an Enterprise Service Bus.

 

What is GIS

A Geographic Information System (GIS) is a computer system for capturing, storing, checking, and displaying data related to positions on Earth’s surface. GIS can show many different kinds of data on a map, such as streets, buildings, and vegetation. This enables people to more easily see, analyse, and understand patterns and relationships.

GIS can use any information that includes location. The location can be expressed in many different ways, such as latitude and longitude or address. Many different types of information can be compared and contrasted using GIS. The system can include data about people, such as population, income, or education level. It can include information about the land, such as the location of buildings and assets.

 

Location Information in CRM

This experience is about providing location services in the context of a local Council in Melbourne, Australia. The vision of Council is to have a single view of their customers (landlords, tenants and businesses), and have identified the Dynamics CRM platform as the master data source for case management. Information about location of properties and assets is made available in CRM from the GIS system in order to provide location-based services, also via the Council’s web portal.

Location information is structured as follows:

·         Geo-coordinates

Utilised for identifying an exact point on a map, and for GPS applications.

o   Latitude: Specifies the north-south position of a point on the Earth's surface. It is an angle which ranges from 0° at the Equator to 90° at the poles.

o   Longitude: Specifies the east-west position of a point on the Earth's surface. It is an angle which ranges from 0° at the Prime Meridian to +180° eastward and −180° westward.

 

·         Address in Australia

Utilised for identifying a residential or business place, and for postal correspondence.

o   Unit or Apartment number: Optional number of a unit or apartment in a town house or similar.

o   Street name and type: Required.

o   Suburb: Required.

o   Postcode: Required, but it can be resolved by the Suburb name.

o   State: Required, but defaulted to “Victoria” for this purpose.

 

Location services can be based on geo-coordinates or on address

 

Principles of Integration of GIS Data

The following principles apply when dealing with geographical data (not an exhaustive list).

Type

Name

Description

Compliance

Open Geospatial Consortium

The GIS system is OGS-compliant and adheres to the Open Geospatial standards http://www.opengeospatial.org/standards

Compliance

Geo-coordinate format

The CRM system is able to store geo-coordinates in either of the following standard formats:

·         NMEA 0183 (used by most commercial GPS applications)

·         WGS84 (World Geodetic System)

Integration

Geography Markup Language

The CRM system is able to export location information for a specific entity using the GML format http://www.opengeospatial.org/standards/gml

Integration

GeoAPI

The CRM system, or its integration layer, exposes services that provide endpoints for GeoAPI http://www.opengeospatial.org/standards/geoapi

 

For additional information about geo-coordinates, and how to convert from one format to another one, please read my article Converting GIS spatial coordinates.

 

Data Structure

In light of the minimum information to capture for locations, and the compliance and integration requirements, the following data structure is implemented in the CRM and/or the integration layer.

·         Geo-coordinates

Name

Type

Format

Latitude

Decimal

-90.0 to 90.0

Longitude

Decimal

-180.0 to 180.0

 

·         Address

Name

Type

Format

Unit Number

Text(10)

Alphanumeric

Street Address

Text(100)

Alphanumeric

Suburb

Text(100)

Alphanumeric

Post Code

Number(4)

Four digits

State

Text(3)

Fixed to Victoria

Country

Text(30)

Fixed to Australia

 

Dynamics CRM 2015 already contains a standard Address entity that fits the purpose. Latitude and Longitude are available fields, although not assigned to the Address form out of the box. This can be simply done by adding the two fields to a proper section in the form. An address can be associated to a parent entity (owner), and an address type can be specified (e.g. residential, correspondence, etc.). Multiple addresses can be assigned to an owner, with different address types.

2016-02-16 10_59_03-Dynamics2015 on YOGA - Virtual Machine Connection

Address form in Dynamics CRM with Geo-coordinates

 

Message Flow in the Enterprise Service Bus

The Council has a robust infrastructure with an Enterprise Service Bus based on BizTalk. Besides providing the means for service orchestration, the ESB implements a Publish and Subscribe architecture pattern, by which a message is processed by the adapter and associated pipeline, and is routed to an interested party. A BizTalk orchestration or send port can register its interest in a specific message via subscriptions. The Publish and Subscribe model is an asynchronous programming technique that makes it easier to share information between entities that send information (publishers) and entities that receive information (subscribers).

The Publish-Subscribe pattern in the ESB

 

Location data flows from and to the CRM system via an Enterprise Service Bus. The GIS system represents the application for resolution of location data and geographical representation, whereas CRM is the master data repository of location information for each relevant entity (property, individual, asset).

External applications, such as the Council’s Web Portal, requesting location services, will access the relevant API exposed by the Service Layer. The API provides location information as stored in the CRM (message queueing mechanism may be in place for optimisation of performance). Specific location services, such as visualisation of points on a map, will be delivered by the GIS system, which is informed of such request by the ESB. By implementing the Publish-Subscribe pattern, the GIS system will subscribe to receive updates (“signals”) from the ESB for anything that is related to location. When such a signal is broadcast by the ESB, as a result of a request from the API, the subscribed application (the GIS in this case), will receive the message and provide its services to the requestor.

 

Location data flows from and to the CRM via the ESB

 

Service Layer and API

The Service Layer, implemented as part of the Enterprise Service Bus, exposes several Application Programming Interfaces for consuming location-based services. Examples of services that can be implemented (not a fully comprehensive list at this stage) are:

·         GeoAPI: The GeoAPI defines a set of services that can be used for the manipulation of geographic information structured following the specifications adopted by the Technical Committee 211 of the International Organization for Standardization (ISO) and by the Open Geospatial Consortium (OGC).

·         GeoCoordinates: Geo-coordinate services define transformation between coordinate sets used by the CRM (WGS84 World Geodetic System – data as stored in the CRM) and GPS-based applications (NMEA 0183). This service implements also address geocoding and reverse geocoding.

·         Post Address Lookup: Implements address lookup services based on the Australia Post postcode database, which contains every known postcode, along with state, territory and suburb (locality) information.

·         Location Services: Implements location-based services available to external applications, such as a web portal or mobile apps. This includes proximity, geo-fencing and directions. Information is returned using GML (Geography Markup Language) for cross-platform compatibility.

 

Internal implementation of the API as accessible by the CRM and the GIS systems via the ESB is done using the ASP.NET WebAPI technology, building relevant “controllers” and “models” for each entity.

WebAPI provides an HTTP-based RESTful platform for CRUD operations (Create Read Update Delete) on entities that abstracts from the specific implementation in the source and target systems (CRM and GIS). The public API exposed by the Service Layer, as listed before, consumes the available WebAPI internally for communicating with the relevant system, via the ESB and without accessing the system directly. Messaging queueing may be put in place for optimisation of reliability and response performance and throughput.

 

API Layer Components

 

Australia Post Address Lookup

Australia Post provides an online service available at the URL:

http://auspost.com.au/postcode

This service looks suburbs, towns, cities or postcode up in its internal postcode database, and resolves to a fully qualified address. The postcode database contains every known postcode, along with state, territory and suburb (locality) information. The database is available for sale for business purposes.

 

Address Geocoding

Geocoding is interpolating spatial locations (Latitude and Longitude coordinates) from street addresses. Individual address locations can be interpolated, or estimated, by examining address ranges along a road segment. GIS software approximates where that address belongs along the segment. For example, an address point of 500 will be at the midpoint of a line segment that starts with address 1 and ends with address 1,000. Geocoding can also be applied against actual parcel data, typically from municipal tax maps. In this case, the result of the geocoding will be an actually positioned space as opposed to an interpolated point. This approach is being increasingly used to provide more precise location information.

 

Reverse Geocoding

Reverse geocoding is the process of returning an estimated street address number as it relates to a given coordinate. For example, a user can click on a road centreline theme (thus providing a coordinate) and have information returned that reflects the estimated house number. This house number is interpolated from a range assigned to that road segment. If the user clicks at the midpoint of a segment that starts with address 1 and ends with 100, the returned value will be somewhere near 50. Note that reverse geocoding does not return actual addresses, only estimates of what should be there based on the predetermined range.

 

Location Services

Several location-based services can be exposed to the public (or external applications) based on the location of the requestor (an individual or an application), and the geographical data provided by the CRM. The GIS system can be leveraged for data calculation and transformation, and for displaying such information on maps.

Services exposed by the GIS application, in connection with location data available in the CRM, may be:

·         Proximity: List of businesses, assets and public services in the proximity of a place or an individual, whose location is identified by means of GPS technology.

 

·         Geo-fencing: Restriction of services based on natural or artificial boundaries.

 

·         Directions: Step-by-step indication on how to go from point A to point B on a map, by using different media of transportation, including public services.

 

·         Tracking: Fleet tracking and reporting on utilisation.

 

·         Route optimisation: Optimisation of routes for delivery of services.

 

·         Network planning and design: Optimisation of networks for building works, such as fibre networks, sewage, gas, etc.

 

·         Real estate: Price history, virtual tour, crime rate and other real estate-specific services on streets and neighbourhood.

 

This initial presentation of services gives an overview of the location-based applications that can be implemented having Dynamics CRM and a GIS system at the core of the operations. In a series of future articles, I will present the implementation of most of these services using a combination of different technologies fit for purpose, including a Kentico 9 web portal, Dynamics CRM 2016, BizTalk Server 2013 and ASP.NET WebAPI 2.

 


  Comments

 

 Related Content
A flexible Default Value for your DateTime properties
When creating an MVC application with Entity Framework, it is possible to set default values for most properties in a model using the DefaultValue attribute. However, no much flexibility is offered for a DateTime property. This article presents a custom validation attribute for DateTime types that accepts different formats for defining the default value of the property.
Adding a Secured Geo-located Audit Trail
How I built a social sharing component for my own web site and added a secured geo-located audit trail. Step by step, let’s analyse technologies and source code for developing this component.
Adding Social Sharing to a Web Site
How I built a social sharing component for my own web site and added a secured geo-located audit trail. Step by step, let’s analyse technologies and source code for developing this component.
Best practices for mobile form design in SharePoint
Build effective SharePoint forms with Nintex that are accessible anywhere, at any time, and on any device. You built the workflows, you built the forms, now make them mobile.
Bring your “A” game to ESPC16
With just over 3 weeks to go to Europe's largest gathering of SharePoint & Office 365 professionals, take a look at these tips that will help you get the most out of ESPC16…
Building an MVC application for SharePoint
Learn how to write code to perform basic operations with the SharePoint 2013 .NET Framework client-side object model (CSOM), and build an ASP.NET MVC application that retrieves information from a SharePoint server.
CIO vs CTO
What are the synergies and differences of the roles of a Chief Information Officer and a Chief Technology Officer? An open conversation about two roles with one mission…
Coded UI test automation of MVC applications with Visual Studio
Whether you are a software developer, tester, administrator or analyst, this article can help you master different types of UI testing of an MVC application, by using Visual Studio for creating coded UI test suites that can be automated for continuous execution.
Converting GIS spatial coordinates
Different formats and standards exist for describing geographical coordinates in GIS systems and applications. This article explains how to convert between the most used formats, presenting a working library written in C#.
Creating mobile accessible forms in SharePoint
With the release of the Nintex Mobile apps, SharePoint users can now optimise their experience across popular mobile devices and platforms.
Define your Performance Testing strategy with Visual Studio
Performance Testing is an essential part of software testing, with the specific goal of determining how a system performs in terms of responsiveness and stability under a particular workload. In this series of posts we’ll define and execute a good strategy for testing performance of an application using Visual Studio.
Disserting about colliding GUIDs and the Big Bang Theory
Can you generate two identical GUIDs? Would the world end if two GUIDs collide? How long does it take to generate a duplicate GUID and would we be still here when the result is found?
Group or Team?
All teams are groups but not all groups are teams. What defines a group and what a team? When do we need one over the other one?
How to Give Constructive Feedback
Learning to give and receive constructive feedback is an essential part of learning, growing, improving and achieving our goals.
Mirroring an iPad on your laptop
Have you ever wanted to see your iPhone or iPad on a larger screen? Play games, watch movies, demo apps or present to your computer from your iPhone or iPad. Reflector mirrors iOS devices on big screens wirelessly using iOS built-in AirPlay mirroring.
Mobilize your SharePoint workflows
Build workflow applications in SharePoint that can be accessed on mobile devices using the Nintex solution for business process mobilization.
Natural String Sorting
Have you ever desired to have in your code a way to order a sequence of strings in the same way as Windows does for files whose name contains a mix of letters and numbers? Natural string sorting is not natively supported in .NET but can be easily implemented by specialising a string comparer and adding a few extensions to the enumerable string collection.
Sales Effectiveness in Dynamics CRM with Azure IoT and Machine Learning - Part 1
How can an organisation optimise its sales channels and product targeting by building a 365-degree view of its customers in Dynamics CRM? The answer, and topic of this article, is with the help of Azure IoT and Machine Learning services!
Scaling Applications with Azure Redis and Machine Learning - Part 1
This article presents design best practices and code examples for implementing the Azure Redis Cache and tuning the performance of ASP.NET MVC applications, optimising cache hit ratio and reducing “miss rate” with smart algorithms processed by Machine Learning.
Software Development Management in 11 steps
What it takes to be a great Software Development Manager? I have been building software for the last 15 years and have collected a few stories and experiences to share. Some I have used as questions when interviewing candidates. In 11 points, this is my story to date.
SOLID SharePoint apps with MVC
Practical code examples of ASP.NET MVC applications that connect to a SharePoint Server and comply with the SOLID principles.
The art of outsourcing projects
Outsourcing may look financially attractive, but working with companies in far-off lands introduces challenges that, if not considered properly, can drive any project to failure. Let’s explore some common pitfalls when working with offshore partners and a common-sense approach to work around them.
The value of hashtags
Customers expect a modern approach to advertising. Digital advertising can leverage evolving technology to provide just-in-time, just-at-the-right-place promotions.
We don't need no Yoda's syntax
There is an urban myth in the programmers’ community that the so called “Yoda’s syntax” performs better when checking an object for nullity. Let's demystify it...