PDA

View Full Version : VBA - Mapping by congressional districts/custom geographic areas



mforando
02-16-2012, 02:59 PM
Hi All,

I have been able to automate map creation through excel for mapping by zip code, county, state, etc. Recently, I have been using the Spatial Data Importer to import MapInfo shape files containing shapes for CBSA's and HRRs (Health regions defined by CMS). Both of these match up directy to county lines, so as a work around I create shaded maps by mapping by county, and then overlay the CBSA/HRR region outline on top of the shaded area map. I turn off the county borders, and since the counties contained in each CBSA/HRR have the same data, they are the same color. With the CBSA outline on top of this, it creates some nice looking maps.

However, I would really like to create shaded maps by congressional district. I was able to obtain the shape files for these regions. However, since they do not line up directly with zip codes, county lines, or any other geographic region available in Mappoint, I dont think I can use the same method.

Has anyone come across any other methods to graph using regions not included in MapPoint 2011?

I am familiar and comfortable using the QueryShape method, and have used this to display pushpins within each shape as I cycle through different regions. Is there anyway to use this to later create shaded maps?

Thank you,
-Mason

Eric Frost
02-16-2012, 03:27 PM
Hello Mason,

Welcome to the Forums! Although from your PM, it sounds like you've already been here a while --


Thank you for all of your postings in the forums. They have been incredibly useful to me learning mappoint's object model and all the features available.

Anyway, you're welcome and glad you decided to participate in the forums. Hopefully you will find an acceptable solution.

You said you found shape files.

There are tools for importing from shape files into MapPoint shape objects. You can't really manipulate shape objects like you can with other datasets using the Map Data Wizard, but it works.

There is this old "developer sample" VBA code --

Download: MapPoint Spatial Data Import COM Add-in - Microsoft Download Center - Download Details (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=19947)

It's buggy, but it has source code so you can modify it however you want e.g. to shape based on certain characteristics (red or blue, etc.)

The people MS hired to write the above "developer sample" polished the tool off a little and made a commercial tool for end-users --

Microsoft MapPoint (http://www.shapesource.com/scripts/prodList.asp?idCategory=47)

Also, Richard Marsden who is very active in here developed MPSuperShape a few years ago that has a number of features for working with shapes in MapPoint including the ability to import from shape files.

http://www.mpsupershape.com/

hope this helps and let us know how it goes!
Eric