Select to view content in your preferred language

Improve the docs: How to "Convert ST_POINT subtype to ST_GEOMETRY supertype"?

414
1
06-19-2022 02:49 PM
Status: Open
Bud
by
Esteemed Contributor

Regarding technical article #000011333:

Bug: Unable to define a query layer in ArcGIS where the data source uses an st_geometry subtype in O...

Workaround:
Convert the geometry attribute field from the subtype (for example, st_point) to the supertype st_geometry.

The docs say we should convert the ST_POINT subtype to ST_GEOMETRY supertype. But they don't say how to make the conversion.

The only way I've found so far is to convert to WKB or WKT and then back to ST_GEOMETRY:

--This works, but is clunky and slow:
sde.st_geomfromwkb(sde.st_asbinary(...)).


Is that how Esri recommends we make the conversion? It would help if Esri could explicitly tell us what is meant there. Thanks.




Note:
I've tried using the TREAT() function too. But that didn't seem to work properly:
Stack Overflow: Convert UDT subtype to supertype

Related: Convert MDSYS.ST_LINESTRING subtype value to MDSYS.ST_GEOMETRY supertype

1 Comment
Bud
by

In a reply to Create NIL (zero vertex) geometry, I mention that the bug has been updated. It now suggests that we use the st_geometry constructor to convert from subtypes to supertypes. Which seems to work for converting [SDE.ST_POLYFROMTEXT] to [SDE.ST_GEOMETRY].

But that doesn't help me when converting [ST_POINT] subtype to [ST_GEOMETRY] supertype:

Bud_1-1700599041424.png