本文整理汇总了Java中com.esri.core.geometry.Envelope类的典型用法代码示例。如果您正苦于以下问题:Java Envelope类的具体用法?Java Envelope怎么用?Java Envelope使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Envelope类属于com.esri.core.geometry包,在下文中一共展示了Envelope类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initLayer
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
protected void initLayer() {
if (getID() == 0L) {
nativeHandle = create();
changeStatus(com.esri.android.map.event.OnStatusChangedListener.STATUS
.fromInt(-1000));
} else {
this.setDefaultSpatialReference(SpatialReference.create(layerInfo
.getSrid()));
this.setFullExtent(new Envelope(layerInfo.getxMin(), layerInfo
.getyMin(), layerInfo.getxMax(), layerInfo.getyMax()));
this.setTileInfo(new TileInfo(layerInfo.getOrigin(), layerInfo
.getScales(), layerInfo.getResolutions(), layerInfo
.getScales().length, layerInfo.getDpi(), layerInfo
.getTileWidth(), layerInfo.getTileHeight()));
super.initLayer();
}
}
开发者ID:wshunli,项目名称:arcgis-android-tianditu,代码行数:18,代码来源:TianDiTuLayer.java
示例2: insertWebmap
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public long insertWebmap(String itemId, long userId, byte[] thumbnail, String title, Envelope initExtent) {
ContentValues values = new ContentValues();
values.put("item_id", itemId);
values.put("user_id", userId);
values.put("thumbnail", thumbnail);
values.put("title", title);
if (null != initExtent) {
values.put("init_extent_min_x", initExtent.getXMin());
values.put("init_extent_min_y", initExtent.getYMin());
values.put("init_extent_max_x", initExtent.getXMax());
values.put("init_extent_max_y", initExtent.getYMax());
}
SQLiteDatabase db = getWritableDatabase();
try {
long rowid = db.insert("webmap", null, values);
fireOnChangeRows();
return rowid;
} catch (Throwable t) {
Log.d(TAG, "Couldn't insert (maybe it already exists): " + t.getMessage());
return -1;
}
}
开发者ID:garys-esri,项目名称:offline-mapper-android,代码行数:23,代码来源:DatabaseHelper.java
示例3: getWebmap
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public DbWebmap getWebmap(long webmapId) {
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.query("webmap", new String[] {
"item_id",
"user_id",
"thumbnail",
"title",
"init_extent_min_x",
"init_extent_min_y",
"init_extent_max_x",
"init_extent_max_y"
}, "rowid = ?", new String[] { Long.toString(webmapId) }, null, null, null);
if (cursor.moveToFirst()) {
DbWebmap webmap = new DbWebmap();
webmap.setRowId(webmapId);
webmap.setItemId(cursor.getString(0));
webmap.setUserId(cursor.getLong(1));
webmap.setThumbnail(cursor.getBlob(2));
webmap.setTitle(cursor.getString(3));
webmap.setInitExtent(new Envelope(cursor.getDouble(4), cursor.getDouble(5), cursor.getDouble(6), cursor.getDouble(7)));
return webmap;
} else {
return null;
}
}
开发者ID:garys-esri,项目名称:offline-mapper-android,代码行数:26,代码来源:DatabaseHelper.java
示例4: loadTile
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public byte[] loadTile() {
ImageServiceParameters ops = new ImageServiceParameters();
ops.setFormat(ImageServiceParameters.IMAGE_FORMAT.JPG);
HelpfulArcGISImageServiceLayer imageServiceLayer = new HelpfulArcGISImageServiceLayer(
"http://sampleserver6.arcgisonline.com/arcgis/rest/services/Toronto/ImageServer",
ops);
try {
byte[] image = imageServiceLayer.getImage(IMAGE_SIDE, IMAGE_SIDE, new Envelope(mapCenter, 15000, 15000));
return image;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
开发者ID:skylight1,项目名称:VR-Map-Explorer,代码行数:17,代码来源:MainActivity.java
示例5: type
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
/** Returns the OGC type of a geometry. */
private static Type type(Geometry g) {
switch (g.getType()) {
case Point:
return Type.POINT;
case Polyline:
return Type.LINESTRING;
case Polygon:
return Type.POLYGON;
case MultiPoint:
return Type.MULTIPOINT;
case Envelope:
return Type.POLYGON;
case Line:
return Type.LINESTRING;
case Unknown:
return Type.Geometry;
default:
throw new AssertionError(g);
}
}
开发者ID:apache,项目名称:calcite,代码行数:22,代码来源:GeoFunctions.java
示例6: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public DoubleWritable evaluate(BytesWritable geomref) {
if (geomref == null || geomref.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
if (ogcGeometry == null) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
Envelope envBound = new Envelope();
ogcGeometry.getEsriGeometry().queryEnvelope(envBound);
resultDouble.set(envBound.getYMin());
return resultDouble;
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:18,代码来源:ST_MinY.java
示例7: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public DoubleWritable evaluate(BytesWritable geomref) {
if (geomref == null || geomref.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
if (ogcGeometry == null) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
Envelope envBound = new Envelope();
ogcGeometry.getEsriGeometry().queryEnvelope(envBound);
resultDouble.set(envBound.getXMax());
return resultDouble;
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:18,代码来源:ST_MaxX.java
示例8: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public BytesWritable evaluate(BytesWritable geometryref)
{
if (geometryref == null || geometryref.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geometryref);
if (ogcGeometry == null){
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
int wkid = GeometryUtils.getWKID(geometryref);
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
Envelope envBound = new Envelope();
ogcGeometry.getEsriGeometry().queryEnvelope(envBound);
return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(envBound,
spatialReference));
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:24,代码来源:ST_Envelope.java
示例9: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public DoubleWritable evaluate(BytesWritable geomref) {
if (geomref == null || geomref.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
if (ogcGeometry == null) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
Envelope envBound = new Envelope();
ogcGeometry.getEsriGeometry().queryEnvelope(envBound);
resultDouble.set(envBound.getXMin());
return resultDouble;
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:18,代码来源:ST_MinX.java
示例10: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public DoubleWritable evaluate(BytesWritable geomref) {
if (geomref == null || geomref.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
if (ogcGeometry == null) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
Envelope envBound = new Envelope();
ogcGeometry.getEsriGeometry().queryEnvelope(envBound);
resultDouble.set(envBound.getYMax());
return resultDouble;
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:18,代码来源:ST_MaxY.java
示例11: getBoundingRectangle
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
private Envelope getBoundingRectangle(Cluster<ClusterableLocation> cluster) {
double xmin = cluster.getPoints().get(0).getPoint()[0];
double xmax = xmin;
double ymin = cluster.getPoints().get(0).getPoint()[1];
double ymax = ymin;
for (ClusterableLocation p : cluster.getPoints()) {
if (p.getPoint()[0] < xmin) {
xmin = p.getPoint()[0];
}
if (p.getPoint()[0] > xmax) {
xmax = p.getPoint()[0];
}
if (p.getPoint()[1] < ymin) {
ymin = p.getPoint()[1];
}
if (p.getPoint()[1] > ymax) {
ymax = p.getPoint()[1];
}
}
Envelope boundingRectangle = new Envelope(xmin, ymin, xmax, ymax);
return boundingRectangle;
}
开发者ID:Esri,项目名称:arcgis-runtime-demo-java,代码行数:23,代码来源:ClusterLayer.java
示例12: addSimpleMarkerGraphics
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
/**
* Adds graphics symbolized with SimpleMarkerSymbols.
* @param graphicsLayer
*/
private void addSimpleMarkerGraphics(GraphicsLayer graphicsLayer, Envelope bounds) {
SimpleMarkerSymbol symbol = new SimpleMarkerSymbol(Color.RED, 16, Style.CIRCLE);
double xmin = bounds.getXMin();
double xmax = bounds.getXMax();
double xrand;
double ymin = bounds.getYMin();
double ymax = bounds.getYMax();
double yrand;
for (int i = 0; i < 1000; i++) {
xrand = xmin + (int) (Math.random() * ((xmax - xmin) + 1));
yrand = ymin + (int) (Math.random() * ((ymax - ymin) + 1));
Point point = new Point(xrand, yrand);
graphicsLayer.addGraphic(new Graphic(point, symbol));
}
}
开发者ID:Esri,项目名称:arcgis-runtime-demo-java,代码行数:21,代码来源:ClusterApp.java
示例13: onLocationChanged
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
@Override
public void onLocationChanged(Location location) {
if (!locationChanged) {
// For first fix location, convert to map spatial reference.
Point currentPt = new Point(location.getLongitude(), location.getLatitude());
Point currentMapPt = (Point) GeometryEngine.project(currentPt,
SpatialReference.create(4326), mMapView.getSpatialReference());
// Use a suitable accuracy value for the typical app usage, if no accuracy
// value is available.
float accuracy = 100;
if (location.hasAccuracy()) {
accuracy = location.getAccuracy();
}
// Convert the accuracy to units of the map, and apply a suitable zoom
// factor for the app.
Unit mapUnits = mMapView.getSpatialReference().getUnit();
double zoomToWidth = 500 * Unit.convertUnits(accuracy,
Unit.create(LinearUnit.Code.METER), mapUnits);
Envelope zoomExtent = new Envelope(currentMapPt, zoomToWidth, zoomToWidth);
// Make sure that the initial zoom is done WITHOUT animation, or it may
// interfere with autopan.
mMapView.setExtent(zoomExtent, 0, false);
// Dont run this again.
locationChanged = true;
// Now start the navigation mode.
mLocDispMgr.setAutoPanMode(LocationDisplayManager.AutoPanMode.NAVIGATION);
}
}
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:34,代码来源:CurrentLocationActivity.java
示例14: loadRasterAsBasemap
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public void loadRasterAsBasemap() {
if (mMapView == null) {
return;
}
try {
mMapView.removeAll();
// Create a RasterSource from a local raster file
FileRasterSource rasterSource = new FileRasterSource(mPathLayer);
// Create a raster layer from the RasterSource
mRasterLayer = new RasterLayer(rasterSource);
// allow to zoom in after the largest LOD for the Landsat 8 image
mRasterLayer.setMaxScale(200000);
// Add the raster layer to the map view
mMapView.addLayer(mRasterLayer);
// Set RGBRenderer
applyRGBRenderer(true);
// Set the extent
Envelope initialExtent = new Envelope(-157.4368965374797, 20.516069728186316, -155.81463794462434, 21.298471528698848);
mMapView.setExtent(initialExtent);
// Add a graphics layer
mGraphicsLayer = new GraphicsLayer();
mMapView.addLayer(mGraphicsLayer);
} catch (FileNotFoundException | RuntimeException e) {
e.printStackTrace();
}
}
开发者ID:Esri,项目名称:arcgis-runtime-demos-android,代码行数:32,代码来源:RasterAnalysisHelper.java
示例15: setUp
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
m_testUtil.startMiniCluster();
m_columnlist = ColumnParser.newInstance().parseColumn("geom:qual:%.1f");
createTable();
m_searchQuadTree = new SearchQuadTree();
m_testUtil.getConfiguration().set(GeoEnrichmentJob.KEY_TABLE, new String(TAB));
m_testUtil.getConfiguration().setEnum(SearchQuadTree.KEY_GEOMETRY_TYPE, Geometry.Type.Envelope);
m_searchQuadTree.setup(m_testUtil.getConfiguration(), m_columnlist);
}
开发者ID:mraad,项目名称:GeoEnrichment,代码行数:12,代码来源:SearchQuadTreeTest.java
示例16: createTable
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
private void createTable() throws IOException
{
final HTable table = m_testUtil.createTable(TAB, SearchQuadTree.GEOM);
try
{
putInTable(table, 0, new Envelope(0, 0, 10, 10), 10);
putInTable(table, 1, new Envelope(-10, -10, 0, 0), -10);
}
finally
{
table.close();
}
}
开发者ID:mraad,项目名称:GeoEnrichment,代码行数:14,代码来源:SearchQuadTreeTest.java
示例17: testGeomEngine
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
@Test
public void testGeomEngine()
{
final Envelope orig = new Envelope(0, 0, 10, 10);
final byte[] bytes = GeometryEngine.geometryToEsriShape(orig);
Assert.assertNotNull(bytes);
final Geometry geometry = GeometryEngine.geometryFromEsriShape(bytes, Geometry.Type.Envelope);
Assert.assertNotNull(geometry);
Assert.assertTrue(geometry instanceof Envelope);
final Envelope dest = (Envelope) geometry;
Assert.assertEquals(0, dest.getXMin(), 0.001);
Assert.assertEquals(0, dest.getYMin(), 0.001);
Assert.assertEquals(10, dest.getXMax(), 0.001);
Assert.assertEquals(10, dest.getYMax(), 0.001);
}
开发者ID:mraad,项目名称:GeoEnrichment,代码行数:16,代码来源:GeomEngineTest.java
示例18: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
@Override
public Object evaluate(DeferredObject[] args) throws HiveException {
double binSize = PrimitiveObjectInspectorUtils.getDouble(args[0].get(), oiBinSize);
if (!binSizeIsConstant || bins == null) {
bins = new BinUtils(binSize);
}
Envelope env = new Envelope();
if (oiBinId != null) {
// argument 1 is a number, attempt to get the envelope with bin ID
if (args[1].get() == null) {
// null bin ID argument usually means the source point was null or failed to parse
return null;
}
long binId = PrimitiveObjectInspectorUtils.getLong(args[1].get(), oiBinId);
bins.queryEnvelope(binId, env);
} else {
// argument 1 is a geometry, attempt to get the envelope with a point
OGCPoint point = binPoint.getPoint(args);
if (point == null) {
return null;
}
bins.queryEnvelope(point.X(), point.Y(), env);
}
return GeometryUtils.geometryToEsriShapeBytesWritable(env, 0, OGCType.ST_POLYGON);
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:34,代码来源:ST_BinEnvelope.java
示例19: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public BytesWritable evaluate(BytesWritable geomref) {
if (geomref == null || geomref.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
OGCGeometry ogcGeometry = GeometryUtils.geometryFromEsriShape(geomref);
if (ogcGeometry == null){
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
GeometryUtils.OGCType ogcType = GeometryUtils.getType(geomref);
switch(ogcType) {
case ST_MULTIPOLYGON:
case ST_POLYGON:
int wkid = GeometryUtils.getWKID(geomref);
SpatialReference spatialReference = null;
if (wkid != GeometryUtils.WKID_UNKNOWN) {
spatialReference = SpatialReference.create(wkid);
}
Envelope envBound = new Envelope();
ogcGeometry.getEsriGeometry().queryEnvelope(envBound);
Point centroid = new Point((envBound.getXMin() + envBound.getXMax()) / 2.,
(envBound.getYMin() + envBound.getYMax()) / 2.);
return GeometryUtils.geometryToEsriShapeBytesWritable(OGCGeometry.createFromEsriGeometry(centroid,
spatialReference));
default:
LogUtils.Log_InvalidType(LOG, GeometryUtils.OGCType.ST_POLYGON, ogcType);
return null;
}
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:33,代码来源:ST_Centroid.java
示例20: evaluate
import com.esri.core.geometry.Envelope; //导入依赖的package包/类
public BooleanWritable evaluate(BytesWritable geometryref1, BytesWritable geometryref2)
{
if (geometryref1 == null || geometryref2 == null ||
geometryref1.getLength() == 0 || geometryref2.getLength() == 0) {
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
if (!GeometryUtils.compareSpatialReferences(geometryref1, geometryref2)) {
LogUtils.Log_SRIDMismatch(LOG, geometryref1, geometryref2);
return null;
}
OGCGeometry ogcGeom1 = GeometryUtils.geometryFromEsriShape(geometryref1);
OGCGeometry ogcGeom2 = GeometryUtils.geometryFromEsriShape(geometryref2);
if (ogcGeom1 == null || ogcGeom2 == null){
LogUtils.Log_ArgumentsNull(LOG);
return null;
}
Geometry geometry1 = ogcGeom1.getEsriGeometry();
Geometry geometry2 = ogcGeom2.getEsriGeometry();
Envelope env1 = new Envelope(), env2 = new Envelope();
geometry1.queryEnvelope(env1);
geometry2.queryEnvelope(env2);
resultBoolean.set(env1.isIntersecting(env2));
return resultBoolean;
}
开发者ID:Esri,项目名称:spatial-framework-for-hadoop,代码行数:29,代码来源:ST_EnvIntersects.java
注:本文中的com.esri.core.geometry.Envelope类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论