gpt4 book ai didi

org.geolatte.geom.codec.WktDecoder.decode()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-24 17:29:05 27 4
gpt4 key购买 nike

本文整理了Java中org.geolatte.geom.codec.WktDecoder.decode()方法的一些代码示例,展示了WktDecoder.decode()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WktDecoder.decode()方法的具体详情如下:
包路径:org.geolatte.geom.codec.WktDecoder
类名称:WktDecoder
方法名:decode

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));
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com