本文整理了Java中org.geolatte.geom.codec.Wkt
类的一些代码示例,展示了Wkt
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Wkt
类的具体详情如下:
包路径:org.geolatte.geom.codec.Wkt
类名称:Wkt
[英]Creates encoders/decoders for WKT geometry representations.
Note that the WktEncoder/WktDecoder
instances returned by the factory methods are not thread-safe.
[中]为WKT几何体表示创建编码器/解码器。
请注意,工厂方法返回的WktEncoder/WktDecoder
实例不是线程安全的。
代码示例来源: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
@Override
public Geometry fromString(String string) {
return Wkt.fromWkt( string );
}
代码示例来源:origin: hibernate/hibernate-orm
@Test
public void testWktWithoutSrid() throws SQLException {
String wkt = Wkt.toWkt( geom ).split( ";" )[1];
testCase( wkt, geomNoSrid );
}
代码示例来源:origin: org.geolatte/geolatte-geom
/**
* Creates a <code>WktEncoder</code> for the default dialect (Postgis 1.x EWKT).
* @return an <code>WktEncoder</code> that supports the default dialect
*/
public static WktEncoder newEncoder() {
return newEncoder(DEFAULT_DIALECT);
}
代码示例来源:origin: org.geolatte/geolatte-geom
/**
* Creates a <code>WktEncoder</code> for the specified WKT <code>Dialect</code>.
*
* @param dialect the WKT dialect
* @return an <code>WktEncoder</code> that supports the specified dialect
*/
public static WktEncoder newEncoder(Dialect dialect) {
Class<? extends WktEncoder> decoderClass = ENCODERS.get(dialect);
assert (decoderClass != null) : "A variant declared, but no encoder/decoder registered.";
return createInstance(decoderClass);
}
代码示例来源:origin: com.mysema.querydsl/querydsl-sql
@Override
public String getLiteral(Geometry geometry) {
return "'" + Wkt.newEncoder(Wkt.Dialect.POSTGIS_EWKT_1).encode(geometry) + "'";
}
}
代码示例来源:origin: org.geolatte/geolatte-geom
/**
* Creates a <code>WktDecoder</code> for the specified WKT <code>Dialect</code>.
*
* @param dialect the WKT dialect
* @return an <code>WktDecoder</code> that supports the specified dialect
*/
public static WktDecoder newDecoder(Dialect dialect) {
Class<? extends WktDecoder> decoderClass = DECODERS.get(dialect);
assert (decoderClass != null) : "A variant declared, but no encoder/decoder registered.";
return createInstance(decoderClass);
}
代码示例来源:origin: hibernate/hibernate-orm
public static WktDecoder getWktDecoder(Dialect dialect) {
WktDecoder decoder = null;
if ( dialect instanceof AbstractHANADialect ) {
decoder = Wkt.newDecoder( Wkt.Dialect.HANA_EWKT );
}
else if ( dialect instanceof DB2SpatialDialect ) {
decoder = Wkt.newDecoder( Wkt.Dialect.DB2_WKT );
}
else {
decoder = Wkt.newDecoder( Wkt.Dialect.POSTGIS_EWKT_1 );
}
return decoder;
}
}
代码示例来源:origin: org.geolatte/geolatte-geom
/**
* Encodes a <code>Geometry</code> to a WKT representation.
* <p>This method uses the default WKT dialect (Postgis v1.5 EWKT)</p>
*
* @param geometry the <code>Geometry</code> to encode
* @return the WKT representation of the given geometry
*/
public static String toWkt(Geometry<?> geometry) {
WktEncoder encoder = newEncoder();
return encoder.encode(geometry);
}
代码示例来源:origin: beihaifeiwu/dolphin
@Override
public Geometry getNullableResult(ResultSet rs, String columnName) throws SQLException {
String value = rs.getString(columnName);
if(!StringUtils.isEmpty(value)){
return Wkt.fromWkt(value);
}
return null;
}
代码示例来源:origin: hibernate/hibernate-orm
@Test
public void testWktWithSrid() throws SQLException {
String ewkt = Wkt.toWkt( geom );
testCase( ewkt, geom );
}
代码示例来源:origin: hibernate/hibernate-orm
WktDecoder decoder = Wkt.newDecoder();
for ( TestDataElement testDataElement : testData ) {
if ( testDataElement.type.equalsIgnoreCase( type ) ) {
代码示例来源:origin: com.querydsl/querydsl-sql-spatial
@Override
public void setValue(PreparedStatement st, int startIndex, Geometry value) throws SQLException {
String str = Wkt.newEncoder(Wkt.Dialect.POSTGIS_EWKT_1).encode(value);
st.setString(startIndex, str);
}
代码示例来源:origin: beihaifeiwu/dolphin
@Override
public Geometry getNullableResult(ResultSet rs, int columnIndex) throws SQLException {
String value = rs.getString(columnIndex);
if(!StringUtils.isEmpty(value)){
return Wkt.fromWkt(value);
}
return null;
}
代码示例来源:origin: org.geolatte/geolatte-geom
/**
* Returns the Well-Known Text (WKT) representation of this <code>Geometry</code>.
*
* @return the Well-Known Text (WKT) representation of this <code>Geometry</code>.
*/
public String toString() {
return Wkt.toWkt(this);
}
代码示例来源:origin: org.geolatte/geolatte-geom
/**
* Creates a <code>WktDecoder</code> for the default dialect (Postgis 1.x EWKT).
* @return an <code>WktDecoder</code> that supports the default dialect
* @return
*/
public static WktDecoder newDecoder() {
return newDecoder(DEFAULT_DIALECT);
}
代码示例来源:origin: com.mysema.querydsl/querydsl-sql
@Override
public void setValue(PreparedStatement st, int startIndex, Geometry value) throws SQLException {
String str = Wkt.newEncoder(Wkt.Dialect.POSTGIS_EWKT_1).encode(value);
st.setString(startIndex, str);
}
代码示例来源:origin: beihaifeiwu/dolphin
@Override
public Geometry getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
String value = cs.getString(columnIndex);
if(!StringUtils.isEmpty(value)){
return Wkt.fromWkt(value);
}
return null;
}
代码示例来源:origin: com.sqlapp/sqlapp-core
@Override
public String convertString(org.geolatte.geom.Geometry<?> value) {
if (value==null){
return null;
}
return Wkt.toWkt(value);
}
代码示例来源: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;
}
}
内容来源于网络,如有侵权,请联系作者删除!