org.h2gis.functions.spatial.convert

## Class ST_GeomFromText

- java.lang.Object
- - org.h2gis.api.AbstractFunction
  - - org.h2gis.api.DeterministicScalarFunction
    - - org.h2gis.functions.spatial.convert.ST_GeomFromText

All Implemented Interfaces:
  org.h2gis.api.Function, org.h2gis.api.ScalarFunction

    public class ST_GeomFromText
    extends org.h2gis.api.DeterministicScalarFunction

Convert a Well Known Text String into a Geometry instance. TODO Read SRID in table constraint

Author:
  Nicolas Fortin

### Field Summary

### Fields inherited from interface org.h2gis.api.ScalarFunction

`PROP_DETERMINISTIC, PROP_NOBUFFER`

### Fields inherited from interface org.h2gis.api.Function

`PROP_NAME, PROP_REMARKS`

### Constructor Summary

Constructors
Constructor and Description
`ST_GeomFromText()` Default constructor

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`String` `getJavaStaticMethod()`
`static org.locationtech.jts.geom.Geometry` `toGeometry(String wkt)` Convert well known text parameter into a Geometry
`static org.locationtech.jts.geom.Geometry` `toGeometry(String wkt, int srid)` Convert well known text parameter into a Geometry

### Methods inherited from class org.h2gis.api.AbstractFunction

`addProperty, getProperty, removeProperty`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.h2gis.api.Function

`getProperty`

### Constructor Detail

#### ST_GeomFromText

    public ST_GeomFromText()

Default constructor

### Method Detail

#### getJavaStaticMethod

    public String getJavaStaticMethod()

#### toGeometry

    public static org.locationtech.jts.geom.Geometry toGeometry(String wkt)
                                                         throws SQLException

Convert well known text parameter into a Geometry

Parameters:
  `wkt` - Well known text
Returns:
  Geometry instance or null if parameter is null
Throws:
  `org.locationtech.jts.io.ParseException` - If wkt is invalid
  `SQLException`

#### toGeometry

    public static org.locationtech.jts.geom.Geometry toGeometry(String wkt,
                                                                int srid)
                                                         throws SQLException

Convert well known text parameter into a Geometry

Parameters:
  `wkt` - Well known text
  `srid` - Geometry SRID
Returns:
  Geometry instance
Throws:
  `SQLException` - If wkt is invalid