Category Archives: Street Level Maps

Introducing MBA Maps

Street Level Mapping and Location Analytics for the rest of us

 

Over the years we have seen the importance of visual presentation of data using charts and graphs. In our minds, it’s equally important to be able to present data in the form of maps. Whether you are interested in presenting your data at the street level or at a higher geographic level, maps are a great way for viewing spatial relationships.

Here at MineQuest we’ve been working on creating a hybrid mapping service for WPS users. Our first release of the software called MBA Maps (MineQuest Business Analytics Maps) is a first cut at being able to use street level mapping to display data. This release (v0.1) is heavily weighted towards the utilities needed to manipulate data and interface into the cloud services that create the map tiles and perform the geocoding.

Initially, MBA Maps will be available on Windows workstation and followed by Mac workstations a bit later. Linux compatibility will also be made available as well as server platforms for Windows and Linux. We use the Interop for R (PROC R) procedure quite heavily to geocode and create maps. Specifically, we use David Kahle and Hadley Wickham’s ggmap tools for creating street level maps. We use WPS for the data processing and background program creation that manages the mapping calls. WPS is also used as the standard interface for all data management. Meaning, we store all our data in WPS data sets.

We will be releasing the first version of MBA Maps in January. Almost all the programming has been completed and testing continues. The documentation is still a work in progress and is about 50+ pages in length. There are numerous examples (see below) that are used in the documents, but we want to add some additional sample programs to the release. We’re strong believers in learning from code examples around here. We are also trying to include some data sets for learning how to use MBA Maps.

We anticipate creating a free version of MBA Maps that will be limited to using Google services. There are some restrictions by Google and they are a maximum of 2,500 records that can be geocoded a day and 2,500 map requests per day.

Eventually, and sooner rather than later (goal is 2nd quarter 2018) we will create a set of licenses so that those customers who have purchased their WPS licenses through MineQuest will receive a highly enhanced version of MBA Maps as part of their WPS purchase. This enhanced version will allow for using other services for geocoding and mapping. Services such as Bing and OSM will be provided. Access to a remote server hosted by MineQuest may also be included.

Those who purchase their licenses from other resellers or directly from World Programming will have the opportunity to acquire MBA Maps as a separate purchase from MineQuest. Pricing is undecided at this time but there will be an annual license and you will have to renew your MBA Maps licenses through MineQuest to access these additional features and services.

All versions will require a registration and license agreement.

What exactly does MBA Maps do? It allows you to create street level maps and geocode your data. If you have a small number of records to geocode (less than 2500 a day) and a small number of maps to display (also less than 2500), MBA Maps is probably all you need to create and display maps of your data.

If you have larger needs than the 2500 limitation for maps and geocoding, then you will need the non-free version of MBA Maps to get around those limitations. That will be available at a later date.

Here are a few examples of what you can do with MBA Maps.

MBA Maps can geocode a City name, a place in a city such as a park or monument or an address. In the next few pages are examples of creating a “street map” using Google map tiles and placing position markers and labels on the map.

 

This first example demonstrates placing a city on a map and labeling it. The data used was geocode at the City level (i.e. places) and using that to create and display the map.

 

Code used to create Midwest State Capitals.

libname mapdata ‘c:\mbamaps\mapdata’;

%gstreetmap(data=mapdata.midwestatecapitals,

maptype=roadmap,

label=locality,

title=”Midwest State Capitals \nUnited States”,

footnote=”Google Map Created by MBA Maps \nMineQuest Business Analytics LLC \nCopyright (c) 2017″,

mapout=”c:\\temp\\midweststatecapitals.jpg”,

mapwidth=11,

mapheight=8);

 

clip_image002

 

 

The second example is plotting attractions on the map. Here we geocoded some London attractions using the name of the attractions. We then use the name of the attraction (variable name site) as the label on the map.

 

Code for creating London Attractions Map

%gstreetmap(data=mapdata.londonattractions,

maptype=roadmap,

label=site,

title=”London Attractions, 2017″,

footnote=”Google Map Created by MBA Maps \nMineQuest Business Analytics LLC, \nCopyright (c) 2017″,

mapout=”c:\\temp\\londonattractions.jpg”,

mapwidth=8, mapheight=11);

 

clip_image004

 

 

 

The third example is a map of gas stations in Powell, Ohio. We first geocoded the addresses of the gas stations to get their proper latitude and longitude. We then took the geocoded addresses and used them to plot the points on a street map. This demonstrates plotting of addresses on a map.

 

Code for Creating Powell Ohio Gas Stations Map.

 

%gstreetmap(data=mapdata.geocodedpowellgasstations,

 maptype=roadmap,

 label=company,

 title=”Powell Ohio Gas Stations \nUnited States”,

 footnote=”Google Map Created by MBA Maps \nMineQuest Business Analytics LLC \nCopyright (c) 2017″,

 mapout=”c:\temp\powellgas.jpg”,

 mapwidth=11,

 mapheight=8);    

 

 

clip_image006

 

 

 

 

Finally, our fourth example using MBA Maps demonstrates how we can even create a hybrid map. A hybrid map is a satellite view with street names embedded in the map. The map below uses the homes estimated value as a label for the marker. We geocoded a number of addresses at Skyline Country Club in Tucson, AZ. The records we used also contained a value of the homes current price. We used a hybrid satellite map to plot the addresses with the estimated home values on a Google map.

 

 Code for creating hybrid street level map.

%gstreetmap(data=mapdata.homeprices,

  maptype=hybrid, label=homevalue,

  title=”Skyline 5th Fairway Home Values \nTucson AZ”,

  footnote=”Google Map created by MBA Maps \nMineQuest Business Analytics LLC \nCopyright (c) 2017″,

  mapout=”c:\temp\homeprices.jpg”,

  mapwidth=11, mapheight=8);

 

 

clip_image008

 

 


 

Example code for geocoding street addresses which is used for the hybrid google map above.

libname mapdata ‘c:\mbamaps\mapdata’;

 

data a;

length homevalue $6;

input homeaddress $1-44 price 45-48;

homevalue = put(price,comma5.)||’K’;

cards;

4795 E Quail Creek Dr. Tucson AZ 85718       464

4779 E Quail Creek Dr. Tucson, AZ 85718      544

4757 E Cherry Hills Dr. Tucson, AZ 85718     470

4749 E Cherry Hills Dr. Tucson, AZ 85718     449

4880 E Placita Tres Vidas, Tucson, AZ 85718  799

4860 E Placita Tres Vidas, Tucson, AZ 85718 1795

4840 E Placita Tres Vidas, Tucson, AZ 85718  728

;;;;

run;

 

Proc print data=a;

Title “Data to be geocoded”;

run;

 

 

%geocode(api=google, data=a, outdata=b, geocodevariable=homeaddress);

 

proc print data=b;

Title “Geocoded Home Addresses”;

run;

 

 

*–> merge in the geocoded data set with the existing data set;

 

data homeprices;

merge a b;

run;

 

This gives you an idea of what we will be introducing in January of 2018. We have lots of ideas behind our mapping and want to create a whole area of tools and applications for location analytics. Watch this space for an announcement of availability.

 

About the author: Phil Rack is President of MineQuest Business Analytics, LLC located in beautiful Tucson, Arizona. Phil has been a SAS language developer for more than 25 years. MineQuest provides WPS consulting and contract programming services and is an authorized reseller of WPS in North America.