Update all geometry points by adding/subtracting from XY












0















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.










share|improve this question





























    0















    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.










    share|improve this question



























      0












      0








      0








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 2 mins ago









      Evan Carroll

      32.1k969219




      32.1k969219










      asked Jun 16 '16 at 23:04









      Caleb PitmanCaleb Pitman

      14216




      14216






















          2 Answers
          2






          active

          oldest

          votes


















          0














          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






          share|improve this answer































            0














            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.





            share























              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
              });


              }
              });














              draft saved

              draft discarded


















              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









              0














              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






              share|improve this answer




























                0














                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






                share|improve this answer


























                  0












                  0








                  0







                  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






                  share|improve this answer













                  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







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jun 16 '16 at 23:21









                  Vahid AlvandiVahid Alvandi

                  358




                  358

























                      0














                      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.





                      share




























                        0














                        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.





                        share


























                          0












                          0








                          0







                          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.





                          share













                          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.






                          share











                          share


                          share










                          answered 2 mins ago









                          Evan CarrollEvan Carroll

                          32.1k969219




                          32.1k969219






























                              draft saved

                              draft discarded




















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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

                              Ronny Ackermann

                              Köttigit

                              MySQL 8.0.15 starts normally but any connection hangs