• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Point类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: buildFeature

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
private AvroFeature buildFeature(
        final AvroSpatialReference avroSpatialReference,
        final Map<CharSequence, Object> attributes,
        final Point point) throws IOException
{
    final AvroCoord avroCoord = AvroCoord.newBuilder().
            setX(point.getX()).
            setY(point.getY()).
            build();
    final AvroPoint avroPoint = AvroPoint.newBuilder().
            setSpatialReference(avroSpatialReference).
            setCoord(avroCoord).
            build();
    return AvroFeature.newBuilder().
            setGeometry(avroPoint).
            setAttributes(attributes).
            build();
}
 
开发者ID:mraad,项目名称:AvroToolbox,代码行数:19,代码来源:ExportToAvroTool.java


示例2: write

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
@Override
public void write(
        final Put put,
        final byte[] geomColFam,
        final IGeometry geometry) throws IOException
{
    final Point point = (Point) geometry;

    m_dataFileWriter.create(AvroPoint.getClassSchema(), this);
    final AvroCoord coord = AvroCoord.newBuilder().
            setX(point.getX()).
            setY(point.getY()).
            build();
    m_dataFileWriter.append(AvroPoint.newBuilder().
            setSpatialReference(m_spatialReference).
            setCoord(coord).
            build());
    m_dataFileWriter.close();

    put.add(geomColFam, pointQual, this.toByteArray());

    this.reset();
}
 
开发者ID:mraad,项目名称:HBaseToolbox,代码行数:24,代码来源:PointWriterAvro.java


示例3: buildRecord

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
private GenericRecord buildRecord(
        final Schema schema,
        final int wkid,
        final IFields fields,
        final IFeature feature,
        final Point shape) throws IOException
{
    final GenericRecord genericRecord = new GenericData.Record(schema);
    for (final Schema.Field schemaField : schema.getFields())
    {
        final int index = fields.findField(schemaField.name());
        if (index > -1)
        {
            genericRecord.put(schemaField.name(), feature.getValue(index));
        }
    }

    final Schema.Field geometryField = schema.getField("geometry");
    final Schema geometrySchema = geometryField.schema();
    final GenericRecord geometry = new GenericData.Record(geometrySchema);
    genericRecord.put("geometry", geometry);

    final Schema.Field spatialReferenceField = geometrySchema.getField("spatialReference");
    final GenericRecord spatialReference = new GenericData.Record(spatialReferenceField.schema());
    spatialReference.put("wkid", wkid);
    geometry.put("spatialReference", spatialReference);

    final Schema.Field coordField = geometrySchema.getField("coord");
    final GenericRecord coord = new GenericData.Record(coordField.schema());
    coord.put("x", shape.getX());
    coord.put("y", shape.getY());
    geometry.put("coord", coord);

    return genericRecord;
}
 
开发者ID:mraad,项目名称:AvroToolbox,代码行数:36,代码来源:ExportToGenericAvroTool.java


示例4: write

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
@Override
public void write(
        final Put put,
        final byte[] geomColFam,
        final IGeometry geometry) throws IOException
{
    final Point point = (Point) geometry;
    m_stringBuilder.setLength(0);
    m_stringBuilder.append("{\"type\":\"Point\",\"coordinates\":[").
            append(point.getX()).
            append(",").
            append(point.getY()).
            append(")]}");
    put.add(geomColFam, pointQual, Bytes.toBytes(m_stringBuilder.toString()));
}
 
开发者ID:mraad,项目名称:HBaseToolbox,代码行数:16,代码来源:PointWriterGeoJSON.java


示例5: write

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
@Override
public void write(
        final Put put,
        final byte[] geomColFam,
        final IGeometry geometry) throws IOException
{
    final Point point = (Point) geometry;
    put.add(geomColFam, Const.X, Bytes.toBytes(point.getX()));
    put.add(geomColFam, Const.Y, Bytes.toBytes(point.getY()));
}
 
开发者ID:mraad,项目名称:HBaseToolbox,代码行数:11,代码来源:PointWriterBytes.java


示例6: createGeometry

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
/**
 * Creates the geometry.
 *
 * @param geometry the geometry
 * @return the json element
 */
