空间的字段值是二进制,你打印出来的就是二进制对象地址,未进行二进制对象进行序列化。
以超图的OraclePlus数据源里的空间数据读取,将空间要素序列化打印,如下代码示例:
val params = new java.util.HashMap[String, java.io.Serializable]()
params.put(SDXFeatureRDDProviderParams.DBType.key, "OraclePlus")
params.put(SDXFeatureRDDProviderParams.Server.key, "127.0.0.1:1521/orcl")
params.put(SDXFeatureRDDProviderParams.User.key, "c##mytest")
params.put(SDXFeatureRDDProviderParams.PassWord.key, "supermap")
params.put(FeatureRDDProviderParams.ProviderType.key, "sdx")
val sdx = new SDXFeatureRDDProvider()
val rdd = sdx.rdd(new Configuration(), ss.sparkContext, params, new Query("NewPoint"))
println(rdd.first()) //打印第一个要素,内部会自动序列化空间对象