Search for incoming users around the store in latitude and longitudeMost efficient way to find points within a certain radius from a given pointWhat datatype to use when storing latitude and longitude data in SQL databases?Which data type for latitude and longitude?SQL Server - From longitude and latitude to geometry data typeSearch text in stored procedure in SQL ServerNode.js: Find Nearby Eventsretrieve record from database using latitude longitude distance mysql joinHow to store longitude & latitude as a geography in sql server 2014?DynamoDB Table query items using global secondary indexCan you execute WHERE clauses in a PostgreSQL stored procedure IF clause?Get points within a certain radius

Help me aout with this summation

How to remove threat that antivirus program indicates has to be manually deleted?

Change default layout when create new product

Annotating a table with arrows

Voltage across a resistor

Am I overreacting to my team leader's unethical requests?

Can anybody explain why using multicolumn changes the width of the four-column tabular environment?

Are differences between uniformly distributed numbers uniformly distributed?

Can I not use QM-AM inequality to solve this?

Breadcrumb history decision

Bitcoin successfully deducted on sender wallet but did not reach receiver wallet

is this F 6'9 chord a figured bass or a chord extension?

Visa National - No Exit Stamp From France on Return to the UK

If clocks themselves are based on light signals, wouldn't we expect the measured speed of light to always be the same constant?

If a digital camera can be "hacked" in the ransomware sense, how best to protect it?

Why did the RAAF procure the F/A-18 despite being purpose-built for carriers?

Why is there a large performance impact when looping over an array over 240 elements?

How to remove ambiguity: "... lives in the city of H, the capital of the province of NS, WHERE the unemployment rate is ..."?

Is this n-speak?

How to mark beverage cans in a cooler for a blind person?

Lethal damage while controlling Sower of Discord?

Simplification of numbers

Do beef farmed pastures net remove carbon emissions?

0xF1 opcode-prefix on i80286



Search for incoming users around the store in latitude and longitude


Most efficient way to find points within a certain radius from a given pointWhat datatype to use when storing latitude and longitude data in SQL databases?Which data type for latitude and longitude?SQL Server - From longitude and latitude to geometry data typeSearch text in stored procedure in SQL ServerNode.js: Find Nearby Eventsretrieve record from database using latitude longitude distance mysql joinHow to store longitude & latitude as a geography in sql server 2014?DynamoDB Table query items using global secondary indexCan you execute WHERE clauses in a PostgreSQL stored procedure IF clause?Get points within a certain radius






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am developing a server on node.js. I need to find incoming users within the store in latitude and longitude.



I have a table of stores:



merchant_id | merchant_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2400874,-80.8438284) |
1 | name 1 | ... | (35.2810371,-80.8285142) |
2 | name 2 | ... | (35.2810371,-80.8285142) |
3 | name 3 | ... | (35.2879564,-80.7948781) |


I also have a user table:



 usaer_id | user_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2358578,-80.8468168) |
1 | name 1 | ... | (35.2366682,-80.8489705) |
2 | name 2 | ... | (35.2433762,-80.8478121) |
3 | name 3 | ... | (35.2632458,-80.8619878) |
4 | name 4 | ... | (35.2778369,-80.8315268) |


Field types:



CREATE TABLE merchants(
merchant_id SERIAL PRIMARY KEY,
merchant_name VARCHAR(220) NOT NULL,
...
location POINT
);

CREATE TABLE users(
user_id SERIAL PRIMARY KEY,
user_name VARCHAR(40) NOT NULL,
...
notification POINT
);



How can I find users who are located within a radius of 3 kilometers from the store?










share|improve this question



















  • 2





    Have a look at this stackoverflow.com/questions/36358188/…

    – Pavel Smirnov
    Mar 27 at 9:11






  • 1





    Please consider using PostGIS, so a geometry(point) instead of point.

    – JGH
    Mar 27 at 11:43

















1















I am developing a server on node.js. I need to find incoming users within the store in latitude and longitude.



I have a table of stores:



merchant_id | merchant_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2400874,-80.8438284) |
1 | name 1 | ... | (35.2810371,-80.8285142) |
2 | name 2 | ... | (35.2810371,-80.8285142) |
3 | name 3 | ... | (35.2879564,-80.7948781) |


I also have a user table:



 usaer_id | user_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2358578,-80.8468168) |
1 | name 1 | ... | (35.2366682,-80.8489705) |
2 | name 2 | ... | (35.2433762,-80.8478121) |
3 | name 3 | ... | (35.2632458,-80.8619878) |
4 | name 4 | ... | (35.2778369,-80.8315268) |


