how to map crawled locations to existing locations in the database - google-maps

Background: I am building a website which crawls data from real-estate websites (a sample project) in hong kong. I crawl different websites, for various property listings. Hence I get a variety of locations formats from the raw crawled locations
Example:
few Samples of raw crawled locations:
North Point
8, Java Road, North Point, Hong Kong
Hong Kong Island , North Point
As can be seen from the above addresses, the same district in hong kong, that is North point can have many forms, few have been listed above. Issue is that this data doesnt make sense unless it is mapped/structured
Requirement:
I want some elegant solution, to be able to map these raw crawled locations to a pre-defined set of values. One way I can think of is, create a database of locations (I am using mysql), and find out the matching locationId for each crawled raw location.
If the above scheme sounds good, then my database would have fields like the below:
LOCATION_REF, country, state,city, locality, subLocality1, subLocality2, lat, long
Additional information: I am also using apache solr (lucene) to built this website, so any solr related matching suggestions are also welcome
Thoughts: I think there must be some predefined APIs to do things like this, because almost every app I see have location based searching and filtering. Is there a google api to do this? If yes, I would appreciate if anyone could help with good examples
PS: I use Jsoup to parse data from the pages (to extract raw location)

I have found out a way to do it, and Google geocoding anwers all the questions that I asked.
Google geocoding API maps the raw address format to its own format, gives structured data of the location based on the location hirarchy (example street number, neighbourhood, locality etc etc . This is what I needed
Here is the link for reference: https://developers.google.com/maps/documentation/geocoding/intro

Related

Finding businesses with Google Virtual Tour panoramas

I am wondering if it's possible in any way to get a list of businesses that have done a Google Virtual Tour (basically a Street View, for businesses) by querying in Google Maps API.
I was hoping that perhaps the Places Library might contain this information in a response, but no dice. This is kind of visible in an everyday map (see Hotel Boulderado) but I don't think the information is included in any kind of query I can do.
I also saw a few questions dealing with finding a Street View by a specific LatLng - I'm looking for a more general, area-based search.
Any ideas or things I missed?
I was hoping that perhaps the Places Library might contain this information in a response
Places API can provide you a "list of businesses" in an area by trying to filter it up with specific Place Types. You are, however, limited to the constants the API provides. If you're using PlacesService, you can use nearbysearch which I think is more appropriate to your case.
I also saw a few questions dealing with finding a Street View by a specific LatLng - I'm looking for a more general, area-based search.
I'm not sure what you mean by "area-based search", but Street View on a specific LatLng can be tricky since its only available on some areas. The Explore StreetView site highlights what countries currently have data (zooming in suggests that it doesn't necessarily captured the whole country; mostly are road routes, etc.)
A StackOverflow entry indicates a way to handle if StreetView is available or not.
Hopefully the answer raised some clarifications in your end.

Displaying names of countries/cities in russian language openstreetmap

I'm trying to implement maps service in my project. The project is focused to russian-speaking countries. But in future I hope to expand audience. The problem is that different services show different names.
OSM shows local names- for example Chinese towns are not clear for me. Google maps shows - user sees all names in the world in his native language: if a'm russian I can see all names in russian lunguage, including names of streets in USA for example. But Google maps costs a lot for me now.
How to solve the problem and what free/cheap services did you use? Сartography isn't the main feature in the project but important.
This isn't a full answer, but may be of some help. There are two ways of approaching the problem using OpenStreetMap data. 1. Russian names are sometimes provided: the tag is name:ru. However, there are very few of them. They're mostly for countries and major cities. For example, London has name:ru=Лондон. 2. But if you want everything which doesn't have a name:ru to appear in the Cyrillic alphabet, you'll have to transliterate from the most convenient source: the local name if it's in some easily transliterable script like Roman or Greek; or the English name (say) if not.
So, taking the second approach, the way I would do it would be to download the OSM data and pre-process it, inserting a transliterated name:ru where one did not exist, then render the map (using, for example, Mapnik, which is free), using a style sheet modified to use name:ru, where available, for all labels.
This, however, is an off-line solution. I realise that you probably want something on-line. Perhaps you could use Mapbox with on-line vector tiles, again pre-processed in some way before they are rendered.

