HTML5; finding what is near me with geolocation - mysql

Disclaimer: I am slow learner; I have a list of 300 businesses with address and grid coordinates. I know how to request a users location with HTML5 Geolocation. How do I use that information to determine which businesses are nearest to the user? I have found allot of tutorials but nothing exact and I'm lost. I am open to any technology or language to do this yet I would like to keep it simple. I have an IIS7 server and an OSX server and I could create a My SQL database or use SQL server 2008.

Get the distance between two points using Haversine or similar, see here - http://www.movable-type.co.uk/scripts/latlong.html
Then you just need to return all those points that fall within a certain radius of your originating point.

Related

Developing WebGIS application with geoserver+geoext+postgresql vs geoserver+leaflet+postgresql?

I need to build a small Web GIS application, where the end user can:
1. upload a polygonal shapefile
2. the shapefile goes to a backend database (may be postgresql)
3. A spatial operation (overlay) is performed with existing 3 layers (already loaded to postgresql) and the result is returned like: the uploaded file falls within AAA layer (shapefile stored in postgresql) and is intersected with abc files, its total area is BBB etc
Then the user upload another polygonal shapefile,
1. it gets uploaded to the database (I dont know if this is required step or can be skipped)
2. generate summary statistics on one column and present result in the form of a chart
Then the user upload a point layer shapefile
1. system generate a service area map based on the location of points
Please advise what open source tools can be best for me to start.
I was thinking to go with geoserver, geoext, and postgresql. Is that a good commbination. Please advise
Generally, the web mapping applications consist of two parts; client side and server side.
At server side part, you need a map sever like ArcGIS server or geoserver and a database with ability for storing, handling, and manipulating spatial data like postGIS. PostGIS provides tons of useful spatial function that you can use in your spatial analyses.
At client side part, you can use the ready-to-use tools like geoExt if you don't have enough time to develop your application or you don't have enough skill to create a web application from start. But if you have enough skill in designing and developing the responsive web application, you can use Bootstrap or React and also use openlayers or leaflet to visualizing and handling spatial data on the web pages.

Spatial Indexing with SQL and Node

I'm about to start a Node.js with a lot of POI (point of Interest) that will be saved on SQL database.
Is there a way to make proximity searches (ie find all POI near a given point within a given range) easily with SQL and Node? I would like to use geohash algorithm + bookshelf for ORM but I can't find any document on the Internet explaining how to start.
Mongodb has a geo spatial index. I would like the same thing but with SQL.
Any help would be welcome
Geohash is simple translate the points to a binary and interleave it. Treat it as base-4 number. Try the Microsoft Bing tiling system. It has some free code example.

Mysql Query - What is the most efficient way?

In my application i need to get all user's Facebook friends list and compare it to with my application users list.
This process should return to the user a list his Facebook friend that are already registered in my application.
My application's server is an Http server which the application query with information and results in return.
My Question is as follow:
What is the best way of doing what i want ?
I can think of 2 approaches but both doesn't fill right:
Since i'm trying not to overload my server - i will write a function in my server that will return all the list of Facebook user's Id which are registered in the application.
In the client side - the client will check which of them are relevant to him.
The pros here is that i'm not overloading my MySql server with queries that will take it long time to process. The cons are that i found this way no "logically elegant".
To right some kind of procedure or function (or just a simple query using the IN element) which will be processed on the server side and will return the user only the relevant Facebook user's Id..
The pros are that it much more elegant, the cons are that i think its not a better option from the resources using point of view, and it might overload my server.
Will be glad for advises or some new ideas

How to use Google Fusion Tables

Am beginner to Fusion tables Concept. I have already tried my hands on some basic features of Fusion tables SQL API and liked it. Following are some questions I have with respect to the same. Request your help in the same.
Whats the benefit of using Fusion table API for storing data and presenting it on Map via Google Maps V3 API which could other wise be done using V3 API over our own data source?
Whats the way forward on Private Fusion tables? I am worried on removing the technology altogether since its still in Beta or putting usage limitations that would limit the usage of the end application? Also can the data security be trusted.
Whats the difference between Table API and SQL API?
I can only answer question 1. I can think of several advantages which will depend on the nature of your data.
Greatly improved map display performance when dealing with thousands of markers (points, lines and polygons). Tiles are generated dynamically by Google for quick display via the Map API with no marker creation overhead
Geocoding. Addresses and/or existing KML can be used when you lack lat/lon locations
There is a fairly simple SQL like filtering mechanism via the Maps API which includes spatial queries
FT have an undocumented but extremely useful JSONP option which uses the same SQL like syntax.

Restfull point in polygon in SQL Azure

I want to create a restfull WCF service in Azure to store polygons drawn in Bing maps. Each polygon has also a descriptive text. Response format must be JSON.
The most important feature must be to retrieve the list of polygons (with text) for a given point (lat long) (so I must have a point in polygon routine).
I am not a geo expert, but I was recommended to use the geo spatial part of SQL Azure. How can this be done ?
I have a suggestion.
- First try implementing your polygon detection in standard SQL Server.
- then port your SQL Server solution to an Azure equivalent.
- and finally expose a WCF interface to your functionality.
If you break it down like this you may find it easier to ask more specific questions that are more likely to get answered.