当前位置: 首页>>代码示例>>Java>>正文


Java CityModel类代码示例

本文整理汇总了Java中org.citygml4j.model.citygml.core.CityModel的典型用法代码示例。如果您正苦于以下问题:Java CityModel类的具体用法?Java CityModel怎么用?Java CityModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CityModel类属于org.citygml4j.model.citygml.core包,在下文中一共展示了CityModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeCityModel

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
private void writeCityModel(WriteMode mode) throws FeatureWriteException {
	try {
		SAXFragmentWriter fragmentWriter = new SAXFragmentWriter(
				new QName(version.getCityGMLModule(CityGMLModuleType.CORE).getNamespaceURI(), "CityModel"), 
				saxWriter, 
				mode);

		JAXBElement<?> jaxbElement = jaxbMarshaller.marshalJAXBElement(new CityModel());
		if (jaxbElement != null) {
			Marshaller marshaller = cityGMLBuilder.getJAXBContext().createMarshaller();
			marshaller.marshal(jaxbElement, fragmentWriter);
		}
	} catch (JAXBException e) {
		throw new FeatureWriteException("Failed to write CityGML document header.", e);
	}
}
 
开发者ID:3dcitydb,项目名称:importer-exporter,代码行数:17,代码来源:CityGMLWriter.java

示例2: getElementMapper

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的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

示例3: getTypeMapper

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的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

示例4: getTypeMapper

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的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

