Subscribe to this thread
Home - General / All posts - Manifold 8 : geom from wkt
Corentin
164 post(s)
#28-Nov-23 16:18

Dear users

I have a table in manifold 8, one column contains a string with WKT coordinate of a polygon.

I want to populate a a column with the corresponding Geom in order to draw the polygon.

in Manifold9 I know how to do this, very easy. I need it for a colleague who doesnt have manifold 9. He must be able to do it alone in manifold8

I need to do it in Manifold8, I found the following function in the help file : Geom NewGeomFromTextWKT(String text)

Creates new geometric entity from textual data in OGC WKT format.

I tried to use it in an active column in manifold8 (of type Geom), but it doesnt work

code

Function Func

 Func = NewGeomFromTextWKT(Record.Data("geometry"))

return func

End Function

text

it bugs with the following error : 'type incompatible'. The active column is in type Geom.

Any idea how I can fix that?

Sloots

694 post(s)
#28-Nov-23 18:36

See this old post.

Cheers,

Chris


http://www.mppng.nl/manifold/pointlabeler

Sloots

694 post(s)
#28-Nov-23 18:41

Or try to fix your function for the active column...

Function Func

 Func = NewGeomFromTextWKT(Record.Data("geometry"))

End Function

Untested....


http://www.mppng.nl/manifold/pointlabeler

Corentin
164 post(s)
#29-Nov-23 16:51

Thank you for you help,

I tried both methods, none works :(

with the sql method The geom is generated, but when I try to "link drawing" based on a geom column

the methods gives "invalid or missing metrics"

here is an example of data :

POLYGON((1.14980624981668 10.3628655555517, 1.1497970150881 10.3628987904302, 1.14976770192106 10.3628908058174, 1.14977693665224 10.3628575709403, 1.14980624981668 10.3628655555517))

danb

2,064 post(s)
#29-Nov-23 19:32

If you have WKT string stored in an attribute named [GEOMETRY] in Manifold 8, and you wish to convert it to native geometry, you can use the following:

CGeom(CGeomWKB([GEOMETRY]))


Landsystems Ltd ... Know your land | www.landsystems.co.nz

Sloots

694 post(s)
#30-Nov-23 11:43

See this working example.

Attachments:
wkt_to_geom_m8.map


http://www.mppng.nl/manifold/pointlabeler

Corentin
164 post(s)
#30-Nov-23 13:16

Thank you very much!

It works just fine :)

I didn't know it was possible to link a table to a query!

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