本文整理了Java中org.geotools.xsd.Node.getParent()
方法的一些代码示例,展示了Node.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getParent()
方法的具体详情如下:
包路径:org.geotools.xsd.Node
类名称:Node
方法名:getParent
[英]Returns the parent node for this node
[中]返回此节点的父节点
代码示例来源:origin: geotools/geotools
@Override
public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
Node parent = node.getParent();
if (parent != null) {
String parentElementName = parent.getComponent().getName();
if (FOLDER.equals(parentElementName)) {
Folder folder = folderStack.peek();
if (folder != null) {
folder.setName(value.toString());
}
}
}
return super.parse(instance, node, value);
}
代码示例来源:origin: geotools/geotools
/**
* Returns the number of dimensions for the specified node, eventually recursing up to find the
* parent node that has the indication of the dimensions (normally the top-most geometry element
* has it, not the posList). If no srsDimension can be found, check the srsName the same way and
* return the srsDimensions instead. Returns 2 if no srsDimension or srsName attribute could be
* found.
*
* @param node
* @return
*/
public static int dimensions(Node node) {
Node current = node;
while (current != null) {
Node dimensions = current.getAttribute("srsDimension");
if (dimensions != null) {
return ((Number) dimensions.getValue()).intValue();
}
current = current.getParent();
}
current = node;
while (current != null) {
CoordinateReferenceSystem crs = crs(current);
if (crs != null) {
return crs.getCoordinateSystem().getDimension();
}
current = current.getParent();
}
return 2;
}
内容来源于网络,如有侵权,请联系作者删除!