How to plot historic country data (USSR, East Germany, etc) in GoogleMaps?

I'm building a series of infographics using Fusion Tables to show yearly data for countries, each nation represented by a pin on Google's map, the data values visible when you click on the nation's pin. I've got the contemporary values working perfectly, but:
My data goes back 80 years and I'd like to allow users to view historic data for non-existant countries like USSR, East / West Germany, etc.
Are there "archive" world maps that I can use when uploading historic data to Fusion Tables? (eg, world map for 1988, world map for 1934)
If not, I can simply use the contemporary map and select pin locations to approximate the old countries, but it wouldn't look so good. I'm neither sufficiently clever nor able to invest the time to create new world maps - I figure someone must have had this problem before now, but I can't find anything.
Any suggestions gratefully appreciated.
Best,
T.
If you can't find what you need on GeoCommons, this site provides a tutorial for creating your own GIS data sets from map imagery, if you're willing to put the work into it. It requires you to install ArcGIS Explorer (it's free, don't worry). There are numerous sources of historical map imagery that you could use, such as this one for Russia.
I would also back up geocodezip in that using KML is probably the easiest way to get a GIS data set onto a Google map, and a lot of GIS applications (like ArcGIS) support it.
You can overlay older maps on top of the Google Maps tiles. This is probably the easiest way to achieve what you are looking for.
See the overlays documentation
- https://developers.google.com/maps/documentation/javascript/overlays#GroundOverlays
Examples:
https://google-developers.appspot.com/maps/documentation/javascript/examples/groundoverlay-simple
Also there is a number of tools to help do this. I just did a simple search for Google Maps Tiles Overlay Generator.
- First one I found: http://www.maptiler.org/
you can use the styling parameters to theme the map to look a little older, probably removing labels for pois, roads etc.

How do I get vertice data from google/bing maps?

I'm trying to develop a application that uses informations from google/bing maps, but I need the vertice data to recreate roads and I can't use images since I can't get road names and height info.
I need vertices/nodes of streets (with latitude,longitude,altitude, street name ) and no visual data.
Thanks.
Open Street Map is definitely the way to go for this - extracting vertex information from Bing/Google is both technically difficult, and a breach of the Terms of Use. OSM data is better quality in many cases and, more to the point, free to use under a CC-BY-SA licence.
You'll also probably need a spatial database in which to store the information. I've written a couple of articles about loading OSM data into SQL Server which you might find helpful. e.g.:
http://alastaira.wordpress.com/2011/04/15/loading-open-street-map-data-in-sql-server-part-ii-ways/

Using the CloudMade API or some other geosearching API to get tourism spots?

I've been looking for an online geosearch API such that I can get location data for tourism spots, e.g. historic landmarks, tourism information locations, castles, etc. I'm not looking for a map image, but rather a list of location tagged data. I've played with CloudMade, but none of the object types seems to returning anything like the number of reponses I expect (even with a wide bounding box). None of Bing, Yahoo or Google Maps seems to have a geosearch API w/o the maps -- just geocoding. I've seen apps that find restaurants open 24-hours or apartments for rent near me -- where does that day come from? Thanks!
Where does that data come from:
Nearby restaurant searches are often performed with the Google AJAX Search API using its Local Search mode. It doesn't work for performing vague searches like "tourism spot" or "historical landmark", it needs something more specific like "museum". It's fundamentally a business search (they initially bought data from Yellow Pages, so it's heavily biassed towards organisations that have a telephone) so it won't find natural features. It's also limited to about 8 replies per query.
Apps that find apartments for rent tend to have their own database, and that database is built by reading things like Craigslist.
CloudMade uses limitation on the returning results not to hurt your browser. By default it returns 10 result. You could use "limit=" and "offset=" for paging. And the response contains "found" field which gives you the total number of results.
BTW, couple of weeks ago new CloudMade Geocoding API was published. It is far faster and easier to use.
More info - http://blog.cloudmade.com/2009/10/08/new-geocoding-engine-delivers-results-up-to-24-times-faster/
Documentation - http://developers.cloudmade.com/wiki/geocoding-http-api/Documentation