Skip to main content
Solved

Divide all numbers in an attribute (scale geometry)


p.jeremie
Contributor
Forum|alt.badge.img+6

Hi,

 

I have an attribute WKT_coordinates that I use to create a geometry with WKT format.

My problem is all the numbers in this attribute are too big by 100.

I am looking for a simple way to divide them all by 100.

 

Example of string in WKT_coordinates :

((86530120 638698160,86530140 638700660,86526150 638712680,86512380 638737780,86510880 638737790,86507360 638734820,86530120 638698160))

I would like to have

((865301.20 6386981.60,865301.40 6387006.60,865261.50 6387126.80,865123.80 6387377.80,865108.80 6387377.90,865073.60 6387348.20,865301.20 6386981.60))

 

I can have geometries with multiple parts too :

((100 100,200 100,200 200,100 200,100 100),(125 125,175 125,175 175,125 175,125 125))

and want :

((1.00 1.00,2.00 1.00,2.00 2.00,1.00 2.00,1.00 1.00),(1.25 1.25,1.75 1.25,1.75 1.75,1.25 1.75,1.25 1.25))

 

Any idea ?

Best answer by ebygomm

Would creating the geometry, using the scaler, then reextract the wkt work for you here?

View original
Did this help you find an answer to your question?

2 replies

ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • Best Answer
  • July 11, 2019

Would creating the geometry, using the scaler, then reextract the wkt work for you here?


p.jeremie
Contributor
Forum|alt.badge.img+6
  • Author
  • Contributor
  • July 11, 2019
ebygomm wrote:

Would creating the geometry, using the scaler, then reextract the wkt work for you here?

@egomm yes perfect, I didn't know about the scaler but it fits my needs perfectly. I just create the geom and then scale it.

My goal is not to have the WKT but a correct geometry so it's ok like that.

Thank you !


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings