MapPoint Forums

MapForums

Community of MapPoint and Virtual Earth Users and Developers




MapPoint Control from Visual C++ : Getting a postal code

This is a discussion on MapPoint Control from Visual C++ : Getting a postal code within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hi everyone: I want the postal code of a region on which the user clicks to be returned. So I ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Today's Posts Twitter Feed Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2006
Junior Member
Yellow Belt
 
Join Date: Jun 2006
Posts: 13
MapPoint Control from Visual C++ : Getting a postal code

Hi everyone:
I want the postal code of a region on which the user clicks to be returned. So I use the 'OnBeforeClickControl1()' event handler and what I do is the following:

void CMapPointTest1View::OnBeforeClickControl1(long Button, long Shift, long X, long Y, BOOL FAR* Cancel)
{

m_location=m_map.XYToLocation(X,Y);
m_location.GoTo();
m_location.Select();
CStreetAddress sa = m_location.GetStreetAddress();
CString postalcode=sa.GetPostalCode();
}
m_location is a CLocation object, m_map is a CMap1 object.
But the CString 'postalcode' is empty! WHY ???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 06-25-2006
Member
Green Belt
 
Join Date: Mar 2005
Posts: 97
Hi geouser,

When you click somewhere in your region, you have to check if it is a GOOD ADDRESS. If not, you have to look for the NEAREST one. Thus, you can get the street, the postal code, and so on.

Look in this forum for the REVERSE GEOCODING discussion.
I remember, I've seen here a good article about getting nearest address.

Hope this will help

Ciao
__________________
Mohamed
www.AtlasCouscous.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 06-25-2006
Junior Member
Yellow Belt
 
Join Date: Apr 2006
Posts: 20
I think a spiral approach was used in finding the nearest good location.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 06-26-2006
Junior Member
Yellow Belt
 
Join Date: Jun 2006
Posts: 13
exactly! From what I know so far it should be a loop searching for good results. And it seems to work. But even the good locations do not return a postal code from the CFindResults object. Anyway: Good location or not, it should be possible to have the postal code or - better - the FIPS code for any spot in the US. If you click somewhere in the desert of Nevada with no popular place around, there must be a FIPS code for that region.....
geouser
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 06-26-2006
Junior Member
Yellow Belt
 
Join Date: Apr 2006
Posts: 20
FIPS ?

First Intersection Partly Somewhere?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 06-27-2006
Junior Member
Yellow Belt
 
Join Date: Jun 2006
Posts: 13
Hi: Federal Information Processing Standard (FIPS) codes for counties used by the U. S. Census Bureau, see http://www.census.gov/geo/www/fips/f...a/national.txt
every county has one. IM searching for the possibility to have the county returned after the user clicks on the map.
geouser
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 06-27-2006
Junior Member
Yellow Belt
 
Join Date: Apr 2006
Posts: 20
Thanks. Good information.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
code, control, mappoint, postal, visual


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
Problem with MapPoint control redraw in Visual c++ Anonymous MapPoint 2006/2009 Discussion 2 11-21-2004 04:04 PM
Control of MapPoint 2002 using Visual Basic .Net DogsWorld MapPoint 2006/2009 Discussion 1 02-26-2004 10:53 PM
MapPoint 2004-Create Territories Using Full Cdn Postal Code wkcarreg MapPoint 2006/2009 Discussion 1 01-30-2004 11:46 AM
MapPoint 2002 ActiveX control and Visual Studio .NET 2003 chulaka MapPoint 2006/2009 Discussion 1 09-30-2003 10:35 AM
How to get a postal code huelsi MapPoint 2006/2009 Discussion 0 07-27-2003 12:00 PM


All times are GMT -5. The time now is 01:44 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 RC2
MP2K Magazine
Visitor Map

Florida Holiday
Book your Florida holiday through UlookUbook and save cash!

Nightlife London
Looking for Nightlife in London? Look no further, and click here!



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59