本文整理汇总了Java中org.citygml4j.model.citygml.core.CityObjectMember类的典型用法代码示例。如果您正苦于以下问题:Java CityObjectMember类的具体用法?Java CityObjectMember怎么用?Java CityObjectMember使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CityObjectMember类属于org.citygml4j.model.citygml.core包,在下文中一共展示了CityObjectMember类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getElementMapper
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
private TypeMapper<JAXBElement<?>> getElementMapper() {
if (elementMapper == null) {
lock.lock();
try {
if (elementMapper == null) {
elementMapper = TypeMapper.<JAXBElement<?>>create()
.with(Address.class, this::createAddress)
.with(CityModel.class, this::createCityModel)
.with(CityObjectMember.class, this::createCityObjectMember)
.with(ImplicitGeometry.class, this::createImplicitGeometry);
}
} finally {
lock.unlock();
}
}
return elementMapper;
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:19,代码来源:Core100Marshaller.java
示例2: getTypeMapper
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
private TypeMapper<Object> getTypeMapper() {
if (typeMapper == null) {
lock.lock();
try {
if (typeMapper == null) {
typeMapper = TypeMapper.create()
.with(Address.class, this::marshalAddress)
.with(AddressProperty.class, this::marshalAddressProperty)
.with(CityModel.class, this::marshalCityModel)
.with(CityObjectMember.class, this::marshalCityObjectMember)
.with(ExternalObject.class, this::marshalExternalObject)
.with(ExternalReference.class, this::marshalExternalReference)
.with(GeneralizationRelation.class, this::marshalGeneralizationRelation)
.with(ImplicitGeometry.class, this::marshalImplicitGeometry)
.with(ImplicitRepresentationProperty.class, this::marshalImplicitRepresentationProperty)
.with(XalAddressProperty.class, this::marshalXalAddressProperty);
}
} finally {
lock.unlock();
}
}
return typeMapper;
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:25,代码来源:Core100Marshaller.java
示例3: getTypeMapper
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
private TypeMapper<Object> getTypeMapper() {
if (typeMapper == null) {
lock.lock();
try {
if (typeMapper == null) {
typeMapper = TypeMapper.create()
.with(Address.class, this::marshalAddress)
.with(AddressProperty.class, this::marshalAddressProperty)
.with(CityModel.class, this::marshalCityModel)
.with(CityObjectMember.class, this::marshalCityObjectMember)
.with(ExternalObject.class, this::marshalExternalObject)
.with(ExternalReference.class, this::marshalExternalReference)
.with(GeneralizationRelation.class, this::marshalGeneralizationRelation)
.with(ImplicitGeometry.class, this::marshalImplicitGeometry)
.with(ImplicitRepresentationProperty.class, this::marshalImplicitRepresentationProperty)
.with(RelativeToTerrain.class, this::marshalRelativeToTerrain)
.with(RelativeToWater.class, this::marshalRelativeToWater)
.with(XalAddressProperty.class, this::marshalXalAddressProperty);
}
} finally {
lock.unlock();
}
}
return typeMapper;
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:27,代码来源:Core200Marshaller.java
示例4: unmarshalCityModel
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public void unmarshalCityModel(CityJSON src, CityModel dest) {
for (AbstractCityObjectType type : src.getCityObjects()) {
AbstractCityObject cityObject = citygml.unmarshal(type, src);
if (cityObject != null)
dest.addCityObjectMember(new CityObjectMember(cityObject));
}
if (src.isSetMetadata()) {
MetadataType metadata = src.getMetadata();
if (metadata.isSetBBox()) {
List<Double> bbox = metadata.getBBox();
if (bbox.size() > 5) {
BoundingShape boundedBy = new BoundingShape(new BoundingBox(
new Point(bbox.get(0), bbox.get(1), bbox.get(2)),
new Point(bbox.get(3), bbox.get(4), bbox.get(5))));
if (metadata.isSetCRS())
boundedBy.getEnvelope().setSrsName("EPSG:" + metadata.getCRS().getEpsg());
dest.setBoundedBy(boundedBy);
}
}
}
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:26,代码来源:CoreUnmarshaller.java
示例5: readCityGMLFile
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
/**
* Returns a list for BuildingCallable read by CityGML file
*
* @param pathtocitygmlfile
* @param options
* @return List<BuildingCallable>
* @throws Exception
*/
public List<BuildingCallable> readCityGMLFile(String pathtocitygmlfile, Options options) throws Exception {
this.options = options;
List<BuildingCallable> buildings = new ArrayList<BuildingCallable>();
CityGMLContext ctx = new CityGMLContext();
CityGMLBuilder builder = ctx.createCityGMLBuilder();
CityGMLInputFactory in = builder.createCityGMLInputFactory();
CityGMLReader reader = in.createCityGMLReader(new File(pathtocitygmlfile));
while (reader.hasNext()) {
CityGML citygml = reader.nextFeature();
if (citygml.getCityGMLClass() == CityGMLClass.CITY_MODEL) {
CityModel cityModel = (CityModel)citygml;
for (CityObjectMember cityObjectMember : cityModel.getCityObjectMember()) {
AbstractCityObject cityObject = cityObjectMember.getCityObject();
if (cityObject.getCityGMLClass() == CityGMLClass.BUILDING){
Building building = (Building)cityObject;
String buildingID = building.getId();
BuildingCallable buildingcallable = new BuildingCallable();
buildingcallable.setBsp(building.getBoundedBySurface());
buildingcallable.setBuildingId(buildingID);
buildingcallable.setOptions(options);
buildings.add(buildingcallable);
}
}
}
}
reader.close();
return buildings;
}
开发者ID:SteuerHorst,项目名称:Voluminator,代码行数:45,代码来源:BuildingReader.java
示例6: apply
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public T apply(CityModel cityModel) {
T object = apply((AbstractFeatureCollection)cityModel);
if (object != null)
return object;
if (cityModel.isSetCityObjectMember()) {
for (CityObjectMember cityObjectMember : new ArrayList<CityObjectMember>(cityModel.getCityObjectMember())) {
object = apply(cityObjectMember);
if (object != null)
return object;
}
}
if (cityModel.isSetAppearanceMember()) {
for (AppearanceMember appearanceMember : new ArrayList<AppearanceMember>(cityModel.getAppearanceMember())) {
object = apply(appearanceMember);
if (object != null)
return object;
}
}
if (cityModel.isSetGenericApplicationPropertyOfCityModel()) {
for (ADEComponent ade : new ArrayList<ADEComponent>(cityModel.getGenericApplicationPropertyOfCityModel())) {
object = apply(ade);
if (object != null)
return object;
}
}
return null;
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:32,代码来源:GMLFunctionWalker.java
示例7: unmarshalCityObjectMember
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public CityObjectMember unmarshalCityObjectMember(FeaturePropertyType src) throws MissingADESchemaException {
CityObjectMember dest = new CityObjectMember(module);
jaxb.getGMLUnmarshaller().unmarshalFeatureProperty(src, dest);
if (src.isSet_Feature()) {
ModelObject abstractFeature = jaxb.unmarshal(src.get_Feature());
if (abstractFeature instanceof AbstractCityObject)
dest.setFeature((AbstractCityObject)abstractFeature);
}
return dest;
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:13,代码来源:Core200Unmarshaller.java
示例8: marshalCityModel
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public List<AbstractCityObjectType> marshalCityModel(CityModel src) {
List<AbstractCityObjectType> dest = new ArrayList<>();
if (src.isSetCityObjectMember()) {
for (CityObjectMember property : src.getCityObjectMember()) {
if (property.isSetCityObject())
dest.addAll(citygml.marshal(property.getCityObject()));
}
}
return dest;
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:12,代码来源:CoreMarshaller.java
示例9: main
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SimpleDateFormat df = new SimpleDateFormat("[HH:mm:ss] ");
System.out.println(df.format(new Date()) + "setting up citygml4j context and CityGML builder");
CityGMLContext ctx = CityGMLContext.getInstance();
CityGMLBuilder builder = ctx.createCityGMLBuilder();
System.out.println(df.format(new Date()) + "reading CityGML file LOD2_Buildings_v100.gml completely into main memory");
CityGMLInputFactory in = builder.createCityGMLInputFactory();
CityGMLReader reader = in.createCityGMLReader(new File("datasets/LOD2_Buildings_v100.gml"));
while (reader.hasNext()) {
CityGML citygml = reader.nextFeature();
if (citygml.getCityGMLClass() == CityGMLClass.CITY_MODEL) {
CityModel cityModel = (CityModel)citygml;
System.out.println(df.format(new Date()) + "Found " + citygml.getCityGMLClass() + " version " + cityModel.getCityGMLModule().getVersion());
System.out.println(df.format(new Date()) + "going through city model and counting building instances");
int count = 0;
for (CityObjectMember cityObjectMember : cityModel.getCityObjectMember()) {
AbstractCityObject cityObject = cityObjectMember.getCityObject();
if (cityObject.getCityGMLClass() == CityGMLClass.BUILDING)
count++;
}
System.out.println(df.format(new Date()) + "The city model contains " + count + " building features");
}
}
reader.close();
System.out.println(df.format(new Date()) + "sample citygml4j application successfully finished");
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:35,代码来源:SimpleReader.java
示例10: main
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SimpleDateFormat df = new SimpleDateFormat("[HH:mm:ss] ");
System.out.println(df.format(new Date()) + "setting up citygml4j context and CityGML builder");
CityGMLContext ctx = CityGMLContext.getInstance();
CityGMLBuilder builder = ctx.createCityGMLBuilder();
// creating example (and simple) CityGML object tree
System.out.println(df.format(new Date()) + "creating simple city model with invalid content");
Building building = new Building();
// set invalid gml:id
building.setId("1st-Building");
// set empty and thus invalid generic attribute set
building.addGenericAttribute(new GenericAttributeSet());
CityModel cityModel = new CityModel();
cityModel.addCityObjectMember(new CityObjectMember(building));
System.out.println(df.format(new Date()) + "creating citygml4j Validator and validating city model against CityGML 2.0.0");
SchemaHandler schemaHandler = SchemaHandler.newInstance();
Validator validator = builder.createValidator(schemaHandler);
validator.setValidationEventHandler(new ValidationEventHandler() {
public boolean handleEvent(ValidationEvent event) {
System.out.println(event.getMessage());
return true;
}
});
validator.validate(cityModel, CityGMLVersion.v2_0_0);
System.out.println(df.format(new Date()) + "sample citygml4j application successfully finished");
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:35,代码来源:ObjectTreeValidation.java
示例11: print
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public void print(AbstractFeature abstractFeature) throws CityGMLWriteException {
FeatureProperty<? extends AbstractFeature> member = null;
// wrap feature with a feature property element
if (abstractFeature instanceof AbstractCityObject) {
member = new CityObjectMemberImpl();
((CityObjectMember)member).setCityObject((AbstractCityObject)abstractFeature);
}
else if (abstractFeature instanceof Appearance) {
member = new AppearanceMemberImpl();
((AppearanceMember)member).setAppearance((Appearance)abstractFeature);
}
else {
member = new FeatureMemberImpl();
((FeatureMember)member).setFeature(abstractFeature);
}
if (member != null) {
try {
SAXEventBuffer buffer = new SAXEventBuffer();
Marshaller marshaller = jaxbBuilder.getJAXBContext().createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FRAGMENT, Boolean.TRUE);
JAXBElement<?> jaxbElement = jaxbMarshaller.marshalJAXBElement(member);
if (jaxbElement != null)
marshaller.marshal(jaxbElement, buffer);
if (!buffer.isEmpty())
ioWriterPool.addWork(buffer);
} catch (JAXBException e) {
throw new CityGMLWriteException("Caused by: ", e);
}
}
}
开发者ID:3dcitydb,项目名称:importer-exporter-oracle,代码行数:37,代码来源:DBExporterManager.java
示例12: marshalCityObjectMember
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public FeaturePropertyType marshalCityObjectMember(CityObjectMember src) {
return jaxb.getGMLMarshaller().marshalFeatureProperty(src);
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:4,代码来源:Core100Marshaller.java
示例13: createCityObjectMember
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
private JAXBElement<?> createCityObjectMember(CityObjectMember src) {
return core.createCityObjectMember(marshalCityObjectMember(src));
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:4,代码来源:Core100Marshaller.java
示例14: main
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SimpleDateFormat df = new SimpleDateFormat("[HH:mm:ss] ");
System.out.println(df.format(new Date()) + "setting up citygml4j context and CityGML builder");
CityGMLContext ctx = CityGMLContext.getInstance();
CityGMLBuilder builder = ctx.createCityGMLBuilder();
System.out.println(df.format(new Date()) + "reading CityGML file LOD2_CityObjectGroup_v100.gml");
CityGMLInputFactory in = builder.createCityGMLInputFactory();
CityGMLReader reader = in.createCityGMLReader(new File("datasets/LOD2_CityObjectGroup_v100.gml"));
CityModel cityModel = (CityModel)reader.nextFeature();
reader.close();
System.out.println(df.format(new Date()) + "creating XLinkResolver");
XLinkResolver xLinkResolver = new XLinkResolver();
for (CityObjectMember member : cityModel.getCityObjectMember()) {
if (member.isSetCityObject() &&
member.getCityObject().getCityGMLClass() == CityGMLClass.CITY_OBJECT_GROUP) {
CityObjectGroup group = (CityObjectGroup)member.getCityObject();
for (CityObjectGroupMember groupMember : group.getGroupMember()) {
System.out.println(df.format(new Date()) + "processing group member with role: " + groupMember.getGroupRole());
System.out.println(df.format(new Date()) + "resolving XLink to " + groupMember.getHref());
AbstractCityObject cityObject = xLinkResolver.getAbstractGML(groupMember.getHref(), cityModel, AbstractCityObject.class);
System.out.println(" Referenced city object: " + cityObject.getCityGMLClass() +
", gml:id='" + cityObject.getId() +"'");
if (cityObject.getId().equals("ID_76")) {
Road road = (Road)cityObject;
TrafficArea trafficArea = road.getTrafficArea().get(2).getTrafficArea();
System.out.println(df.format(new Date()) + "resolving XLink to " + trafficArea.getLod2MultiSurface().getHref());
ModelObject object = xLinkResolver.getObject(trafficArea.getLod2MultiSurface().getHref(), road);
if (object instanceof MultiSurface) {
MultiSurface multiSurface = (MultiSurface)object;
System.out.println(" Referenced geometry: " + multiSurface.getGMLClass() +
", gml:id='" + multiSurface.getId() + "'");
}
}
}
}
}
System.out.println(df.format(new Date()) + "sample citygml4j application successfully finished");
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:48,代码来源:ResolvingInternalXlinks.java
示例15: main
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SimpleDateFormat df = new SimpleDateFormat("[HH:mm:ss] ");
System.out.println(df.format(new Date()) + "setting up citygml4j context and CityGML builder");
CityGMLContext ctx = CityGMLContext.getInstance();
CityGMLBuilder builder = ctx.createCityGMLBuilder();
System.out.println(df.format(new Date()) + "creating citygml4j JAXBUnmarshaller and JAXBMarshaller instances");
JAXBUnmarshaller unmarshaller = builder.createJAXBUnmarshaller();
JAXBMarshaller marshaller = builder.createJAXBMarshaller();
marshaller.setModuleContext(new ModuleContext(CityGMLVersion.v2_0_0));
// create DOM model from CityGML document
System.out.println(df.format(new Date()) + "reading CityGML file LOD2_Building_with_Placeholder_v200.gml as DOM tree");
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
docFactory.setNamespaceAware(true);
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document document = docBuilder.parse("datasets/LOD2_Building_with_Placeholder_v200.gml");
// create XPath factory
System.out.println(df.format(new Date()) + "creating XPath factory");
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();
// get CityGML namespace context
CityGMLNamespaceContext nsContext = new CityGMLNamespaceContext();
nsContext.setPrefixes(CityGMLVersion.v2_0_0);
xpath.setNamespaceContext(nsContext);
// first: retrieve building node using XPath
System.out.println(df.format(new Date()) + "searching for bldg:Building node in DOM tree using an XPath expression");
Node buildingNode = (Node)xpath.evaluate("//bldg:Building", document, XPathConstants.NODE);
// unmarshal DOM node to citygml4j
System.out.println(df.format(new Date()) + "unmarshalling DOM node to citygml4j");
Building building = (Building)unmarshaller.unmarshal(buildingNode);
// add gml:id and gml:description to building
System.out.println(df.format(new Date()) + "processing content using citygml4j");
building.setId(DefaultGMLIdManager.getInstance().generateUUID());
StringOrRef description = new StringOrRef();
description.setValue("processed by citygml4j using DOM and XPath");
building.setDescription(description);
// marshal to DOM and put into document
System.out.println(df.format(new Date()) + "marshalling back to DOM");
Element newBuildingNode = marshaller.marshalDOMElement(building, document);
buildingNode.getParentNode().replaceChild(newBuildingNode, buildingNode);
// second: get placeholder using XPath
System.out.println(df.format(new Date()) + "searching for 'Placeholder' in DOM tree using an XPath expression");
Node memberNode = (Node)xpath.evaluate("//core:cityObjectMember[comment()='Placeholder']", document, XPathConstants.NODE);
// create simple citygml4j object to insert into placeholder
System.out.println(df.format(new Date()) + "inserting CityFurniture instance at placeholder using citygml4j");
CityFurniture cityFurniture = new CityFurniture();
cityFurniture.setDescription(description);
CityObjectMember member = new CityObjectMember(cityFurniture);
// marshal to DOM and put into document
System.out.println(df.format(new Date()) + "marshalling back to DOM");
Element newMemberNode = marshaller.marshalDOMElement(member, document);
memberNode.getParentNode().replaceChild(newMemberNode, memberNode);
// write DOM to file
System.out.println(df.format(new Date()) + "writing DOM tree");
TransformerFactory transFactory = TransformerFactory.newInstance();
Transformer trans = transFactory.newTransformer();
trans.setOutputProperty(OutputKeys.INDENT, "yes");
trans.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
Files.createDirectory(Paths.get("output"));
DOMSource source = new DOMSource(document);
StreamResult result = new StreamResult(new FileOutputStream("output/LOD2_DOM_result_v200.gml"));
trans.transform(source, result);
System.out.println(df.format(new Date()) + "CityGML file LOD2_DOM_result_v200.gml written");
System.out.println(df.format(new Date()) + "sample citygml4j application successfully finished");
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:80,代码来源:DOMAndXPath.java
示例16: main
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SimpleDateFormat df = new SimpleDateFormat("[HH:mm:ss] ");
System.out.println(df.format(new Date()) + "setting up citygml4j context and CityJSON builder");
CityGMLContext ctx = CityGMLContext.getInstance();
CityJSONBuilder builder = ctx.createCityJSONBuilder();
System.out.println(df.format(new Date()) + "reading only city furniture objects from CityJSON file LOD3_Railway.json");
CityJSONInputFactory in = builder.createCityJSONInputFactory();
CityJSONReader reader = in.createCityJSONReader(new File("datasets/LOD3_Railway.json"));
reader = in.createFilteredCityJSONReader(reader, new CityObjectTypeFilter() {
// return true if you want to consume the CityJSON feature
// of the given "type"
public boolean accept(String type) {
// CityObjectTypeName is an enum of the predefined "type" values in CityJSON
// but any other String can be used as well
return type.equals(CityObjectTypeName.CITY_FURNITURE.getValue());
}
});
CityModel cityModel = reader.read();
reader.close();
// iterate over all city objects of the city model
for (CityObjectMember member : cityModel.getCityObjectMember()) {
if (member.isSetCityObject()) {
AbstractCityObject cityObject = member.getCityObject();
System.out.println("Found " + cityObject.getCityGMLClass() + " feature");
System.out.println("\tgml:id '" + cityObject.getId() + "'");
// check and print LoD geometries
LodRepresentation lods = cityObject.getLodRepresentation();
for (int lod = 0; lod < 5; lod++) {
if (lods.isSetGeometry(lod))
System.out.println("\thas LoD " + lod + " geometry");
}
}
}
System.out.println(df.format(new Date()) + "sample citygml4j application successfully finished");
}
开发者ID:citygml4j,项目名称:citygml4j,代码行数:44,代码来源:FilteredReader.java
示例17: CG_CityModel
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
public CG_CityModel(CityModel impl) {
super();
int nbElem = impl.getCityObjectMember().size();
System.out.println(nbElem);
if (impl.isSetBoundedBy()) {
Envelope bS = impl.getBoundedBy().getEnvelope();
if (bS.getLowerCorner() != null) {
this.dpLL = new DirectPosition(bS.getLowerCorner().getValue().get(0),
bS.getLowerCorner().getValue().get(1), bS.getLowerCorner().getValue().get(2));
this.dpUR = new DirectPosition(bS.getUpperCorner().getValue().get(0),
bS.getUpperCorner().getValue().get(1), bS.getUpperCorner().getValue().get(2));
} else {
List<org.citygml4j.model.gml.geometry.primitives.DirectPosition> lPos = bS.getPos();
this.dpLL = new DirectPosition(lPos.get(0).getValue().get(0), lPos.get(0).getValue().get(1),
lPos.get(0).getValue().get(2));
this.dpUR = new DirectPosition(lPos.get(1).getValue().get(0), lPos.get(1).getValue().get(1),
lPos.get(1).getValue().get(2));
}
}
if (impl.isSetAppearanceMember()) {
int nbApp = impl.getAppearanceMember().size();
for (int i = 0; i < nbApp; i++) {
Appearance ap = impl.getAppearanceMember().get(i).getFeature();
if (ap.isSetSurfaceDataMember()) {
int nbDataMember = ap.getSurfaceDataMember().size();
for (int j = 0; j < nbDataMember; j++) {
AbstractSurfaceData abs = ap.getSurfaceDataMember().get(j).getSurfaceData();
this.getlCGA().add(CG_AbstractSurfaceData.generateAbstractSurfaceData(abs));
}
}
}
}
int count = 0;
for(CityObjectMember cityObjectMember : impl.getCityObjectMember()){
CG_CityObject object = CG_CityObject.generateCityObject(cityObjectMember.getObject());
this.add(object);
System.out.println("Object added ("+(++count)+"/"+ nbElem+") : " + object);
}
System.out.println("The end");
}
开发者ID:IGNF,项目名称:geoxygene,代码行数:71,代码来源:CG_CityModel.java
示例18: convert
import org.citygml4j.model.citygml.core.CityObjectMember; //导入依赖的package包/类
/**
* Converts all files of bliste from CityGML defined in inputfile to an OBJ-file in outputFolder.
* @param inputfile
* @param outputFolder
* @param bliste
* @throws Exception
*/
public static void convert(String inputfile, String outputFolder, String[] bliste ) throws Exception
{
SimpleDateFormat df = new SimpleDateFormat("[HH:mm:ss] ");
System.out.println(df.format(new Date()) + "setting up citygml4j context and JAXB builder");
CityGMLContext ctx = new CityGMLContext();
CityGMLBuilder builder = ctx.createCityGMLBuilder();
System.out.println(df.format(new Date()) + "reading CityGML file " + inputfile + " completely into main memory");
CityGMLInputFactory in = builder.createCityGMLInputFactory();
CityGMLReader reader = in.createCityGMLReader(new File(inputfile));
while (reader.hasNext()) {
CityGML citygml = reader.nextFeature();
System.out.println("Found " + citygml.getCityGMLClass() +
" version " + citygml.getCityGMLModule().getVersion());
if (citygml.getCityGMLClass() == CityGMLClass.CITY_MODEL) {
CityModel cityModel = (CityModel)citygml;
System.out.println(df.format(new Date()) + "going through city model and counting building instances");
for (CityObjectMember cityObjectMember : cityModel.getCityObjectMember()) {
AbstractCityObject cityObject = cityObjectMember.getCityObject();
if (cityObject.getCityGMLClass() == CityGMLClass.BUILDING)
{
Building building = (Building)cityObject;
String buildingID = building.getId();
if(bliste != null && isInList(bliste,buildingID ))
{
List<BoundarySurfaceProperty> bsp = building
.getBoundedBySurface();
PolygonConstructor pc = new PolygonConstructor();
Polygon temp = new Polygon();
String filename = outputFolder+ "/" + buildingID + ".obj";
temp.saveObj(filename, pc.constructPolygons(bsp));
}
}
}
}
}
reader.close();
System.out.println(df.format(new Date()) + "CityGMLToOBJ successfully finished");
}
开发者ID:SteuerHorst,项目名称:Voluminator,代码行数:65,代码来源:CityGMLToOBJ.java
注:本文中的org.citygml4j.model.citygml.core.CityObjectMember类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论