我想存储在我的数据库中:
示例数据:
ST_GeomFromGML('
<gml:LineString srsName="EPSG:4269">
<gml:coordinates>
-71.16028,42.258729 -71.160837,42.259112 -71.161143,42.25932
</gml:coordinates>
</gml:LineString>');
我在条目中创建了一个带有 2 个参数的 API(字符串 id 和几何形状):
{
"id": "string",
"shape": {
"envelope": {},
"factory": {
"coordinateSequenceFactory": {},
"precisionModel": {
"scale": 0
}
},
"srid": 0,
"userData": {}
}
}
我的模型:
Entity
@Table(name = "test", schema = "aaa")
public class rectangle {
@Id
@Column(name = "id", length = 32)
private String id;
@Column(name = "shape")
private Geometry shape;
public rectangle() {
}
public rectangle(String id, Geometry shape) {
this.id = id;
this.shape = shape;
}
如何将我的示例日期解析到我的数据库?
找到有关 st_GeomFromGml 的文档: