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


Java Point.setUserData方法代码示例

本文整理汇总了Java中com.vividsolutions.jts.geom.Point.setUserData方法的典型用法代码示例。如果您正苦于以下问题:Java Point.setUserData方法的具体用法?Java Point.setUserData怎么用?Java Point.setUserData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vividsolutions.jts.geom.Point的用法示例。


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

示例1: GeometryImage

import com.vividsolutions.jts.geom.Point; //导入方法依赖的package包/类
/**
 *
 * @param timeStampStart
 * @param azimuth
 * @param pixels
 * @return
 */
public GeometryImage(String name,String type,String timeStampStart,double azimuth, Boat[] boats) {
	this.type=type;
	this.name=name;
       //GeometricLayer out = new GeometricLayer("point");
       //setName("VDS Analysis");
	geoms=new ArrayList<>();
	//attsMap=new HashMap<>();
       GeometryFactory gf = new GeometryFactory();
       long runid = System.currentTimeMillis();
       int count=0;
       for (Boat boat : boats) {
           AttributesGeometry atts = new AttributesGeometry(VDSSchema.schema);//, VDSSchema.types);
           atts.set(VDSSchema.ID, count++);
           atts.set(VDSSchema.MAXIMUM_VALUE, boat.getAllMaxValue());
           atts.set(VDSSchema.TILE_AVERAGE, boat.getAllTileAvg());
           atts.set(VDSSchema.TILE_STANDARD_DEVIATION, boat.getAllTileStd());
           atts.set(VDSSchema.THRESHOLD, boat.getAllTrhesh());
           atts.set(VDSSchema.RUN_ID, runid + "");
           atts.set(VDSSchema.NUMBER_OF_AGGREGATED_PIXELS, boat.getSize());
           atts.set(VDSSchema.ESTIMATED_LENGTH, boat.getLength());
           atts.set(VDSSchema.ESTIMATED_WIDTH, boat.getWidth());
           atts.set(VDSSchema.SIGNIFICANCE, boat.getAllSignificance());//(boat.getLength() - boat.getWidth()) / (boat.getWidth() * boat.getHeading()));
           timeStampStart=timeStampStart.replace("Z", "");
           atts.set(VDSSchema.DATE, Timestamp.valueOf(timeStampStart));
           atts.set(VDSSchema.VS, 0);
           //compute the direction of the vessel considering the azimuth of the image result is between 0 and 180 degree
           double degree = boat.getHeading() + 90 + azimuth;
           if (degree > 180) {
               degree = degree - 180;
           }
		degree = degree-90;
           atts.set(VDSSchema.ESTIMATED_HEADING, degree);
           Point p=gf.createPoint(new Coordinate(boat.getPosx(), boat.getPosy()));
           p.setUserData(atts);
           put(p);
       }
   }
 
开发者ID:ec-europa,项目名称:sumo,代码行数:45,代码来源:GeometryImage.java

示例2: createPoint

import com.vividsolutions.jts.geom.Point; //导入方法依赖的package包/类
private static Point createPoint(String name) {
  Coordinate coord = new Coordinate(RANDOM.nextInt(4096), RANDOM.nextInt(4096));
  Point point = GEOMETRY_FACTORY.createPoint(coord);

  Map<String, Object> attributes = new LinkedHashMap<>();
  attributes.put("id", name.hashCode());
  attributes.put("name", name);
  point.setUserData(attributes);

  return point;
}
 
开发者ID:OrdnanceSurvey,项目名称:vt-support,代码行数:12,代码来源:MvtEncoderTest.java

示例3: createPointXy

import com.vividsolutions.jts.geom.Point; //导入方法依赖的package包/类
static Point createPointXy(String id, String name, double[] coordinate) {
  Map<String, Object> attributes = new LinkedHashMap<>();
  attributes.put("id", id.hashCode());
  attributes.put("name", name);

  Point point = GEOMETRY_FACTORY.createPoint(new Coordinate(coordinate[0], coordinate[1]));
  point.setUserData(attributes);
  return point;
}
 
开发者ID:OrdnanceSurvey,项目名称:vt-support,代码行数:10,代码来源:DataSourceTest.java

示例4: createPointXy

import com.vividsolutions.jts.geom.Point; //导入方法依赖的package包/类
static Point createPointXy(String id, String name, double[] coordinate) {
  Map<String, Object> attributes = new LinkedHashMap<>();
  attributes.put("id", id.hashCode());
  attributes.put("name", name);
  attributes.put("timestamp", System.currentTimeMillis());

  Point point = GEOMETRY_FACTORY.createPoint(new Coordinate(coordinate[0], coordinate[1]));
  point.setUserData(attributes);
  return point;
}
 
开发者ID:OrdnanceSurvey,项目名称:vt-support,代码行数:11,代码来源:Util.java


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