public static JsonElement createGeometry(IGeometry geometry) {
    JSONObject esriJsonObject = null;

    try {
        switch (geometry.getGeometryType())
        {
        case esriGeometryType.esriGeometryPoint:
            esriJsonObject = getJSONFromPoint((Point)geometry);
            break;

        case esriGeometryType.esriGeometryMultipoint:
            esriJsonObject = ServerUtilities.getJSONFromMultipoint((Multipoint)geometry);
            break;

        case esriGeometryType.esriGeometryPolyline:
            esriJsonObject = ServerUtilities.getJSONFromPolyline((Polyline)geometry);
            break;

        case esriGeometryType.esriGeometryPolygon:
            esriJsonObject = getJSONFromPolygon((Polygon)geometry);
            break;

        case esriGeometryType.esriGeometryEnvelope:
            esriJsonObject = ServerUtilities.getJSONFromEnvelope((Envelope)geometry);
            break;

        case esriGeometryType.esriGeometryLine:
            esriJsonObject = getJSONFromLine((Line)geometry);
            break;

        default:
            System.err.println(
                    "Only geometries of type Point, Multipoint, Polyline, Polygon and Envelope are supported by this conversion utility. "
                            + geometry.getGeometryType());
            break;
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

    JsonObject jobj = new Gson().fromJson(esriJsonObject.toString(), JsonObject.class);

    return jobj;
}
 
开发者ID:robward-scisys,项目名称:sldeditor,代码行数:51,代码来源:CommonObjects.java


示例7: doExport

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
private int doExport(
        final IGPValue hadoopPropValue,
        final IGPValue featureClassValue,
        final IGPValue schemaValue,
        final IGPValue outputValue) throws Exception
{
    int count = 0;
    final IFeatureClass[] featureClasses = new IFeatureClass[]{new IFeatureClassProxy()};
    gpUtilities.decodeFeatureLayer(featureClassValue, featureClasses, null);
    final FeatureClass featureClass = new FeatureClass(featureClasses[0]);
    try
    {
        final int wkid = getWkid(featureClass);

        final Configuration configuration = createConfiguration(hadoopPropValue.getAsText());

        final Schema schema = parseSchema(schemaValue.getAsText(), configuration);

        final Path path = new Path(outputValue.getAsText());
        path.getFileSystem(configuration).delete(path, true);
        final AvroParquetWriter<GenericRecord> writer = new AvroParquetWriter<GenericRecord>(path, schema);
        try
        {
            final IFeatureCursor cursor = featureClass.search(null, false);
            try
            {
                final IFields fields = cursor.getFields();
                IFeature feature = cursor.nextFeature();
                try
                {
                    while (feature != null)
                    {
                        final IGeometry shape = feature.getShape();
                        if (shape instanceof Point)
                        {
                            writer.write(buildRecord(schema, wkid, fields, feature, (Point) shape));
                            count++;
                        }
                        else if (shape instanceof Polyline)
                        {
                            writer.write(buildRecord(schema, wkid, fields, feature, (Polyline) shape));
                            count++;
                        }
                        else if (shape instanceof Polygon)
                        {
                            writer.write(buildRecord(schema, wkid, fields, feature, (Polygon) shape));
                            count++;
                        }
                        feature = cursor.nextFeature();
                    }
                }
                finally
                {
                    Cleaner.release(fields);
                }
            }
            finally
            {
                Cleaner.release(cursor);
            }
        }
        finally
        {
            writer.close();
        }
    }
    finally
    {
        Cleaner.release(featureClass);
    }
    return count;
}
 
开发者ID:mraad,项目名称:AvroToolbox,代码行数:73,代码来源:ExportToAvroParquetTool.java


示例8: onMouseMove

import com.esri.arcgis.geometry.Point; //导入依赖的package包/类
public void onMouseMove(int arg0, int arg1, int arg2, int arg3)
			throws IOException, AutomationException {
		// TODO Auto-generated method stub
		if(!inUse)return;
		boolean firstUse=false;
		if(lineSymbol==null)firstUse=true;
		IPoint movePoint;
		movePoint=activeView.getScreenDisplay().getDisplayTransformation().toMapPoint(arg2,arg3);
		activeView.getScreenDisplay().startDrawing(activeView.getScreenDisplay().getHDC(),(short)-1);
		if(firstUse){
			RgbColor rgbColor=new RgbColor();
			rgbColor.setBlue(223);
			rgbColor.setRed(223);
			rgbColor.setGreen(223);
			
			SimpleLineSymbol sls=new SimpleLineSymbol();
			sls.setColor(rgbColor);
			sls.setWidth(1);
			sls.setROP2(esriRasterOpCode.esriROPXOrPen);
			lineSymbol=sls;
			TextSymbol ts=new TextSymbol();
			ts.setHorizontalAlignment(esriTextHorizontalAlignment.esriTHACenter);
			ts.setVerticalAlignment(esriTextVerticalAlignment.esriTVACenter);
			ts.setSize(12);
			ts.setROP2(esriRasterOpCode.esriROPXOrPen);
			ts.getFont().setName("Arial");
			textSymbol=ts;
			tp=new Point();
		}else{
//			activeView.getScreenDisplay().setSymbol(new ISymbolProxy(textSymbol));
//			activeView.getScreenDisplay().drawText(tp,textSymbol.getText());
//			activeView.getScreenDisplay().setSymbol(new ISymbolProxy(lineSymbol));
//			if(polyline.getLength()>0){
//				activeView.getScreenDisplay().drawPolyline(polyline);
//			}
		}
		Line line=new Line();
		line.putCoords(sp,movePoint);
		double angle=line.getAngle();
		angle=angle*180/3.14159;
		if(angle>90&&angle<180){
			angle+=180;
		}else if(angle<0&&angle>-90){
			angle-=180;
		}else if(angle<-90&&angle>-180){
			angle-=180;
		}else if(angle>180){
			angle-=180;
		}
		double dx,dy,distance;
		dx=movePoint.getX()-sp.getX();
		dy=movePoint.getY()-sp.getY();
		tp.setX(sp.getX()+dx/2);
		tp.setY(sp.getY()+dy/2);
//		textSymbol.setAngle(angle);
		textSymbol.setAngle(0);
		distance=Math.sqrt(dx*dx+dy*dy);
		DecimalFormat format=new DecimalFormat("#.00");
		
		textSymbol.setText(format.format(distance));
//		activeView.getScreenDisplay().setSymbol(new ISymbolProxy(textSymbol));
//		activeView.getScreenDisplay().drawText(tp,textSymbol.getText());
		Polyline pl=new Polyline();
		pl.addSegment(line,null,null);
		polyline=smashLine(activeView.getScreenDisplay(),new ISymbolProxy(textSymbol),tp,pl);
//		activeView.getScreenDisplay().setSymbol(new ISymbolProxy(textSymbol));
//		if(polyline.getLength()>0){
//			activeView.getScreenDisplay().drawPolyline(polyline);
//		}
		activeView.getScreenDisplay().finishDrawing();
		activeView.refresh();
	}
 
开发者ID:vonpower,项目名称:VonRep,代码行数:73,代码来源:Measure.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JExpr类代码示例发布时间:2022-05-22
下一篇:
Java OperaOptions类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap