Locating Businesses by Latitude and Longitude (API?/Webservice?) - web-services

I am looking for a free database (csv, tab delimited, xml, etc) or even a web service or API which will allow me to query for business listings within a certain distance of a latitude and longitude.
A global scope would be perfect, but I would settle for Canada/US information.
Does anyone know of anything like this?

Google AJAX search API offers this kind of service (local search) if you use the Google Maps API, see http://code.google.com/intl/fr/apis/ajaxsearch/documentation/
Apparently Yahoo! does too (see http://developer.yahoo.com/search/local/localSearch.html), if you do not plan a commercial use.

If you want to do this right, here is what you need:
Database of all locations, with long/lat coords
Database of all businesses
Address --> long/lat conversion system, if your business database is not already geocoded
I can't help you out with the business database, but here is a good resource for the "all locations" database:
http://www.geobytes.com/freeservices.htm
(Scroll down to the bottom of the page - you're looking for "GeoWorldMap".)
It contains a set of text files that are designed to be imported into a relational database. It's the most complete (free) resource that I've been able to find for this sort of task.

The Google Maps Places API provides exactly what you're looking for: https://developers.google.com/places/documentation/search

Related

Using google cloud for image classification, cropping and OCR

Please allow me to ask a rather newbie question. So far, I have been using local tools like imagemagick or GOCR to perform the job, but that is rather old-fashioned, and I am urged to "move to google cloud AI".
The setup
I have a (training) data set of various documents (as JPG and PDF) of different kinds, and by certain features (like prevailing color, repetitive layout) I intend to classify them, e.g. as invoice type 1, invoice type 2, not an invoice. In a 2nd step, I would like to OCR certain predefined areas of each document and extract e.g. the address of the company sending the invoice and the date.
The architecture I am envisioning
In a modern platform as a service (pass), I have already set up an UI where I can upload new files. These are then locally stored in a directory with filenames (or in a MongoDB). Meta info like upload timestamp, user, original file name is stored in a DB.
The newly uploaded file should should then be submitted to google cloud which should do the classification step, and deliver back the label to be saved in the database.
The document pages should be auto-cropped, i.e. black or white margins are removed, most probably with google cloud as well. The parameters of the crop should be persisted in the DB.
In case it is e.g. an invoice, OCR should be performed (again by google cloud) for certain regions of the documents, e.g. a bounding box of spanning from the mid of the page to the right margin in the upper 10% of the cropped page. The results of the OCR should be again persisted locally.
The problem
I seem to be missing the correct search term to figure out how to do it with google cloud. Is there an google-API (e.g. REST), I can use to upload and which gives me back the results of steps 2 to 4?
I think that your best option here is to use Document AI (REST API and Libraries).
Using Document AI, you can:
Convert images to text
Classify documents
Analyze and extract entities
Additionally, for your use case, we have a new Document AI feature that is still in preview and has limited access which is the Invoice parser.
Invoice parser is similar to Form parser but for invoices instead of forms. Check out the Invoice parser page and you will see what I mean by preview and limited access.
AFIK, there isn't any GCP tool for image edition.

get data of how results have been found in Amazon Cloudsearch

as we use cloudsearch to find our documents and data, we have this issue that some of the data that are returned back to us, we have to know that how they've been found.
I know that we can specify which fields to search for them, but is there any way that amazon gives us a hint or some information that how the returned data has been found. on which fields it exists?
this can be really really useful information for us and affects the way we show data to our users.
I know amazon provides highlighting service, but highlights change results, we don't want to change results or values, we just want to use this knowledge for backend purposes.

How do I scrape data from an ArcGIS Online map?

I want to scrape the data from an ArcGIS map. The following map has a popup when we click the red features. How do I access that data programmatically?
Link : https://cslt.maps.arcgis.com/apps/MapSeries/index.html?appid=2c9f3e737cbf4f6faf2eb956fa26cdc5
Note: Please respect the access and use constraints of any ArcGIS Online item you access. When in doubt, don't save a copy of someone else's data.
The ArcGIS Online REST interface makes it relatively simple to get the data behind ArcGIS Online items. You need to use an environment that can make HTTP requests and parse JSON text. Most current programming languages either have these capabilities built in or have libraries available with these capabilities.
Here's a general workflow that your code could follow.
Use the app ID and the item data endpoint to see the app's JSON text:
https://www.arcgis.com/sharing/rest/content/items/2c9f3e737cbf4f6faf2eb956fa26cdc5/data
Search that text for webmap and see that the app uses the following web maps:
d2b4a98c39fd4587b99ac0878c420125
7b1af1752c3a430184fbf7a530b5ec65
c6e9d07e4c2749e4bfe23999778a3153
Look at the item data endpoint for any of those web maps:
https://www.arcgis.com/sharing/rest/content/items/d2b4a98c39fd4587b99ac0878c420125/data
The list of operationalLayers specifies the feature layer URLs from which you could harvest data. For example:
https://services2.arcgis.com/gWRYLIS16mKUskSO/arcgis/rest/services/VHR_Areas/FeatureServer/0
Then just run a query with a where of 0=0 (or whatever you want) and an outFields of *:
https://services2.arcgis.com/gWRYLIS16mKUskSO/arcgis/rest/services/VHR_Areas/FeatureServer/0/query?where=0%3D0&outFields=%2A&f=json
Use f=html instead if you want to see a human-readable request form and results.
Note that feature services have a limit of how many features you can get per request, so you will probably want to filter by geometry or attribute values. Read the documentation to learn everything you can do with feature service queries.

Amazon product api get stock availability (In Stock, out of Stock, etc)

I am using product advertising api by Amazon. Its a little lacking to be honest, since there is no way of getting the product name. You can get the title, but that contains the offer "Amazon Kindle 3G, with free wifi..." instead of simply Amazon Kindle 3G.
More importantly, there seems to be no way of getting the stock information. I just need to know if an item is in stock or not. That's all, there seems to be no way of doing that yet. Ama I missing something. I am using the ItemLookup Api. I get some details by using the Large Response Group but no stock information
The various 'offers' response groups list 'offers' from Amazon and 3rd party merchants; this data includes availability details as well as pricing for the (just) 1 offer it will tell you about. You can supply a MerchantId parameter forcing that one offer to be from Amazon.
This API has been somewhat limited (i.e. to just 1 offer) since 2011; for fuller info try the MWS API instead.
For a more literal product name, you could try obtaining the UPC or EAN from the ItemAttributes response group, and then looking that up in a non-Amazon UPC database. No idea how well that would work in practice.
Although I am using amazon product api with a python wrapper..there is a availability parameter - checkout the amazon doc http://docs.aws.amazon.com/AWSECommerceService/latest/DG/CHAP_ReturningPriceAndAvailabilityInformation-itemsearch.html

Retrieving "businesses" with Google Maps API?

This is an example of a Business on Google Maps
It has elements attached such as:
Reviews from various sites (qype, viewlondon, etc...)
Details provided by various sites
Photos and other content
I don't know how to go on about retrieving such Business and associate any items generated on my website.
What I have implemented up to date is a system using geocoding (geopy) which once given an address, it gives back Latitude and Longitude, but such system does not help me with this dilemma.
What you want is this API:
http://code.google.com/apis/ajaxsearch/local.html
Also check this:
http://googleajaxsearchapi.blogspot.com/2007/06/local-search-control-for-maps-api.html
By writing a relay server script you could do things like this, which obtains most of that information with a different layout. I don't know if it's legal to do that.