ThinkGeo.com    |     Documentation    |     Premium Support

Map Suite Service Edition 3.0 Geocoder

Hi,


Could anyone show me how to write a geocoder by using Map Suite Services Edition 3.0?


Any tips and sample code will be very valuable to me


Thanks.






 


Kevin,


Here is just some general tips how to make a Geocoder with Service Edition, I'm sure to make an accurate and efficient one, there are still a lot of work to do. 


Reverse Geocode (Point Coordinate → Address Info)


This part is relatively easier. Call the method layer.QueryTools.GetFeaturesNearestTo() and input the point coordinate, you will find the nearest features. Get the tabular data you want and that's it. One thing to remind is that you need to call this method for every layer. if you want to get the nearest road and nearest railway to the same given point for example, you need to call it for different layers separately.


Geocode (Address Info → Point Coordinate)


This part is a bit tougher. As your address is usually be scattered on multi data, what you mainly need to do is to shrink the target area from pieces of info, make the candidates smaller and smaller and finally locate to a point. For example, your address is “1617 St. Andrews Dr. 66047”, first you need to get the area of 66047 from the zip5 data, and then you need to get all the roads within that area, get each one's address and compare with “St. Andrews Dr”. At the end, calculate the position of “1617” on that road and try to return the final point. As there are all kinds of address, like I can say “Lawrence, KS” instead of the zip 66047, you should have different kinds of data to handle the different address formats. Also you might want to support some options like fuzzy street name, ignore street type, etc. 




Here is a GeoCode Sample for you, maybe you can get some insights.


onlinedemos.thinkgeo.com/geocodeusa/




Hope you have a great geocode tool with Service Edition, and I'm glad if you can share with us your ideas.


Thanks,


Ben