Subscribe to this thread
Home - General / All posts - WKT String
ColinD


1,936 post(s)
#02-Aug-19 06:45

How would one convert a polygon into a valid WKT string that describes said polygon?

Thanks


Aussie Nature Shots

Graeme

943 post(s)
#02-Aug-19 07:16

For M8 try "..CStr(CGeomWKB(Geom(ID))) into..", there's a simple implementation in the attached M8 map file.

Attachments:
Cast as WKT M8.map

Dimitri


5,620 post(s)
#02-Aug-19 07:57

In 9 you can do that with a point-and-click Transform template:

1. Open the table for your drawing.

2. Use the Schema dialog to add a text field. I'll name that field "WKT Text".

3. Switch to the Transform pane and choose WKT Text as the target.

4. Click the Compose WKT template.

Your table probably has only one Geom field in it, so that field will be loaded into the Geom box by default. You'll see the preview of how that is converted into WKT in the WKT Text field.

5. Press Update Field

See the Compose WKT template in the Transform Templates - Text topic.

There is a step by step illustrated example of an alternate way to do this in the Transform Templates - Drawings topic for the Copy template.

ColinD


1,936 post(s)
#02-Aug-19 08:30

Wonderful, thanks so much! I was trying to use 9.


Aussie Nature Shots

Manifold User Community Use Agreement Copyright (C) 2007-2019 Manifold Software Limited. All rights reserved.