PDA

View Full Version : FindAddressResults NOT working in PowerFlex



kenosee
10-10-2012, 07:21 AM
Hi
I have been integrating Powerflex v5 release 6 (PFX) withMicrosoft Mappoint using COM which, in the main, has worked quite well.
I can now send place names, postcodes or lat/lon co-ords andretrieve accurate maps, routes, distances, drive times, locations etc.
I still have some problems and would very much appreciate ifanyone can shed some light on what is going on!

Mappoint includes various location find commands:-FindPlaceResults, FindResults, FindNearby, FindAddressResults andObjectsFromPoint
If successful each of these commands returns a locationobject which is a set of possible results together with a deemed quality of theresults set ie FindResults\Count and FindResults\ResultsQuality
If the found location is interpreted as an address then an additional objectis created oLocation\StreetAddress where the StreetAddress object containsfields for :- Street,City,OtherCity,Region,Postalcode,Country

I have written a VB script to perform various addressfinding techniques which work perfectly, however, when converted to PFX theyonly partially work.
All find methods except FindAddressResults provide the sameresult in VB and PFX.
In FindAddressResults both PFX & VB appear to provideidentical Location Objects in terms of NAME,Latitude/Longitude, however, onlyVB creates the StreetAddress object.

The four methods I’ve used inMappoint are:
FINDRESULTS &FINDPLACERESULTS & OBJECTSFROMPOINT where the input is a single string eg“Sevenoaks,TN14 5DE” or “Otford Road, Sevenoaks,Kent,242” etc(242=UK)
FINDADDRESSRESULTS where theinput is six quoted comma separated strings for “STREET”,”CITY”,”OTHERCITY”,”REGION”,”POSTALCODE”, ”COUNTRY”
Eg:-“”,”Sevenoaks”,””,”Kent”,”TN14 5DE”,”242”

It appears that Mappoint parsesall this input and tries to make sense of the string in terms of the sixaddress parts.
Only those derived addresseswhich mappoint determines contains a street name generate a streetaddressobject.

VB oFINDRESULTS=oMAP.FINDADDRESSRESULTS(“”,””,””,””,” TN14 5DE”,”242”) and
PFX oFINDRESULTS=0MAP\FINDADDRESSRESULTS(“”,””,””,””,” TN14 5DE”,242)
Both yield identical LOCATIONOBJECT results COUNT=1, QUALITY=1,TYPE=12,NAME=TN14 5DE,United Kingdom.
Neither produces a streetaddressobject

VB oFINDRESULTS=oMAP.FINDADDRESSRESULTS(“Otford Road”,””,””,””,”TN14 5DE”,”242”)
Yields LOCATIONOBJECT results COUNT=1, QUALITY=1, TYPE=-1, NAME= Otford Rd, Sevenoaks TN14 5
And a STREETADDRESS OBJECT ofOtford Rd,Sevenoaks ,,Kent,England,242
Wheras:
PFX oFINDRESULTS=oMAP\FINDADDRESSRESULTS(“Otford Road”,””,””,””,”TN14 5DE”,”242”)
Yields Error ‘Exceptionduring invoke,cannot parse an address within …’ Error 1224

The same goes for FINDRESULTSand FINDPLACERESULTS – If Mappoint interprets the input as a STREETNAME VB generatesboth the
LOCATION & STREETADDRESSOBJECT wheras PFX generates neither object.

I need to obtain the streetname of the postcode. Using ObjectsFromPoint in PFX, I can get a list of names, one of which invariably holds the streetname of the input postcode but I don't know which one. As far as I understand only the generation of the StreetAddress object will give the actual streetname for the postcode.

Any help will be greatly appreciated
Thanks

Eric Frost
10-12-2012, 08:20 AM
Did you figure this out? I am curious. My first thought was that in VB it is automatically casting some string to an object or vice versa, and you must do this explicitly in PowerFlex. Is this what could be generating the error "cannot parse an address within"? Maybe it is looking for an object? Sorry if I am not helping. I guess it would help if I had a Powerflex environment set up. Do you have a link for a Download?

Richard M. -- from your experience developing MapPoint with different languages (Python, F#) can you figure out what's going on with the code above?

Thanks!
Eric