示例5: assignGenericProperty

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
public boolean assignGenericProperty(ADEGenericElement genericProperty, QName substitutionGroup, CityGML dest) {
	String name = substitutionGroup.getLocalPart();
	boolean success = true;

	if (dest instanceof AbstractCityObject && name.equals("_GenericApplicationPropertyOfCityObject"))
		((AbstractCityObject)dest).addGenericApplicationPropertyOfCityObject(genericProperty);
	else if (dest instanceof AbstractSite && name.equals("_GenericApplicationPropertyOfSite"))
		((AbstractSite)dest).addGenericApplicationPropertyOfSite(genericProperty);
	else if (dest instanceof Address && name.equals("_GenericApplicationPropertyOfAddress"))
		((Address)dest).addGenericApplicationPropertyOfAddress(genericProperty);
	else if (dest instanceof CityModel && name.equals("_GenericApplicationPropertyOfCityModel"))
		((CityModel)dest).addGenericApplicationPropertyOfCityModel(genericProperty);
	else 
		success = false;

	return success;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:18,代码来源:Core200Unmarshaller.java

示例6: write

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
public void write(CityModel cityModel) throws CityJSONWriteException {
	CityJSON cityJSON = marshaller.marshal(cityModel);
	if (cityJSON != null) {
		MetadataType metadata = this.metadata != null ? this.metadata : new MetadataType();

		if (!metadata.isSetBBox() && !cityJSON.getVertices().isEmpty()) {
			List<Double> bbox = cityJSON.calcBoundingBox();
			if (cityJSON.isSetTransform()) {
				TransformType transform = cityJSON.getTransform();
				for (int i = 0; i < bbox.size(); i++)
					bbox.set(i, bbox.get(i) * transform.getScale().get(i%3) + transform.getTranslate().get(i%3));
			}
			
			metadata.setBBox(bbox);
		}

		if (!metadata.isSetPresentLoDs() && cityJSON.hasCityObjects()) {
			List<Number> lods = cityJSON.calcPresentLoDs();
			if (!lods.isEmpty())
				metadata.setPresentLoDs(lods);
		}

		cityJSON.setMetadata(metadata);			
		gson.toJson(cityJSON, CityJSON.class, writer);
	}
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:27,代码来源:CityJSONWriter.java

示例7: unmarshalCityModel

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的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

示例8: readCityGMLFile

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的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

示例9: CityModelInfo

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public CityModelInfo(CityModel cityModel) {
	if (cityModel == null)
		throw new IllegalArgumentException("cityModel may not be null.");
	
	DeepCopyBuilder builder = new DeepCopyBuilder();
	
	if (cityModel.isSetId())
		setId(cityModel.getId());
	
	if (cityModel.isSetName())
		setName((List<Code>)builder.copy(cityModel.getName()));
	
	if (cityModel.isSetDescription())
		setDescription((StringOrRef)builder.copy(cityModel.getDescription()));
	
	if (cityModel.isSetMetaDataProperty())
		setMetaDataProperty((List<MetaDataProperty>)builder.copy(cityModel.getMetaDataProperty()));
	
	if (cityModel.isSetBoundedBy())
		setBoundedBy((BoundingShape)builder.copy(cityModel.getBoundedBy()));
	
	if (cityModel.isSetLocation())
		setLocation((LocationProperty)builder.copy(cityModel.getLocation()));
	
	if (cityModel.isSetGenericApplicationPropertyOfCityModel())
		setGenericApplicationPropertyOfCityModel((List<ADEComponent>)builder.copy(cityModel.getGenericApplicationPropertyOfCityModel()));
	
	if (cityModel.isSetGenericADEElement())
		setGenericADEElement((List<ADEGenericElement>)builder.copy(cityModel.getGenericADEElement()));
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:32,代码来源:CityModelInfo.java

示例10: toCityModel

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
public CityModel toCityModel() {
	CityModel cityModel = new CityModel();
	
	if (isSetId())
		cityModel.setId(getId());

	if (isSetName())
		cityModel.setName(getName());

	if (isSetDescription())
		cityModel.setDescription(getDescription());

	if (isSetMetaDataProperty())
		cityModel.setMetaDataProperty(getMetaDataProperty());

	if (isSetBoundedBy())
		cityModel.setBoundedBy(getBoundedBy());

	if (isSetLocation())
		cityModel.setLocation(getLocation());
	
	if (isSetGenericApplicationPropertyOfCityModel())
		cityModel.setGenericApplicationPropertyOfCityModel(getGenericApplicationPropertyOfCityModel());
	
	if (isSetGenericADEElement())
		cityModel.setGenericADEElement(getGenericADEElement());
	
	return cityModel;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:30,代码来源:CityModelInfo.java

示例11: apply

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的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

示例12: isSetAppearance

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
public boolean isSetAppearance() {
	if (feature instanceof AbstractCityObject)
		return ((AbstractCityObject)feature).isSetAppearance();
	else if (feature instanceof CityModel)
		return ((CityModel)feature).isSetAppearanceMember();

	return false;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:9,代码来源:XMLChunkImpl.java

示例13: getAppearance

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
public List<? extends AppearanceProperty> getAppearance() {
	if (feature instanceof AbstractCityObject)
		return ((AbstractCityObject)feature).getAppearance();
	else if (feature instanceof CityModel)
		return ((CityModel)feature).getAppearanceMember();

	return null;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:9,代码来源:XMLChunkImpl.java

示例14: unmarshalCityModel

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
public void unmarshalCityModel(CityModelType src, CityModel dest) throws MissingADESchemaException {
	jaxb.getGMLUnmarshaller().unmarshalAbstractFeatureCollection(src, dest);

	if (src.isSet_GenericApplicationPropertyOfCityModel()) {
		for (JAXBElement<Object> elem : src.get_GenericApplicationPropertyOfCityModel()) {
			ADEModelObject ade = jaxb.getADEUnmarshaller().unmarshal(elem);
			if (ade != null)
				dest.addGenericApplicationPropertyOfCityModel(ade);
		}
	}
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:12,代码来源:Core200Unmarshaller.java

示例15: read

import org.citygml4j.model.citygml.core.CityModel; //导入依赖的package包/类
public CityModel read() {
	CityJSON cityJSON = builder.create().fromJson(reader, CityJSON.class);
	if (cityJSON != null) {
		metadata = cityJSON.getMetadata();
		CityModel cityModel = unmarshaller.unmarshal(cityJSON);
		
		if (metadata != null) {
			if (metadata.isSetBBox()) {
				List<Double> bbox = metadata.getBBox();
				if (bbox.size() > 5) {
					BoundingShape boundedBy = new BoundingShape();
					boundedBy.setEnvelope(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(new StringBuilder("EPSG:").append(metadata.getCRS().getEpsg()).toString());
					
					cityModel.setBoundedBy(boundedBy);
				}
			}
		}
		
		return cityModel;
	}
	
	return null;
}
 
开发者ID:citygml4j,项目名称:citygml4j,代码行数:29,代码来源:CityJSONReader.java


注:本文中的org.citygml4j.model.citygml.core.CityModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。