Skip to main content
Solved

Divide all numbers in an attribute (scale geometry)

  • July 11, 2019
  • 2 replies
  • 28 views

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?

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+45
  • 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

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 !