/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { // set the crs if (value instanceof Geometry) { CoordinateReferenceSystem crs = GML3ParsingUtils.crs(node); if (crs != null) { Geometry geometry = (Geometry) value; geometry.setUserData(crs); } } return value; }
static LineString lineString(Node node, GeometryFactory gf, CoordinateSequenceFactory csf) { return line(node, gf, csf, false); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.lineString(node, gFactory, csFactory); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { LineString arcLineString = GML3ParsingUtils.lineString(node, gFactory, csFactory); CoordinateSequence cs = arcLineString.getCoordinateSequence(); if (cs.size() < 3) { // maybe log this instead and return null throw new RuntimeException( "Number of coordinates in an arc string must be at least 3, " + cs.size() + " were specified: " + arcLineString); } CurvedGeometryFactory factory = GML3ParsingUtils.getCurvedGeometryFactory(arcParameters, gFactory, cs); return factory.createCurvedGeometry(cs); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.linearRing(node, gFactory, csFactory); }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.parseFeature(instance, node, value, ftCache, bwFactory); // //get the definition of the element // XSDElementDeclaration decl = instance.getElementDeclaration(); // // //look for a feature type in the cache // FeatureType fType = ftCache.get(decl.getName()); // // if (fType == null) { // fType = GML3ParsingUtils.featureType(decl, bwFactory); // ftCache.put(fType); // } // // //TODO: this could pick up wrong thing, node api needs to be // // namespace aware // String fid = (String) node.getAttributeValue("id"); // // return GML3ParsingUtils.feature(fType, fid, node); }
SimpleFeatureType featureType = GML3ParsingUtils.featureType(elementDecl, bwFactory); if (crs != null) { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
int crsDimension = GML3ParsingUtils.dimensions(node); CoordinateReferenceSystem crs = GML3ParsingUtils.crs(node);
@Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { List children = node.getChildren("curveMember"); List<LineString> components = new ArrayList<>(); for (Iterator it = children.iterator(); it.hasNext(); ) { Node child = (Node) it.next(); if (child.getValue() instanceof LineString) { LineString ls = (LineString) child.getValue(); components.add(ls); } } if (components.isEmpty()) { return gFactory.createLineString(new Coordinate[0]); } else { CoordinateSequence cs = components.get(0).getCoordinateSequence(); CurvedGeometryFactory factory = GML3ParsingUtils.getCurvedGeometryFactory(arcParameters, gFactory, cs); return factory.createCurvedGeometry(components); } }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.linearRing(node, gFactory, csFactory); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.parseFeature(instance, node, value, ftCache, bwFactory); // //get the definition of the element // XSDElementDeclaration decl = instance.getElementDeclaration(); // // //look for a feature type in the cache // FeatureType fType = ftCache.get(decl.getName()); // // if (fType == null) { // fType = GML3ParsingUtils.featureType(decl, bwFactory); // ftCache.put(fType); // } // // //TODO: this could pick up wrong thing, node api needs to be // // namespace aware // String fid = (String) node.getAttributeValue("id"); // // return GML3ParsingUtils.feature(fType, fid, node); }
SimpleFeatureType featureType = GML3ParsingUtils.featureType(elementDecl, bwFactory);
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ @Override public Object parse(ElementInstance instance, Node node, Object value) throws Exception { LineString arcLineString = GML3ParsingUtils.lineString(node, gFactory, csFactory); CoordinateSequence cs = arcLineString.getCoordinateSequence(); if (cs.size() < 3) { // maybe log this instead and return null throw new RuntimeException( "Number of coordinates in an arc string must be at least 3, " + cs.size() + " were specified: " + arcLineString); } CurvedGeometryFactory factory = GML3ParsingUtils.getCurvedGeometryFactory(arcParameters, gFactory, cs); return factory.createCurvedGeometry(cs); } }
GML3ParsingUtils.getCurvedGeometryFactory( arcParameters, gf,
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { CoordinateReferenceSystem crs = GML3ParsingUtils.crs(node); // double[] position = (double[]) value; Double[] position = (Double[]) value; DirectPosition dp = null; if (position.length < 2) { dp = (crs != null) ? new DirectPosition1D(crs) : new DirectPosition1D(); dp.setOrdinate(0, position[0].doubleValue()); } else if (position.length < 3) { dp = (crs != null) ? new DirectPosition2D(crs) : new DirectPosition2D(); dp.setOrdinate(0, position[0].doubleValue()); dp.setOrdinate(1, position[1].doubleValue()); } else { dp = (crs != null) ? new DirectPosition3D(crs) : new DirectPosition3D(); dp.setOrdinate(0, position[0].doubleValue()); dp.setOrdinate(1, position[1].doubleValue()); dp.setOrdinate(2, position[2].doubleValue()); } return dp; }
/** * * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.lineString(node, gf, csf); }
static LinearRing linearRing(Node node, GeometryFactory gf, CoordinateSequenceFactory csf) { return (LinearRing) line(node, gf, csf, true); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.linearRing(node, gFactory, csFactory); }
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated modifiable */ public Object parse(ElementInstance instance, Node node, Object value) throws Exception { return GML3ParsingUtils.parseFeature(instance, node, value, ftCache, bwFactory); // //get the definition of the element // XSDElementDeclaration decl = instance.getElementDeclaration(); // // //look for a feature type in the cache // FeatureType fType = ftCache.get(decl.getName()); // // if (fType == null) { // fType = GML3ParsingUtils.featureType(decl, bwFactory); // ftCache.put(fType); // } // // //TODO: this could pick up wrong thing, node api needs to be // // namespace aware // String fid = (String) node.getAttributeValue("id"); // // return GML3ParsingUtils.feature(fType, fid, node); }
SimpleFeatureType featureType = GML3ParsingUtils.featureType(elementDecl, bwFactory); if (crs != null) { SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();