當前位置: 首頁>>代碼示例>>Java>>正文


Java Envelope類代碼示例

本文整理匯總了Java中net.opengis.gml.v32.Envelope的典型用法代碼示例。如果您正苦於以下問題:Java Envelope類的具體用法?Java Envelope怎麽用?Java Envelope使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Envelope類屬於net.opengis.gml.v32包,在下文中一共展示了Envelope類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: readFromXmlStream

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
protected Object readFromXmlStream(XMLStreamReader reader, Enum<?> eltType) throws XMLStreamException
{
    reader.nextTag();
    GMLStaxBindings gmlBindings = (GMLStaxBindings)staxBindings;
    
    switch ((ObjectType)eltType)
    {
        case Envelope:
            return gmlBindings.readEnvelope(reader);
            
        case Geometry:
            return gmlBindings.readAbstractGeometry(reader);
            
        case TimePrimitive:
            return gmlBindings.readAbstractTimeGeometricPrimitive(reader);
                            
        case Feature:
            return gmlBindings.readAbstractFeature(reader);
    }
    
    return null;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:24,代碼來源:GMLUtils.java

示例2: writeToXmlStream

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
protected void writeToXmlStream(XMLStreamWriter writer, Object gmlObj, Enum<?> eltType) throws XMLStreamException
{
    GMLStaxBindings gmlBindings = (GMLStaxBindings)staxBindings;
    
    switch ((ObjectType)eltType)
    {
        case Envelope:
            gmlBindings.writeEnvelope(writer, (Envelope)gmlObj);
            return;
            
        case Geometry:
            gmlBindings.writeAbstractGeometry(writer, (AbstractGeometry)gmlObj);
            return;
            
        case TimePrimitive:
            gmlBindings.writeAbstractTimeGeometricPrimitive(writer, (AbstractTimeGeometricPrimitive)gmlObj);
            return;
            
        case Feature:
            gmlBindings.writeAbstractFeature(writer, (AbstractFeature)gmlObj);
            return;
    }
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:25,代碼來源:GMLUtils.java

示例3: envelopeToBbox

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
/**
 * Utility method to convert from a GML {@link Envelope} to a {@link Bbox} object
 * @param env GML envelope
 * @return Bbox instance
 */
public static Bbox envelopeToBbox(Envelope env)
{
    Bbox bbox = new Bbox();
    bbox.setCrs(env.getSrsName());
    
    double[] lowerCorner = env.getLowerCorner();
    bbox.setMinX(lowerCorner[0]);
    bbox.setMinY(lowerCorner[1]);
    if (lowerCorner.length > 2)
        bbox.setMinZ(lowerCorner[2]);
    
    double[] upperCorner = env.getUpperCorner();
    bbox.setMaxX(upperCorner[0]);
    bbox.setMaxY(upperCorner[1]);
    if (upperCorner.length > 2)
        bbox.setMaxZ(upperCorner[2]);
    
    return bbox;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:25,代碼來源:GMLUtils.java

示例4: readEnvelopeTypeAttributes

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
/**
 * Reads attributes of EnvelopeType complex type
 */
public void readEnvelopeTypeAttributes(Map<String, String> attrMap, Envelope bean) throws XMLStreamException
{
    String val;
    
    // srsname
    val = attrMap.get("srsName");
    if (val != null)
        bean.setSrsName(val);
    
    // srsdimension
    val = attrMap.get("srsDimension");
    if (val != null)
        bean.setSrsDimension(getIntFromString(val));
    
    // axislabels
    val = attrMap.get("axisLabels");
    if (val != null)
        bean.setAxisLabels(getStringArrayFromString(val));
    
    // uomlabels
    val = attrMap.get("uomLabels");
    if (val != null)
        bean.setUomLabels(getStringArrayFromString(val));
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:28,代碼來源:XMLStreamBindings.java

示例5: writeEnvelopeTypeAttributes

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
/**
 * Writes attributes of EnvelopeType complex type
 */
public void writeEnvelopeTypeAttributes(XMLStreamWriter writer, Envelope bean) throws XMLStreamException
{
    
    // srsName
    if (bean.isSetSrsName())
        writer.writeAttribute("srsName", getStringValue(bean.getSrsName()));
    
    // srsDimension
    if (bean.isSetSrsDimension())
        writer.writeAttribute("srsDimension", getStringValue(bean.getSrsDimension()));
    
    // axisLabels
    if (bean.isSetAxisLabels())
        writer.writeAttribute("axisLabels", getStringValue(bean.getAxisLabels()));
    
    // uomLabels
    if (bean.isSetUomLabels())
        writer.writeAttribute("uomLabels", getStringValue(bean.getUomLabels()));
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:23,代碼來源:XMLStreamBindings.java

示例6: writeEnvelopeTypeElements

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
/**
 * Writes elements of EnvelopeType complex type
 */
public void writeEnvelopeTypeElements(XMLStreamWriter writer, Envelope bean) throws XMLStreamException
{
    
    // lowerCorner
    if (bean.isSetLowerCorner())
    {
        writer.writeStartElement(NS_URI, "lowerCorner");
        writer.writeCharacters(getStringValue(bean.getLowerCorner()));
        writer.writeEndElement();
    }
    
    // upperCorner
    if (bean.isSetUpperCorner())
    {
        writer.writeStartElement(NS_URI, "upperCorner");
        writer.writeCharacters(getStringValue(bean.getUpperCorner()));
        writer.writeEndElement();
    }
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:23,代碼來源:XMLStreamBindings.java

示例7: testComputeGeomEnvelopes

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
public void testComputeGeomEnvelopes() throws Exception
{
    Envelope env;
    
    env = readGeometryAndGetEnvelope("examples_v32/Point2D.xml");        
    testEnvelope(env, 2, new double[] {1,2}, new double[] {1,2});
    
    env = readGeometryAndGetEnvelope("examples_v32/Point3D.xml");        
    testEnvelope(env, 3, new double[] {1,2,3}, new double[] {1,2,3});
    
    env = readGeometryAndGetEnvelope("examples_v32/Line2D.xml");        
    testEnvelope(env, 2, new double[] {1,2}, new double[] {5,6});
    
    env = readGeometryAndGetEnvelope("examples_v32/Line3D.xml");        
    testEnvelope(env, 3, new double[] {1,2,3}, new double[] {7,8,9});
    
    env = readGeometryAndGetEnvelope("examples_v32/Polygon_noInterior.xml");        
    testEnvelope(env, 2, new double[] {0,0}, new double[] {1,1});
    
    env = readGeometryAndGetEnvelope("examples_v32/Polygon_withInteriors.xml");        
    testEnvelope(env, 2, new double[] {0,0}, new double[] {1,1});
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:23,代碼來源:TestGMLBindingsV32.java

示例8: writeExpression

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
public void writeExpression(XMLStreamWriter writer, Expression bean) throws XMLStreamException
{
    if (bean instanceof ValueReference)
        writeValueReference(writer, (ValueReference)bean);
    else if (bean instanceof Literal)
        writeLiteral(writer, (Literal)bean);
    
    // case of GML object
    else if (bean instanceof GMLExpression)
    {
        Object gmlObj = ((GMLExpression)bean).getGmlObject();
        if (gmlObj instanceof AbstractTimeGeometricPrimitive)
            gmlBindings.writeAbstractTimeGeometricPrimitive(writer, (AbstractTimeGeometricPrimitive)gmlObj);
        else if (gmlObj instanceof AbstractGeometry)
            gmlBindings.writeAbstractGeometry(writer, (AbstractGeometry)gmlObj);
        else if (gmlObj instanceof Envelope)
            gmlBindings.writeEnvelope(writer, (Envelope)gmlObj);
        else
            throw new XMLStreamException(ERROR_UNSUPPORTED_TYPE + gmlObj.getClass().getCanonicalName()); 
    }
    
    else
        throw new XMLStreamException(ERROR_UNSUPPORTED_TYPE + bean.getClass().getCanonicalName());        
}
 
開發者ID:sensiasoft,項目名稱:lib-ows,代碼行數:25,代碼來源:XMLStreamBindings.java

示例9: getGeomEnvelope

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
public Envelope getGeomEnvelope()
{
    if (envelope == null)
        envelope = addCoordinatesToEnvelope(envelope, pos, srsDimension);
        
    return envelope;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:9,代碼來源:PointImpl.java

示例10: getGeomEnvelope

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
public Envelope getGeomEnvelope()
{
    if (geom.envelope == null)
    {
        int nDims = geom.srsDimension;
        geom.envelope = AbstractGeometryImpl.addCoordinatesToEnvelope(geom.envelope, exterior.getPosList(), nDims);
        for (LinearRing interior: interiorList)
            AbstractGeometryImpl.addCoordinatesToEnvelope(geom.envelope, interior.getPosList(), nDims);
    }
    
    return geom.envelope;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:14,代碼來源:PolygonJTS.java

示例11: getGeomEnvelope

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
public Envelope getGeomEnvelope()
{
    if (envelope == null)
        envelope = addCoordinatesToEnvelope(envelope, posList, srsDimension);
        
    return envelope;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:9,代碼來源:LineStringImpl.java

示例12: getGeomEnvelope

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
public Envelope getGeomEnvelope()
{
    if (envelope == null)
    {
        envelope = addCoordinatesToEnvelope(envelope, exterior.getPosList(), srsDimension);
        for (LinearRing interior: interiorList)
            addCoordinatesToEnvelope(envelope, interior.getPosList(), srsDimension);
    }
    
    return envelope;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:13,代碼來源:PolygonImpl.java

示例13: newEnvelope

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
public Envelope newEnvelope(String crs, double minX, double minY, double maxX, double maxY)
{
    Envelope env = newEnvelope();
    env.setSrsName(crs);
    env.setLowerCorner(new double[] {minX, minY});
    env.setUpperCorner(new double[] {maxX, maxY});
    return env;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:9,代碼來源:GMLFactory.java

示例14: getGeomEnvelope

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
public Envelope getGeomEnvelope()
{
    if (geom.envelope == null)
        geom.envelope = AbstractGeometryImpl.addCoordinatesToEnvelope(geom.envelope, pos, geom.srsDimension);
        
    return geom.envelope;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:9,代碼來源:PointJTS.java

示例15: getGeomEnvelope

import net.opengis.gml.v32.Envelope; //導入依賴的package包/類
@Override
public Envelope getGeomEnvelope()
{
    if (geom.envelope == null)
        geom.envelope = AbstractGeometryImpl.addCoordinatesToEnvelope(geom.envelope, posList, geom.srsDimension);
        
    return geom.envelope;
}
 
開發者ID:sensiasoft,項目名稱:lib-swe-common,代碼行數:9,代碼來源:LineStringJTS.java


注:本文中的net.opengis.gml.v32.Envelope類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。