Skip to content

Commit

Permalink
add support for geography type (#74)
Browse files Browse the repository at this point in the history
Co-authored-by: lonelyleaf <downsidemoon@foxmail.com>
  • Loading branch information
lonelyleaf and lonelyleaf authored Mar 28, 2020
1 parent 1103b7f commit 8547c97
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions jdbc/src/main/java/org/postgis/DriverWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ public void addGeometries(Connection conn) throws SQLException {
pgconn.addDataType("geometry", org.postgis.PGgeometry.class);
pgconn.addDataType("public.geometry", org.postgis.PGgeometry.class);
pgconn.addDataType("\"public\".\"geometry\"", org.postgis.PGgeometry.class);

pgconn.addDataType("geography", org.postgis.PGgeometry.class);
pgconn.addDataType("public.geography", org.postgis.PGgeometry.class);
pgconn.addDataType("\"public\".\"geography\"", org.postgis.PGgeometry.class);
}

public void addBoxen(Connection conn) throws SQLException {
Expand All @@ -294,6 +298,7 @@ public void addBoxen(Connection conn) throws SQLException {
public void addBinaryGeometries(Connection conn) throws SQLException {
PGConnection pgconn = (PGConnection) conn;
pgconn.addDataType("geometry", org.postgis.PGgeometryLW.class);
pgconn.addDataType("geography", org.postgis.PGgeometryLW.class);
}
}

Expand All @@ -304,6 +309,10 @@ public void addGeometries(Connection conn) throws SQLException {
pgconn.addDataType("geometry", org.postgis.PGgeometry.class);
pgconn.addDataType("public.geometry", org.postgis.PGgeometry.class);
pgconn.addDataType("\"public\".\"geometry\"", org.postgis.PGgeometry.class);

pgconn.addDataType("geography", org.postgis.PGgeometry.class);
pgconn.addDataType("public.geography", org.postgis.PGgeometry.class);
pgconn.addDataType("\"public\".\"geography\"", org.postgis.PGgeometry.class);
}

public void addBoxen(Connection conn) throws SQLException {
Expand All @@ -315,6 +324,7 @@ public void addBoxen(Connection conn) throws SQLException {
public void addBinaryGeometries(Connection conn) throws SQLException {
org.postgresql.PGConnection pgconn = (org.postgresql.PGConnection) conn;
pgconn.addDataType("geometry", org.postgis.PGgeometryLW.class);
pgconn.addDataType("geography", org.postgis.PGgeometryLW.class);
}
}

Expand All @@ -325,6 +335,10 @@ public void addGeometries(Connection conn) throws SQLException {
pgconn.addDataType("geometry", org.postgis.PGgeometry.class);
pgconn.addDataType("public.geometry", org.postgis.PGgeometry.class);
pgconn.addDataType("\"public\".\"geometry\"", org.postgis.PGgeometry.class);

pgconn.addDataType("geography", org.postgis.PGgeometry.class);
pgconn.addDataType("public.geography", org.postgis.PGgeometry.class);
pgconn.addDataType("\"public\".\"geography\"", org.postgis.PGgeometry.class);
}

public void addBoxen(Connection conn) throws SQLException {
Expand All @@ -336,6 +350,7 @@ public void addBoxen(Connection conn) throws SQLException {
public void addBinaryGeometries(Connection conn) throws SQLException {
PGConnection pgconn = (PGConnection) conn;
pgconn.addDataType("geometry", org.postgis.PGgeometryLW.class);
pgconn.addDataType("geography", org.postgis.PGgeometryLW.class);
}
}

Expand Down

0 comments on commit 8547c97

Please sign in to comment.