#239 - Support Geometric types of Postgres, Also adding LineString, MultiLineString and MultiPoint

This commit is contained in:
Rob Bygrave
2016-10-25 22:19:33 +13:00
parent 44ad78b5e0
commit d0f75a940c
4 changed files with 28 additions and 1 deletions
@@ -21,6 +21,9 @@ public class DbPlatformTypeMapping {
private static final DbPlatformType POINT = new DbPlatformType("point");
private static final DbPlatformType POLYGON = new DbPlatformType("polygon");
private static final DbPlatformType LINESTRING = new DbPlatformType("linestring");
private static final DbPlatformType MULTIPOINT = new DbPlatformType("multipoint");
private static final DbPlatformType MULTILINESTRING = new DbPlatformType("multilinestring");
private static final DbPlatformType MULTIPOLYGON = new DbPlatformType("multipolygon");
private final Map<DbType, DbPlatformType> typeMap = new HashMap<DbType, DbPlatformType>();
@@ -68,6 +71,9 @@ public class DbPlatformTypeMapping {
put(DbType.POINT, POINT);
put(DbType.POLYGON, POLYGON);
put(DbType.LINESTRING, LINESTRING);
put(DbType.MULTIPOINT, MULTIPOINT);
put(DbType.MULTILINESTRING, MULTILINESTRING);
put(DbType.MULTIPOLYGON, MULTIPOLYGON);
if (logicalTypes) {
@@ -38,6 +38,9 @@ public enum DbType {
POINT(ExtraDbTypes.POINT),
POLYGON(ExtraDbTypes.POLYGON),
LINESTRING(ExtraDbTypes.LINESTRING),
MULTIPOINT(ExtraDbTypes.MULTIPOINT),
MULTILINESTRING(ExtraDbTypes.MULTILINESTRING),
MULTIPOLYGON(ExtraDbTypes.MULTIPOLYGON),
HSTORE(ExtraDbTypes.HSTORE),
@@ -50,9 +50,24 @@ public interface ExtraDbTypes {
*/
int POLYGON = 6001;
/**
* Geo Point
*/
int LINESTRING = 6002;
/**
* Geo MultiPolygon
*/
int MULTIPOLYGON = 6002;
int MULTIPOINT = 6005;
/**
* Geo MultiPolygon
*/
int MULTIPOLYGON = 6006;
/**
* Geo MultiPolygon
*/
int MULTILINESTRING = 6007;
}
@@ -80,6 +80,9 @@ public class PostgresPlatform extends DatabasePlatform {
private void addGeoTypes(int srid) {
dbTypeMap.put(DbType.POINT, geoType("point",srid));
dbTypeMap.put(DbType.POLYGON, geoType("polygon",srid));
dbTypeMap.put(DbType.LINESTRING, geoType("linestring",srid));
dbTypeMap.put(DbType.MULTIPOINT, geoType("multipoint",srid));
dbTypeMap.put(DbType.MULTILINESTRING, geoType("multilinestring",srid));
dbTypeMap.put(DbType.MULTIPOLYGON, geoType("multipolygon",srid));
}