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


Java Polygon类代码示例

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


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

示例1: writePolygonTypeElements

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Writes elements of PolygonType complex type
 */
public void writePolygonTypeElements(XMLStreamWriter writer, Polygon bean) throws XMLStreamException
{
    this.writeAbstractGeometryTypeElements(writer, bean);
    int numItems;
    
    // exterior
    if (bean.isSetExterior())
    {
        writer.writeStartElement(NS_URI, "exterior");
        this.writeLinearRing(writer, bean.getExterior());
        writer.writeEndElement();
    }
    
    // interior
    numItems = bean.getInteriorList().size();
    for (int i = 0; i < numItems; i++)
    {
        LinearRing item = bean.getInteriorList().get(i);
        writer.writeStartElement(NS_URI, "interior");
        this.writeLinearRing(writer, item);
        writer.writeEndElement();
    }
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:27,代码来源:XMLStreamBindings.java

示例2: writeAbstractSurface

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Dispatcher method for writing classes derived from AbstractSurface
 */
public void writeAbstractSurface(XMLStreamWriter writer, AbstractSurface bean) throws XMLStreamException
{
    /*if (bean instanceof CompositeSurface)
        writeCompositeSurface(writer, (CompositeSurface)bean);
    else if (bean instanceof Surface)
        writeSurface(writer, (Surface)bean);
    else if (bean instanceof OrientableSurface)
        writeOrientableSurface(writer, (OrientableSurface)bean);
    else if (bean instanceof Surface)
        writeSurface(writer, (Surface)bean);
    else if (bean instanceof Surface)
        writeSurface(writer, (Surface)bean);
    else if (bean instanceof Tin)
        writeTin(writer, (Tin)bean);*/
    if (bean instanceof Polygon)
        writePolygon(writer, (Polygon)bean);
    else
        throw new XMLStreamException(ERROR_UNSUPPORTED_TYPE + bean.getClass().getCanonicalName());
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:23,代码来源:XMLStreamBindings.java

示例3: getAsSpecializedType

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
public SamplingFeature<? extends AbstractGeometry> getAsSpecializedType()
{
    String type = properties.containsKey(PROP_TYPE) ? ((CachedReference<Object>)getProperty(PROP_TYPE)).getHref() : null;
    SamplingFeature<? extends AbstractGeometry> sf = null;
    
    if (SamplingPoint.TYPE.equals(type))
    {
        sf = new SamplingPoint();
        ((SamplingPoint)sf).setShape((Point)getShape());
    }
    else if (SamplingSurface.TYPE.equals(type))
    {
        sf = new SamplingSurface();
        ((SamplingSurface)sf).setShape((Polygon)getShape());
    }
    else if (SamplingCurve.TYPE.equals(type))
    {
        sf = new SamplingCurve();
        ((SamplingCurve)sf).setShape((LineString)getShape());
    }
    else
        throw new UnsupportedOperationException("Unsupported sampling feature type " + type);
    
    sf.setId(getId());
    sf.setIdentifier(getIdentifier());
    sf.setDescription(getDescription());
    sf.setBoundedByAsEnvelope(getBoundedBy());
    sf.setLocation(getLocation());
    sf.setSampledFeatureUID(getSampledFeatureUID());
    sf.setHostedProcedureUID(getHostedProcedureUID());
    
    return sf;
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:34,代码来源:SamplingFeature.java

示例4: newPolygon

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
@Override
public final Polygon newPolygon()
{
    Polygon poly;
    
    if (useJTS)
        poly = new PolygonJTS(jtsFactory, 2);
    else
        poly = new PolygonImpl(2);
    
    return poly;
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:13,代码来源:GMLFactory.java

示例5: readPolygonType

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Read method for PolygonType complex type
 */
public Polygon readPolygonType(XMLStreamReader reader) throws XMLStreamException
{
    Polygon bean = factory.newPolygon();
    
    Map<String, String> attrMap = collectAttributes(reader);
    this.readPolygonTypeAttributes(attrMap, bean);
    
    reader.nextTag();
    this.readPolygonTypeElements(reader, bean);
    
    return bean;
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:16,代码来源:XMLStreamBindings.java

示例6: readPolygonTypeElements

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Reads elements of PolygonType complex type
 */
public void readPolygonTypeElements(XMLStreamReader reader, Polygon bean) throws XMLStreamException
{
    this.readAbstractGeometryTypeElements(reader, bean);
    
    boolean found;
    
    // exterior
    found = checkElementName(reader, "exterior");
    if (found)
    {
        reader.nextTag();
        LinearRing exterior = this.readLinearRing(reader);
        if (exterior != null)
            bean.setExterior(exterior);
        
        reader.nextTag(); // end property tag
        reader.nextTag();
    }
    
    // interior
    do
    {
        found = checkElementName(reader, "interior");
        if (found)
        {
            reader.nextTag();
            LinearRing interior = this.readLinearRing(reader);
            if (interior != null)
                bean.addInterior(interior);
            
            reader.nextTag(); // end property tag
            reader.nextTag();
        }
    }
    while (found);
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:40,代码来源:XMLStreamBindings.java

示例7: readPolygon

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Read method for Polygon elements
 */
public Polygon readPolygon(XMLStreamReader reader) throws XMLStreamException
{
    boolean found = checkElementName(reader, "Polygon");
    if (!found)
        throw new XMLStreamException(ERROR_INVALID_ELT + reader.getName() + errorLocationString(reader));
    
    return this.readPolygonType(reader);
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:12,代码来源:XMLStreamBindings.java

示例8: writePolygon

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Write method for Polygon element
 */
public void writePolygon(XMLStreamWriter writer, Polygon bean) throws XMLStreamException
{
    writer.writeStartElement(NS_URI, "Polygon");
    this.writeNamespaces(writer);
    this.writePolygonType(writer, bean);
    writer.writeEndElement();
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:11,代码来源:XMLStreamBindings.java

示例9: readPolygonTypeAttributes

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Reads attributes of PolygonType complex type
 */
public void readPolygonTypeAttributes(Map<String, String> attrMap, Polygon bean) throws XMLStreamException
{
    this.readAbstractGeometryTypeAttributes(attrMap, bean);
    
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:9,代码来源:XMLStreamBindings.java

示例10: writePolygonType

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Write method for PolygonType complex type
 */
public void writePolygonType(XMLStreamWriter writer, Polygon bean) throws XMLStreamException
{
    this.writePolygonTypeAttributes(writer, bean);
    this.writePolygonTypeElements(writer, bean);
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:9,代码来源:XMLStreamBindings.java

示例11: writePolygonTypeAttributes

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Writes attributes of PolygonType complex type
 */
public void writePolygonTypeAttributes(XMLStreamWriter writer, Polygon bean) throws XMLStreamException
{
    this.writeAbstractGeometryTypeAttributes(writer, bean);
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:8,代码来源:XMLStreamBindings.java

示例12: writeAbstractGeometry

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
/**
 * Dispatcher method for writing classes derived from AbstractGeometry
 */
public void writeAbstractGeometry(XMLStreamWriter writer, AbstractGeometry bean) throws XMLStreamException
{
    /*if (bean instanceof GeometricComplex)
        writeGeometricComplex(writer, (GeometricComplex)bean);
    else if (bean instanceof CompositeCurve)
        writeCompositeCurve(writer, (CompositeCurve)bean);
    else if (bean instanceof CompositeSurface)
        writeCompositeSurface(writer, (CompositeSurface)bean);
    else if (bean instanceof CompositeSolid)
        writeCompositeSolid(writer, (CompositeSolid)bean);
    else if (bean instanceof Grid)
        writeGrid(writer, (Grid)bean);
    else if (bean instanceof RectifiedGrid)
        writeRectifiedGrid(writer, (RectifiedGrid)bean);
    else if (bean instanceof MultiGeometry)
        writeMultiGeometry(writer, (MultiGeometry)bean);
    else if (bean instanceof MultiPoint)
        writeMultiPoint(writer, (MultiPoint)bean);
    else if (bean instanceof MultiCurve)
        writeMultiCurve(writer, (MultiCurve)bean);
    else if (bean instanceof MultiSurface)
        writeMultiSurface(writer, (MultiSurface)bean);
    else if (bean instanceof MultiSolid)
        writeMultiSolid(writer, (MultiSolid)bean);
    else if (bean instanceof Curve)
        writeCurve(writer, (Curve)bean);
    else if (bean instanceof OrientableCurve)
        writeOrientableCurve(writer, (OrientableCurve)bean);
    else if (bean instanceof Surface)
        writeSurface(writer, (Surface)bean);
    else if (bean instanceof OrientableSurface)
        writeOrientableSurface(writer, (OrientableSurface)bean);
    else if (bean instanceof Surface)
        writeSurface(writer, (Surface)bean);
    else if (bean instanceof Surface)
        writeSurface(writer, (Surface)bean);
    else if (bean instanceof Tin)
        writeTin(writer, (Tin)bean);
    else if (bean instanceof Solid)
        writeSolid(writer, (Solid)bean);*/
    if (bean instanceof Point)
        writePoint(writer, (Point)bean);
    else if (bean instanceof LineString)
        writeLineString(writer, (LineString)bean);
    else if (bean instanceof Polygon)
        writePolygon(writer, (Polygon)bean);
    else
        throw new XMLStreamException(ERROR_UNSUPPORTED_TYPE + bean.getClass().getCanonicalName());
}
 
开发者ID:sensiasoft,项目名称:lib-swe-common,代码行数:53,代码来源:XMLStreamBindings.java

示例13: writeContents

import net.opengis.gml.v32.Polygon; //导入依赖的package包/类
@Override
protected void writeContents(DOMHelper dom, Element capsElt, OWSServiceCapabilities serviceCaps, String version) throws OWSException
{
    try
       {
           Element contentsElt = dom.addElement(capsElt, "sps:contents/sps:SPSContents");
           SPSServiceCapabilities spsCaps = (SPSServiceCapabilities)serviceCaps;
           
           // SWES properties common to all offerings
           super.writeCommonContentsProperties(dom, contentsElt, serviceCaps);

           // SPS offerings
           for (OWSLayerCapabilities layerCaps: serviceCaps.getLayers())
           {
               // skip disabled offerings
               if (!layerCaps.isEnabled())
                   continue;
               
               Element offeringElt = dom.addElement(contentsElt, "+swes:offering/sps:SensorOffering");
               SPSOfferingCapabilities offering = (SPSOfferingCapabilities)layerCaps;
               
               // SWES offering properties
               super.writeCommonOfferingProperties(dom, offeringElt, serviceCaps, offering);
               
               // observable area
               AbstractGeometry obsArea = offering.getObservableArea();
               if (obsArea != null)
               {
                   Element geomElt = gmlUtils.writeGeometry(dom, obsArea);
                   String path = "sps:observableArea/";
                   if (obsArea instanceof Polygon)
                       path += "sps:byPolygon";
                   else if (obsArea instanceof Point)
                       path += "sps:byPoint";
                   else
                       throw new SPSException("Invalid geometry for observedArea: " + obsArea.getClass().getSimpleName());
                   dom.addElement(offeringElt, path).appendChild(geomElt);
               }
           }
           
           // min status time
           double minStatusTime = spsCaps.getMinStatusTime();
           if (!Double.isNaN(minStatusTime)) 
               dom.setElementValue(contentsElt, "sps:minStatusTime", timeFormat.formatIsoPeriod(minStatusTime, 'D'));
           
           // supported encodings
           for (String encoding: spsCaps.getSupportedEncodings())
               dom.setElementValue(contentsElt, "+sps:supportedEncoding", encoding);
       }
       catch (XMLWriterException e)
       {
           throw new SPSException("Error while writing SPS capabilities", e);
       }
}
 
开发者ID:sensiasoft,项目名称:lib-ows,代码行数:55,代码来源:SPSCapabilitiesWriterV20.java


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