Update all geometry points by adding/subtracting from XY
I want to update the POINT geometry column for all rows in a table.
For example, I want to change POINT(1 1) to POINT(1.1 .9)
UPDATE myTable SET geoPoint = asText(geoPointX+1 geoPoint Y-1)
The query is example of what I want to achieve, but I'm unsure how to split the text and then handle the values.
mysql spatial geometry
add a comment |
I want to update the POINT geometry column for all rows in a table.
For example, I want to change POINT(1 1) to POINT(1.1 .9)
UPDATE myTable SET geoPoint = asText(geoPointX+1 geoPoint Y-1)
The query is example of what I want to achieve, but I'm unsure how to split the text and then handle the values.
mysql spatial geometry
add a comment |
I want to update the POINT geometry column for all rows in a table.
For example, I want to change POINT(1 1) to POINT(1.1 .9)
UPDATE myTable SET geoPoint = asText(geoPointX+1 geoPoint Y-1)
The query is example of what I want to achieve, but I'm unsure how to split the text and then handle the values.
mysql spatial geometry
I want to update the POINT geometry column for all rows in a table.
For example, I want to change POINT(1 1) to POINT(1.1 .9)
UPDATE myTable SET geoPoint = asText(geoPointX+1 geoPoint Y-1)
The query is example of what I want to achieve, but I'm unsure how to split the text and then handle the values.
mysql spatial geometry
mysql spatial geometry
edited 2 mins ago
Evan Carroll
32.1k969219
32.1k969219
asked Jun 16 '16 at 23:04
Caleb PitmanCaleb Pitman
14216
14216
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
this way not ok in speed and Accuracy if you seperate x and y new fild better than.
UPDATE myTable SET geoPoint_x = :x , geoPoint_y = :y where geoPoint_id = :id
i use the :x and :y for example .
if you need to split text , you must split in in web server or in frontend jquery and send just x,y to database
add a comment |
This makes absolutely no sense, but you would want to do something like this
UPDATE myTable
SET geoPoint = Point( ST_X(geoPoint)+0.1, ST_Y(geoPoint)-0.1 );
This will move absolutely in the base unit of the SRS.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
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%2fdba.stackexchange.com%2fquestions%2f141483%2fupdate-all-geometry-points-by-adding-subtracting-from-xy%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
this way not ok in speed and Accuracy if you seperate x and y new fild better than.
UPDATE myTable SET geoPoint_x = :x , geoPoint_y = :y where geoPoint_id = :id
i use the :x and :y for example .
if you need to split text , you must split in in web server or in frontend jquery and send just x,y to database
add a comment |
this way not ok in speed and Accuracy if you seperate x and y new fild better than.
UPDATE myTable SET geoPoint_x = :x , geoPoint_y = :y where geoPoint_id = :id
i use the :x and :y for example .
if you need to split text , you must split in in web server or in frontend jquery and send just x,y to database
add a comment |
this way not ok in speed and Accuracy if you seperate x and y new fild better than.
UPDATE myTable SET geoPoint_x = :x , geoPoint_y = :y where geoPoint_id = :id
i use the :x and :y for example .
if you need to split text , you must split in in web server or in frontend jquery and send just x,y to database
this way not ok in speed and Accuracy if you seperate x and y new fild better than.
UPDATE myTable SET geoPoint_x = :x , geoPoint_y = :y where geoPoint_id = :id
i use the :x and :y for example .
if you need to split text , you must split in in web server or in frontend jquery and send just x,y to database
answered Jun 16 '16 at 23:21
Vahid AlvandiVahid Alvandi
358
358
add a comment |
add a comment |
This makes absolutely no sense, but you would want to do something like this
UPDATE myTable
SET geoPoint = Point( ST_X(geoPoint)+0.1, ST_Y(geoPoint)-0.1 );
This will move absolutely in the base unit of the SRS.
add a comment |
This makes absolutely no sense, but you would want to do something like this
UPDATE myTable
SET geoPoint = Point( ST_X(geoPoint)+0.1, ST_Y(geoPoint)-0.1 );
This will move absolutely in the base unit of the SRS.
add a comment |
This makes absolutely no sense, but you would want to do something like this
UPDATE myTable
SET geoPoint = Point( ST_X(geoPoint)+0.1, ST_Y(geoPoint)-0.1 );
This will move absolutely in the base unit of the SRS.
This makes absolutely no sense, but you would want to do something like this
UPDATE myTable
SET geoPoint = Point( ST_X(geoPoint)+0.1, ST_Y(geoPoint)-0.1 );
This will move absolutely in the base unit of the SRS.
answered 2 mins ago
Evan CarrollEvan Carroll
32.1k969219
32.1k969219
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators 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%2fdba.stackexchange.com%2fquestions%2f141483%2fupdate-all-geometry-points-by-adding-subtracting-from-xy%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