本文整理汇总了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;
}
示例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;
}
}
示例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;
}
示例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));
}
示例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()));
}
示例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();
}
}
示例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});
}
示例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());
}
示例9: getGeomEnvelope
import net.opengis.gml.v32.Envelope; //导入依赖的package包/类
@Override
public Envelope getGeomEnvelope()
{
if (envelope == null)
envelope = addCoordinatesToEnvelope(envelope, pos, srsDimension);
return envelope;
}
示例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;
}
示例11: getGeomEnvelope
import net.opengis.gml.v32.Envelope; //导入依赖的package包/类
@Override
public Envelope getGeomEnvelope()
{
if (envelope == null)
envelope = addCoordinatesToEnvelope(envelope, posList, srsDimension);
return envelope;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}