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.

2 Answers 2

1

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.