本文整理匯總了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);
}
}
示例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;
}
示例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;
}
示例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;
}