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


Java Field类代码示例

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


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

示例1: createPointTable

import com.esri.arcgisruntime.data.Field; //导入依赖的package包/类
/**
 * Creates a Point Feature Collection Table with one Point and adds it to the Feature collection that was passed.
 * 
 * @param featureCollection that the point Feature Collection Table will be added to
 */
private void createPointTable(FeatureCollection featureCollection) {

  // defines the schema for the geometry's attribute
  List<Field> pointFields = new ArrayList<>();
  pointFields.add(Field.createString("Place", "Place Name", 50));

  // a feature collection table that creates point geometry
  FeatureCollectionTable pointsTable = new FeatureCollectionTable(pointFields, GeometryType.POINT, WGS84);

  // set a default symbol for features in the collection table
  SimpleMarkerSymbol markerSymbol = new SimpleMarkerSymbol(Style.TRIANGLE, 0xFFFF0000, 18);
  SimpleRenderer renderer = new SimpleRenderer(markerSymbol);
  pointsTable.setRenderer(renderer);

  // add feature collection table to feature collection
  featureCollection.getTables().add(pointsTable);

  // create feature using the collection table by passing an attribute and geometry
  Map<String, Object> attributes = new HashMap<>();
  attributes.put(pointFields.get(0).getName(), "Current Location");
  Point point = new Point(-79.497238, 8.849289, WGS84);
  Feature addedFeature = pointsTable.createFeature(attributes, point);

  // add feature to collection table
  pointsTable.addFeatureAsync(addedFeature);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:32,代码来源:FeatureCollectionLayerSample.java

示例2: createPolylineTable

import com.esri.arcgisruntime.data.Field; //导入依赖的package包/类
/**
 * Creates a PolyLine Feature Collection Table with one PolyLine and adds it to the Feature collection that was passed.
 * 
 * @param featureCollection that the polyline Feature Collection Table will be added to
 */
private void createPolylineTable(FeatureCollection featureCollection) {

  // defines the schema for the geometry's attribute
  List<Field> polylineFields = new ArrayList<>();
  polylineFields.add(Field.createString("Boundary", "Boundary Name", 50));

  // a feature collection table that creates polyline geometry
  FeatureCollectionTable polylineTable = new FeatureCollectionTable(polylineFields, GeometryType.POLYLINE, WGS84);

  // set a default symbol for features in the collection table
  SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.DASH, 0xFF00FF00, 3);
  SimpleRenderer renderer = new SimpleRenderer(lineSymbol);
  polylineTable.setRenderer(renderer);

  // add feature collection table to feature collection
  featureCollection.getTables().add(polylineTable);

  // create feature using the collection table by passing an attribute and geometry
  Map<String, Object> attributes = new HashMap<>();
  attributes.put(polylineFields.get(0).getName(), "AManAPlanACanalPanama");
  PolylineBuilder builder = new PolylineBuilder(WGS84);
  builder.addPoint(new Point(-79.497238, 8.849289, WGS84));
  builder.addPoint(new Point(-80.035568, 9.432302, WGS84));
  Feature addedFeature = polylineTable.createFeature(attributes, builder.toGeometry());

  // add feature to collection table
  polylineTable.addFeatureAsync(addedFeature);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:34,代码来源:FeatureCollectionLayerSample.java

示例3: createPolygonTables

import com.esri.arcgisruntime.data.Field; //导入依赖的package包/类
/**
 * Creates a Polygon Feature Collection Table with one Polygon and adds it to the Feature collection that was passed.
 * 
 * @param featureCollection that the polygon Feature Collection Table will be added to
 */
private void createPolygonTables(FeatureCollection featureCollection) {

  // defines the schema for the geometry's attribute
  List<Field> polygonFields = new ArrayList<>();
  polygonFields.add(Field.createString("Area", "Area Name", 50));

  // a feature collection table that creates polygon geometry
  FeatureCollectionTable polygonTable = new FeatureCollectionTable(polygonFields, GeometryType.POLYGON, WGS84);

  // set a default symbol for features in the collection table
  SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, 0xFF0000FF, 2);
  SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.DIAGONAL_CROSS, 0xFF00FFFF, lineSymbol);
  SimpleRenderer renderer = new SimpleRenderer(fillSymbol);
  polygonTable.setRenderer(renderer);

  // add feature collection table to feature collection
  featureCollection.getTables().add(polygonTable);

  // create feature using the collection table by passing an attribute and geometry
  Map<String, Object> attributes = new HashMap<>();
  attributes.put(polygonFields.get(0).getName(), "Restricted area");
  PolygonBuilder builder = new PolygonBuilder(WGS84);
  builder.addPoint(new Point(-79.497238, 8.849289, WGS84));
  builder.addPoint(new Point(-79.337936, 8.638903, WGS84));
  builder.addPoint(new Point(-79.11409, 8.895422, WGS84));
  Feature addedFeature = polygonTable.createFeature(attributes, builder.toGeometry());

  // add feature to collection table
  polygonTable.addFeatureAsync(addedFeature);
}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-java,代码行数:36,代码来源:FeatureCollectionLayerSample.java

示例4: calculateViewshedAt

import com.esri.arcgisruntime.data.Field; //导入依赖的package包/类
/**
 * Uses the given point to create a FeatureCollectionTable which is passed to performGeoprocessing.
 *
 * @param point in MapView coordinates.
 */
private void calculateViewshedAt(Point point) {
  // remove previous graphics
  mResultGraphicsOverlay.getGraphics().clear();

  // cancel any previous job
  if (mGeoprocessingJob != null) {
    mGeoprocessingJob.cancel();
  }

  List<Field> fields = new ArrayList<>(1);
  // create field with same alias as name
  Field field = Field.createString("observer", "", 8);
  fields.add(field);

  // create feature collection table for point geometry
  final FeatureCollectionTable featureCollectionTable = new FeatureCollectionTable(fields, GeometryType.POINT,
      point.getSpatialReference());
  featureCollectionTable.loadAsync();

  // create a new feature and assign the geometry
  Feature newFeature = featureCollectionTable.createFeature();
  newFeature.setGeometry(point);

  // add newFeature and call performGeoprocessing on done loading
  featureCollectionTable.addFeatureAsync(newFeature);
  featureCollectionTable.addDoneLoadingListener(new Runnable() {
    @Override public void run() {
      if (featureCollectionTable.getLoadStatus() == LoadStatus.LOADED) {
        performGeoprocessing(featureCollectionTable);
      }
    }
  });

}
 
开发者ID:Esri,项目名称:arcgis-runtime-samples-android,代码行数:40,代码来源:MainActivity.java


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