- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中org.geolatte.geom.codec.WktDecoder.decode()
方法的一些代码示例,展示了WktDecoder.decode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WktDecoder.decode()
方法的具体详情如下:
包路径:org.geolatte.geom.codec.WktDecoder
类名称:WktDecoder
方法名:decode
[英]Decodes a WKT representation.
[中]解码WKT表示。
代码示例来源:origin: hibernate/hibernate-orm
private static Geometry<?> parseWkt(String pgValue) {
final WktDecoder decoder = Wkt.newDecoder( Wkt.Dialect.POSTGIS_EWKT_1 );
return decoder.decode( pgValue );
}
代码示例来源:origin: hibernate/hibernate-orm
if ( testDataElement.type.equalsIgnoreCase( type ) ) {
try {
result.put( testDataElement.id, decoder.decode( testDataElement.wkt ) );
代码示例来源:origin: hibernate/hibernate-orm
static GeomEntity createFrom(TestDataElement element, Dialect dialect) throws WktDecodeException {
WktDecoder decoder = getWktDecoder( dialect );
Geometry geom = decoder.decode( element.wkt );
GeomEntity result = new GeomEntity();
result.setId( element.id );
result.setGeom( geom );
result.setType( element.type );
return result;
}
代码示例来源:origin: hibernate/hibernate-orm
public static JtsGeomEntity createFrom(TestDataElement element, Dialect dialect) throws ParseException {
WktDecoder decoder = getWktDecoder( dialect );
Geometry geom = JTS.to( decoder.decode( element.wkt ) );
JtsGeomEntity result = new JtsGeomEntity();
result.setId( element.id );
result.setGeom( geom );
result.setType( element.type );
return result;
}
代码示例来源:origin: com.mysema.querydsl/querydsl-sql
@Override
@Nullable
public Geometry getValue(ResultSet rs, int startIndex) throws SQLException {
Clob clob = rs.getClob(startIndex);
String str = clob != null ? clob.getSubString(1, (int) clob.length()) : null;
if (str != null) {
return Wkt.newDecoder(Wkt.Dialect.POSTGIS_EWKT_1).decode(str);
} else {
return null;
}
}
代码示例来源:origin: com.querydsl/querydsl-sql-spatial
@Override
@Nullable
public Geometry getValue(ResultSet rs, int startIndex) throws SQLException {
Clob clob = rs.getClob(startIndex);
String str = clob != null ? clob.getSubString(1, (int) clob.length()) : null;
if (str != null) {
return Wkt.newDecoder(Wkt.Dialect.POSTGIS_EWKT_1).decode(str);
} else {
return null;
}
}
代码示例来源:origin: com.mysema.querydsl/querydsl-sql
@Override
@Nullable
public Geometry getValue(ResultSet rs, int startIndex) throws SQLException {
String str = rs.getString(startIndex);
if (str != null) {
return Wkt.newDecoder(Wkt.Dialect.POSTGIS_EWKT_1).decode(str);
} else {
return null;
}
}
代码示例来源:origin: com.querydsl/querydsl-sql-spatial
@Override
@Nullable
public Geometry getValue(ResultSet rs, int startIndex) throws SQLException {
String str = rs.getString(startIndex);
if (str != null) {
return Wkt.newDecoder(Wkt.Dialect.POSTGIS_EWKT_1).decode(str);
} else {
return null;
}
}
代码示例来源:origin: org.geolatte/geolatte-geom
/**
* Decodes the specified WKT String to a <code>Geometry</code>.
* <p>This method uses the default WKT dialect (Postgis v1.5 EWKT)</p>
*
* @param wkt the WKT string to decode
* @return The decoded Geometry
*/
public static <P extends Position> Geometry<P> fromWkt(String wkt, CoordinateReferenceSystem<P> crs) {
WktDecoder decoder = newDecoder();
return decoder.decode(wkt,crs);
}
代码示例来源:origin: org.geolatte/geolatte-geom
@Override
public Geometry<?> decode(Clob clob) {
String wkt = clobToString( clob );
WktDecoder decoder = Wkt.newDecoder( Wkt.Dialect.DB2_WKT );
if ( wkt.substring( 0, 4 ).toUpperCase().startsWith( "SRID" ) ) {
return decoder.decode( wkt );
}
else {
return decoder.decode( String.format( "SRID=%d;%s", srid, wkt ) );
}
}
代码示例来源:origin: org.geolatte/geolatte-geom
public static Geometry<?> fromWkt(String wkt) {
WktDecoder decoder = newDecoder();
return decoder.decode(wkt);
}
代码示例来源:origin: com.querydsl/querydsl-sql
@Test
public void valid_wkt() {
for (String wkt : Connections.getSpatialData().values()) {
assertNotNull(Wkt.newDecoder(Wkt.Dialect.POSTGIS_EWKT_1).decode(wkt));
}
}
代码示例来源:origin: com.sqlapp/sqlapp-core-postgres
private Object convertInternal(Object obj){
if (obj instanceof PGobject){
String pgValue = ((PGobject)obj).getValue();
if (pgValue.charAt(0) == 'S') {
WktDecoder decoder = Wkt.newDecoder(Wkt.Dialect.POSTGIS_EWKT_1);
return decoder.decode(pgValue);
}
ByteBuffer buffer = ByteBuffer.from(pgValue);
WkbDecoder decoder = Wkb.newDecoder(Wkb.Dialect.POSTGIS_EWKB_1);
return decoder.decode(buffer);
}
byte[] bytes=Converters.getDefault().convertObject(obj, byte[].class);
WkbDecoder decoder = Wkb.newDecoder(Wkb.Dialect.POSTGIS_EWKB_1);
return decoder.decode(ByteBuffer.from(bytes));
}
本文整理了Java中org.geolatte.geom.codec.WktDecoder.decode()方法的一些代码示例,展示了WktDecoder.decode()的具体用法。这些代码示例主要来
我是一名优秀的程序员,十分优秀!