mauricio / postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala
Apache License 2.0
1.43k stars 222 forks source link

postgis geometry type #158

Open TimPigden opened 8 years ago

TimPigden commented 8 years ago

Hi - is there any support for postgis geometry types in the postgres driver?

TimPigden commented 8 years ago

Note as a workaround the driver will return these as strings using the numeric "binary" format. If you have the postgis jdbc add-ons available "net.postgis" % "postgis-jdbc" % "2.2.0",

then you can use PGgeometry.geomFromString(s)

to return the desired type (MultiPolygon or whatever)

In the reverse direction - not yet tested it - use toString on the geometry before passing it in and it will be turned into wkt - which postgis also understands