Pois_close POINT with postgis and rails Planned maintenance scheduled April 23, 2019 at 23:30...
Simple Http Server
Special flights
License to disallow distribution in closed source software, but allow exceptions made by owner?
Is CEO the "profession" with the most psychopaths?
Flight departed from the gate 5 min before scheduled departure time. Refund options
Mounting TV on a weird wall that has some material between the drywall and stud
What does it mean that physics no longer uses mechanical models to describe phenomena?
Why is a lens darker than other ones when applying the same settings?
Test print coming out spongy
RSA find public exponent
Can you force honesty by using the Speak with Dead and Zone of Truth spells together?
Is openssl rand command cryptographically secure?
Resize vertical bars (absolute-value symbols)
Should a wizard buy fine inks every time he want to copy spells into his spellbook?
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
Tannaka duality for semisimple groups
How can a team of shapeshifters communicate?
How to write capital alpha?
The Nth Gryphon Number
GDP with Intermediate Production
If Windows 7 doesn't support WSL, then what is "Subsystem for UNIX-based Applications"?
Tips to organize LaTeX presentations for a semester
Random body shuffle every night—can we still function?
Pois_close POINT with postgis and rails
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Announcing the arrival of Valued Associate #679: Cesar Manara
Unicorn Meta Zoo #1: Why another podcast?PostGIS nearest point with ST_DistancePostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+Simple PostGIS ST_Distance query for two points from the same geometry table?Finding nearest point from POI in PostGIS?How to find nearest line from point using PostGIS?Calculate min distance between points in PostGISAccurate and fast nearest neighbour, which distance function should I use and how to it speed up?PostGIS: snap latitude/longitude input to nearest OSM road pointPostGIS nearest point with ST_Distanceproblem in PostGIS Name of the system used for Points and how to get distance between to point?Postgis meassuring distance between first and third points of a polygonNearest point of MultiPoint to another Point, over a LineString
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I try to use postgis in rails and write my first request. I would like have :
- the nearest points of another point (but without this point)
- the name and the distance between the both
In my model I have write this scope :
scope :close_to, -> (latitude, longitude, distance_in_m = 1) {
where(%{
ST_Distance(lonlat, 'POINT(%f %f)') < %d
} % [longitude, latitude, distance_in_m * 1000])
}
How can I get the distance ?
postgis
bumped to the homepage by Community♦ 31 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I try to use postgis in rails and write my first request. I would like have :
- the nearest points of another point (but without this point)
- the name and the distance between the both
In my model I have write this scope :
scope :close_to, -> (latitude, longitude, distance_in_m = 1) {
where(%{
ST_Distance(lonlat, 'POINT(%f %f)') < %d
} % [longitude, latitude, distance_in_m * 1000])
}
How can I get the distance ?
postgis
bumped to the homepage by Community♦ 31 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I try to use postgis in rails and write my first request. I would like have :
- the nearest points of another point (but without this point)
- the name and the distance between the both
In my model I have write this scope :
scope :close_to, -> (latitude, longitude, distance_in_m = 1) {
where(%{
ST_Distance(lonlat, 'POINT(%f %f)') < %d
} % [longitude, latitude, distance_in_m * 1000])
}
How can I get the distance ?
postgis
I try to use postgis in rails and write my first request. I would like have :
- the nearest points of another point (but without this point)
- the name and the distance between the both
In my model I have write this scope :
scope :close_to, -> (latitude, longitude, distance_in_m = 1) {
where(%{
ST_Distance(lonlat, 'POINT(%f %f)') < %d
} % [longitude, latitude, distance_in_m * 1000])
}
How can I get the distance ?
postgis
postgis
asked May 18 '18 at 23:13
BenBen
64
64
bumped to the homepage by Community♦ 31 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 31 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Search for the Nearest Neighbor in postgis is a well know problem solved multiple times in stack overflow and the "internet", like:
PostGIS nearest point with ST_Distance- PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+
- How Do I Find The N Nearest Things To This Point In PostGis
In it's more basic form the query can be written like this:
SELECT name, gid, ST_Distance(geom, st_setsrid(st_makepoint(-90,40),4326))
FROM geonames
ORDER BY geom <-> st_setsrid(st_makepoint(-90,40),4326)
LIMIT 1;
but it can be improved depending on your use case.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "79"
};
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: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f283422%2fpois-close-point-with-postgis-and-rails%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Search for the Nearest Neighbor in postgis is a well know problem solved multiple times in stack overflow and the "internet", like:
PostGIS nearest point with ST_Distance- PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+
- How Do I Find The N Nearest Things To This Point In PostGis
In it's more basic form the query can be written like this:
SELECT name, gid, ST_Distance(geom, st_setsrid(st_makepoint(-90,40),4326))
FROM geonames
ORDER BY geom <-> st_setsrid(st_makepoint(-90,40),4326)
LIMIT 1;
but it can be improved depending on your use case.
add a comment |
Search for the Nearest Neighbor in postgis is a well know problem solved multiple times in stack overflow and the "internet", like:
PostGIS nearest point with ST_Distance- PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+
- How Do I Find The N Nearest Things To This Point In PostGis
In it's more basic form the query can be written like this:
SELECT name, gid, ST_Distance(geom, st_setsrid(st_makepoint(-90,40),4326))
FROM geonames
ORDER BY geom <-> st_setsrid(st_makepoint(-90,40),4326)
LIMIT 1;
but it can be improved depending on your use case.
add a comment |
Search for the Nearest Neighbor in postgis is a well know problem solved multiple times in stack overflow and the "internet", like:
PostGIS nearest point with ST_Distance- PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+
- How Do I Find The N Nearest Things To This Point In PostGis
In it's more basic form the query can be written like this:
SELECT name, gid, ST_Distance(geom, st_setsrid(st_makepoint(-90,40),4326))
FROM geonames
ORDER BY geom <-> st_setsrid(st_makepoint(-90,40),4326)
LIMIT 1;
but it can be improved depending on your use case.
Search for the Nearest Neighbor in postgis is a well know problem solved multiple times in stack overflow and the "internet", like:
PostGIS nearest point with ST_Distance- PostGIS nearest point with LATERAL JOIN in PostgreSQL 9.3+
- How Do I Find The N Nearest Things To This Point In PostGis
In it's more basic form the query can be written like this:
SELECT name, gid, ST_Distance(geom, st_setsrid(st_makepoint(-90,40),4326))
FROM geonames
ORDER BY geom <-> st_setsrid(st_makepoint(-90,40),4326)
LIMIT 1;
but it can be improved depending on your use case.
answered May 19 '18 at 7:56
Francisco PugaFrancisco Puga
2,9911128
2,9911128
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- 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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f283422%2fpois-close-point-with-postgis-and-rails%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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