MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




MapPoint 2002 - Reverse Address Lookup's in Delphi..

This is a discussion on MapPoint 2002 - Reverse Address Lookup's in Delphi.. within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I'm having loads of problems trying to reverse look-up addresses, i.e. the user provides just the Postcode or Street+Town I ...


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

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 08-19-2002
Junior Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 13
MapPoint 2002 - Reverse Address Lookup's in Delphi..

I'm having loads of problems trying to reverse look-up addresses, i.e. the user provides just the Postcode or Street+Town I then want to fill in the missing values; say if the user provides just a postcode I want to be-able
to extract the Street, Locality, Town, County etc.. from MapPoint.

I've had a go using both Location.FindNearby and Map.ObjectsFromPoint; but when I try and access a StreetAddress object from within the results I get an exception error even if the original request already had a Street Name, Town, Postcode etc. :-(.

I think I'm just chasing my own tail here im sure there is a problem with the OLE/ActiveX interface :-(

Anybody got any ideas?

Regards,

David Luck.
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 08-19-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Have you tried the ShowFindDialog method?
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 08-20-2002
Junior Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 13
I have not used the ShowFindDialog method but at a guess I would say that actually "displays" a dialog requiring user input, the problem is this is part of a Server system and the MapPoint objects are contained in a Thread so no direct user input is possible.
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 08-20-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Ok, I'm confused. I think you would need to discribe what you are doing a little more or at least post the code that is not working.

In the first post you said a user might only enter a postcode and you want to "extract the Street, Locality, Town, County etc" Do you have pushpins already on the map that you are trying to find the best match for?
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 08-20-2002
Junior Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 13
Ok here goes :)

We develop a control system for transport companies, at present each client PC has a copy of MapInfo installed and all Mapping, routing and postcode look-ups are done locally. Trouble is this means the client machines need to be pretty well spec'ed to actually make the system usable.

This is where MapPoint comes in, we have decided to opt for a Client/Server type Mapping system where the client systems (users) just post requests to a mapping server (very high-spec machine) which in-turn queries MapPoint for a Map, Route or address look-up, the server then returns an XML response to the client.

I have written the server product in Delphi and it has been designed as a multi-threaded application, so the MapPoint objects are self contained in their own thread and there-fore are only accessed when a request is to be processed, this means the system is stand alone and it is not possible for any direct user input into the MapPoint components, also all MapPoint COM/ActiveX objects are created and accessed at code level so there is no visible representation of MapPoint on the server.
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 08-20-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Can you post the sub/function where you try and access the streetaddress as you discribed so I can try a few things with it?

"but when I try and access a StreetAddress object from within the results I get an exception error even if the original request already had a Street Name, Town, Postcode etc."
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
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 08-20-2002
Junior Member
Yellow Belt
 
Join Date: Aug 2002
Posts: 13
This is'nt "exactly" what tried, but it was something along these lines:

mpLocation is the location from which I want to find the nearest Street, lets say for example the postcode for mpLocation is 'RG6 3XA'.

Note mpMap is a Public Object of TMap (MapPoint Map).

Code:
//mpLocation is the location we are trying to reverse look-up, the result/output
//(TLocation) is a custom object containing address information: street, town etc.
function TMapPointThd.FindNearestStreet(mpLocation : Location) : TLocation;
var
  mpResults  : FindResults;
  iResult    : Integer;
  oleCount   : oleVariant;
  oleResult  : oleVariant;

begin

  //Not sure exactly what this does but im told its nessessary??
  mpLocation.GoTo_;

  //Convert the given locaton to X and Y co-ord's on the map.
  mpResults := mpMap.ObjectsFromPoint(mpMap.LocationToX(mpLocation),mpMap.LocationToY(mpLocation));

  //Use an oleVariant object to store the number of results.
  oleCount := mpResults.Count;

  //do we have any results?
  if (oleCount > 0) then
  begin
    //loop through all the results.
    for iResult := 1 to oleCount do
    begin
      //Another ole variant is required to read the results so we convert the
      //integer iResults to an oleVariant type.
      oleResult := iResult;

      //Make sure the result is not nil.
      if (mpResults.Item[oleResult] <> Nil) then
      begin
        //Look up the street name..
        Result.Street := Location(mpResults.Item[oleResult]).StreetAddress.Street;
      end;
    end;
  end;
end;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 08-20-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
David,

There is NOT an easy way to do what you are trying to do (That I can see): ie just using a postcode and reterning the closest street.

About the most I could get the StreetAddress property to do was return the City if that was the only thing I omitted when I used FindAddressResults to get my Location object..

I think that when you tried to get a location object ("even when the original request already had a street name") the reason you got an error was Mappoint did not have enough info to get a match and returned Nothing. in other words when you tried to use the objLocStreetAddress.Street (or whatever) your objLoc was Nothing.

FindNearby method results are limited to the currently visible PlaceCategory objects (Like Restaurants, Airports etc..) So that wouldn't work even if you have a good location object.

Sorry I couldn't be of more help. If anyone else has an idea feel free to jump in!
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 08-20-2002
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
Check out this article:

Reverse Geocoding, Pt. III
Walt Cygan, a frequent contributor of late, submits this solution for tackling reverse geocoding

http://www.mp2kmag.com/articles.asp?ArticleID=50

"I use the ObjectsFromPoint method repeatedly at slightly different locations to attempt to find an address. "
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 08-20-2002
Eric Frost's Avatar
Senior Member
Black Belt
 
Join Date: Jul 1992
Posts: 2,470
Blog Entries: 1
As the Pt. III suggests, there were a couple articles before then.. http://www.mp2kmag.com/mappoint/disc...pic.asp?t=2966
__________________
~ Now taking orders for MapPoint 2009 ~
~
~ Upgrade to MapForums Plus membership ~
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
address, delphi, lookup, mappoint 2002, reverse


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
Getting address information of location object in delphi? Sheridan MapPoint 2006/2009 Discussion 1 03-07-2003 09:37 AM
Open a map of a special address with Delphi Rita P. MapPoint 2006/2009 Discussion 4 02-10-2003 06:02 PM
Address Verifier with Delphi yelmaci MP2K Magazine Articles 4 01-21-2003 12:19 PM
MapPoint reverse geocoding Anonymous MapPoint 2006/2009 Discussion 2 01-03-2003 10:13 AM
Reverse Geocoding with MapPoint 2002 Anonymous MP2K Magazine Articles 0 09-26-2001 12:48 AM


All times are GMT -5. The time now is 03:09 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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