Field types:



CREATE TABLE merchants(
merchant_id SERIAL PRIMARY KEY,
merchant_name VARCHAR(220) NOT NULL,
...
location POINT
);

CREATE TABLE users(
user_id SERIAL PRIMARY KEY,
user_name VARCHAR(40) NOT NULL,
...
notification POINT
);



How can I find users who are located within a radius of 3 kilometers from the store?










share|improve this question



















  • 2





    Have a look at this stackoverflow.com/questions/36358188/…

    – Pavel Smirnov
    Mar 27 at 9:11






  • 1





    Please consider using PostGIS, so a geometry(point) instead of point.

    – JGH
    Mar 27 at 11:43













1












1








1








I am developing a server on node.js. I need to find incoming users within the store in latitude and longitude.



I have a table of stores:



merchant_id | merchant_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2400874,-80.8438284) |
1 | name 1 | ... | (35.2810371,-80.8285142) |
2 | name 2 | ... | (35.2810371,-80.8285142) |
3 | name 3 | ... | (35.2879564,-80.7948781) |


I also have a user table:



 usaer_id | user_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2358578,-80.8468168) |
1 | name 1 | ... | (35.2366682,-80.8489705) |
2 | name 2 | ... | (35.2433762,-80.8478121) |
3 | name 3 | ... | (35.2632458,-80.8619878) |
4 | name 4 | ... | (35.2778369,-80.8315268) |


Field types:



CREATE TABLE merchants(
merchant_id SERIAL PRIMARY KEY,
merchant_name VARCHAR(220) NOT NULL,
...
location POINT
);

CREATE TABLE users(
user_id SERIAL PRIMARY KEY,
user_name VARCHAR(40) NOT NULL,
...
notification POINT
);



How can I find users who are located within a radius of 3 kilometers from the store?










share|improve this question














I am developing a server on node.js. I need to find incoming users within the store in latitude and longitude.



I have a table of stores:



merchant_id | merchant_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2400874,-80.8438284) |
1 | name 1 | ... | (35.2810371,-80.8285142) |
2 | name 2 | ... | (35.2810371,-80.8285142) |
3 | name 3 | ... | (35.2879564,-80.7948781) |


I also have a user table:



 usaer_id | user_name | ... | locations |
----------------------------------------------------------------
1 | name 1 | ... | (35.2358578,-80.8468168) |
1 | name 1 | ... | (35.2366682,-80.8489705) |
2 | name 2 | ... | (35.2433762,-80.8478121) |
3 | name 3 | ... | (35.2632458,-80.8619878) |
4 | name 4 | ... | (35.2778369,-80.8315268) |


Field types:



CREATE TABLE merchants(
merchant_id SERIAL PRIMARY KEY,
merchant_name VARCHAR(220) NOT NULL,
...
location POINT
);

CREATE TABLE users(
user_id SERIAL PRIMARY KEY,
user_name VARCHAR(40) NOT NULL,
...
notification POINT
);



How can I find users who are located within a radius of 3 kilometers from the store?







sql node.js postgresql






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 27 at 9:03









MegaRoksMegaRoks

3042 silver badges12 bronze badges




3042 silver badges12 bronze badges










  • 2





    Have a look at this stackoverflow.com/questions/36358188/…

    – Pavel Smirnov
    Mar 27 at 9:11






  • 1





    Please consider using PostGIS, so a geometry(point) instead of point.

    – JGH
    Mar 27 at 11:43












  • 2





    Have a look at this stackoverflow.com/questions/36358188/…

    – Pavel Smirnov
    Mar 27 at 9:11






  • 1





    Please consider using PostGIS, so a geometry(point) instead of point.

    – JGH
    Mar 27 at 11:43







2




2





Have a look at this stackoverflow.com/questions/36358188/…

– Pavel Smirnov
Mar 27 at 9:11





Have a look at this stackoverflow.com/questions/36358188/…

– Pavel Smirnov
Mar 27 at 9:11




1




1





Please consider using PostGIS, so a geometry(point) instead of point.

– JGH
Mar 27 at 11:43





Please consider using PostGIS, so a geometry(point) instead of point.

– JGH
Mar 27 at 11:43












0






active

oldest

votes










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55373296%2fsearch-for-incoming-users-around-the-store-in-latitude-and-longitude%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes




Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid …


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55373296%2fsearch-for-incoming-users-around-the-store-in-latitude-and-longitude%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?