亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? featureclass.java~96~

?? CreateMyFirstMap
?? JAVA~96~
字號(hào):
package myfirstmap;
import com.mapinfo.mapj.MapJ;
import com.mapinfo.unit.LinearUnit;
import com.mapinfo.util.DoublePoint;
import com.mapinfo.util.DoubleRect;
import com.mapinfo.dp.tab.TABDataProviderHelper;
import com.mapinfo.dp.tab.TABTableDescHelper;
import com.mapinfo.mapxtreme.client.MapXtremeDataProviderRef;
import com.mapinfo.mapj.AbstractLayer;
import com.mapinfo.mapj.Layers;
//import com.mapinfo.mapj.Layer;
import com.mapinfo.mapj.FeatureLayer;
import com.mapinfo.dp.TableInfo;
import java.util.List;
import java.util.ArrayList;
import com.mapinfo.dp.util.RewindableFeatureSet;
import com.mapinfo.dp.FeatureSet;
import com.mapinfo.dp.Feature;
import com.mapinfo.dp.Attribute;
import com.mapinfo.dp.Geometry;
import com.mapinfo.dp.PointGeometry;
import com.mapinfo.dp.VectorGeometry;
import com.mapinfo.dp.PointList;
import com.mapinfo.mapj.FeatureFactory;
import com.mapinfo.graphics.Rendition;
import  com.mapinfo.graphics.RenditionImpl;
import java.awt.Color;
import com.mapinfo.dp.annotation.AnnotationDataProvider;
import com.mapinfo.dp.annotation.AnnotationDataProviderHelper;
import com.mapinfo.dp.annotation.AnnotationTableDescHelper;
import com.mapinfo.dp.util.LocalDataProviderRef;
import com.mapinfo.dp.PrimaryKey;
import com.mapinfo.mapxtreme.client.MapXtremeImageRenderer;
import com.mapinfo.xmlprot.mxtj.ImageRequestComposer;
import com.mapinfo.dp.AttOperator;
import com.mapinfo.dp.AttTuple;
import com.mapinfo.dp.QueryParams;
public class FeatureClass
{
  private   String mapxtremeURL="http://901-32:8083/mapxtreme47/mapxtreme";
  private   String mdfFilePath="E:\\MapInfo\\study\\mapmdf\\pla2.mdf";
  public FeatureClass()
  {
  }
  public  void getInfoFromFeature()
  {
   MapJ mapj=new MapJ();
   DoublePoint point=new DoublePoint(018.9608,34.2729);
   DoubleRect bound=new DoubleRect(point,0.31,0.21);
   mapj.setBounds(bound) ;
   LinearUnit unit=LinearUnit.kilometer ;
   mapj.setDistanceUnits(unit) ;
   mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
   //
  try
  {
    mapj.loadMapDefinition(mdfFilePath);
    Layers layers=mapj.getLayers() ;
    AbstractLayer abstractLayer=null;
    FeatureLayer featureLayer=null;
    String layerName;
    TableInfo tableInfo=null;
    List columns=new ArrayList();
    Attribute attribute=null;
    Geometry geom=null;
    PointGeometry pointGeom=null;
    int attributeCount=0;
    DoubleRect rect=null;
    DoublePoint dbPoint=null;
    PointList pointList=null;
    VectorGeometry vectorGeometry=null;
    int count=0;
    for(int i=0;i<layers.size() ;i++)
    {
      featureLayer=(FeatureLayer)layers.get(i) ;
      layerName=featureLayer.getName() ;
      tableInfo=featureLayer.getTableInfo() ;
      //必須清空,因?yàn)橄麓螆?zhí)行下一個(gè)表時(shí),如果它們的字段不一樣,那么在“FeatureSet fSet=featureLayer.searchAll(columns,null);”就會(huì)出現(xiàn)錯(cuò)誤
      count=0;
      columns.clear() ;
      for(int j=0;j<tableInfo.getColumnCount() ;j++)
      {
        String columnName=tableInfo.getColumnName(j) ;
        columns.add(columnName) ;
      }
      //perform a search to get the features(records) from the layer
      FeatureSet fSet=featureLayer.searchAll(columns,null);
      RewindableFeatureSet rfSet=new RewindableFeatureSet(fSet);
      //get the first attribute
      Feature feature=rfSet.getNextFeature() ;
      //the loop throuth all feature in the layer
      while(feature!=null)
      {
        /* get the first attribute (columnData) from the feature Note: If
        we want to re-use the Attribute object later on (after the
        getNextFeature loop), we would need to make a copy of the
        Attribute object, using the copy constructor.
        */
        attribute=feature.getAttribute(0) ;//it's error here
        //get a count of all attributes in the layer
        attributeCount=feature.getAttributeCount() ;
        //get a reference to the grographic information from the feature
        geom=feature.getGeometry() ;
        //if the geometry is a point
        if(geom.getType() ==Geometry.TYPE_POINT )
        {
          pointGeom=(PointGeometry)geom;
          // get the minimum bounding rectangle for the feature
          rect=pointGeom.getBounds() ;
          // get the x,y location where the feature’s label will be
          // anchored
          dbPoint=pointGeom.getLabelPoint(null);
        }else
        {
          vectorGeometry = (VectorGeometry) geom;

          rect = vectorGeometry.getBounds();
          dbPoint = vectorGeometry.getLabelPoint(null);
          double[] points;
          int offset=0;
          int numPoints;
           int pointListCount=vectorGeometry.getPointListCount() ;
          for (int ii=0;ii<vectorGeometry.getPointListCount();++ii)
          {
            // Get the next Point List
            pointList = vectorGeometry.getNextPointList();
            // determine the number of Points in the point group
             numPoints = pointList.getPointCount();
            // Create the point array large enough to hold all the
            // points
            points = new double[numPoints];
            // Call getNextPoints which will put the points into the
            // array
            pointList.getNextPoints(points, offset, numPoints/2);
           }//end this for above
        }//end else
       count++;
        if((count>332)&&(layerName.equals("Line") ))
       {
         System.out.println(">99") ;
       }
       feature=rfSet.getNextFeature() ;
      }//end while
      //rewind the featureSet for the future use
      rfSet.rewind() ;
    }//end the most outer for
  }catch(java.io.IOException  ioe)
  {
    System.out.println("get a "+ioe.getClass() +"\nwith message "+ioe.getMessage() ) ;
    ioe.printStackTrace() ;
  }catch(Exception e)
  {
    System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
    e.printStackTrace() ;
  }
}//end this function

public void createVariousFeature()
{
  MapJ mapj=new MapJ();
  DoublePoint point=new DoublePoint(108.9608,34.2729);
  DoubleRect bound=new DoubleRect(point ,0.31,0.21);
  mapj.setBounds(bound) ;
  LinearUnit unit=LinearUnit.kilometer ;
  mapj.setDistanceUnits(unit) ;
  mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
  try
  {
  //  mapj.loadMapDefinition(mdfFilePath);
    FeatureFactory feaFac=mapj.getFeatureFactory() ;
    //set attribute object
    Attribute[] attributes=new Attribute[4];
    attributes[0]=new Attribute("feature1");
    attributes[1]=new Attribute("ellpise");
    attributes[2]=new Attribute("point");
    attributes[3]=new Attribute("polyline");
    //set up the rendition object
    //this will not work for a tab files. for tab files we must use
    //com.mapinfo.tab.TABStyleFactory to create an appropirate rendition object
    Rendition rend=RenditionImpl.getDefaultRendition() ;
    //for circle ,specify the edge color and fill color
    rend.setValue(Rendition.STROKE ,Color.cyan );
    rend.setValue(Rendition.FILL ,Color.green );
    // For points, specify the symbol size, font, and color
    rend.setValue(Rendition.SYMBOL_STRING, "@");
    rend.setValue(Rendition.FONT_SIZE, 16);
    rend.setValue(Rendition.FONT_FAMILY, "MapInfo Shields");
    rend.setValue(Rendition.SYMBOL_FOREGROUND, Color.blue);
// For lines, specify the line color and width
    rend.setValue(Rendition.STROKE, Color.green);
    rend.setValue(Rendition.STROKE_WIDTH, 4);
// For ellipses, specify the fill color and opacity
    rend.setValue(Rendition.FILL, Color.blue);
    rend.setValue(Rendition.FILL_OPACITY, new Float(0.40));

    //create circular region
    int circleType=1;
     double circleRadius=2;
    int circleResolution=12;
    //for elliptical region
    //create a integer variable to set the coordsys system of the region.o set for map coordsys,1 set for screen coordsys
    int ellipseType=1;
    //create a variable to set the rotation angle of the ellipse in radiant
    double xRadius=1.0;
    double yRadius=0.25;
    //create a integer variable to specify the number of point to describe the ellipse. if 0,the default 12 will be used
    int ellipseResolution=12;
    //create an annotation layer for storing the feature we are creating
    AnnotationTableDescHelper annotationTDHelper=new AnnotationTableDescHelper("Annotations");
    AnnotationDataProviderHelper annotationDPHelper=new AnnotationDataProviderHelper();
    LocalDataProviderRef localDPRef=new LocalDataProviderRef(annotationDPHelper);
    FeatureLayer annotationLayer=(FeatureLayer)mapj.getLayers() .insertLayer(localDPRef,annotationTDHelper,0,"Annotations");
    //PrimaryKey is taken as an argument by all the create methods and
//cannot be null
    Feature retFeature;
    PrimaryKey pkey = new PrimaryKey(attributes[0]);
    //set the center point for the circle
    DoublePoint centerPoint=new DoublePoint(108.9608,34.2729);
    // Create a Circular Region
    retFeature = feaFac.createCircularRegion(circleType,//type
                                             /*
if the Type is 0, MapJ creates a region whose points are all the same geographic distance from the
 center. Due to the curvature of the earth, and due to the way that coordinate systems and
 map projections work, such a circle might appear lop-sided, rather than circular.
If the type parameter is 1, MapJ creates a region that appears circular on the screen.
However, different points on the circle might not be the same geographic distance from the center
of the circle.
type - An integer representing the type of coordinate system to use in creation of the circle.
Use 0 for map coords and 1 for screen coords.
*/
centerPoint,// The center of the circle given as a DoublePoint.
circleRadius,//the radius of the circle
LinearUnit.mile,//the linear unit of the distance
circleResolution,// The number of points describing the circle. If 0 it will use default of 12.
rend,//The rendition associated with this feature, may be null.
null, //The rendition associated with the label for this feature, may be null.
null,//attributes,//Attributes that are associated with this feature, may be null.
pkey//the PrimaryKey of the new Feature, may be null.
);
    //add the new feature to the annotation layer
    PrimaryKey pkey2=annotationLayer.addFeature(retFeature) ;
//create the ellipse region
DoublePoint    ellipseCenter=new DoublePoint(108.9608,34.3729);
retFeature=feaFac.createEllipticalRegion(ellipseType,ellipseCenter,0,xRadius,yRadius,
   LinearUnit.mile  , ellipseResolution,rend,null,null,new PrimaryKey(attributes[1]));
  annotationLayer.addFeature(retFeature) ;
//creae point
retFeature=feaFac.createPoint(new DoublePoint(108.8,34.2729),rend,null,new PrimaryKey(attributes[2]));
  annotationLayer.addFeature(retFeature) ;
//create ployline
  // Create PolyLine using a 2 x 6 double matrix
// Row 1 contains 3 points(x,y,x,y,x,y) and 2 line segments.
// Row 2 contains 3 points(x,y,x,y,x,y) and 2 line segments.
double pts[][] = { {108.8608,34.2720, 108.8908,34.2720,108.9208,34.270},
      {108.8908,34.2680, 108.8608,34.2680,108.8408,34.2720} };
retFeature = feaFac.createPolyLine(pts, rend, null, null, new PrimaryKey(attributes[3]));
  annotationLayer.addFeature(retFeature) ;
     //
     MapXtremeImageRenderer render=new MapXtremeImageRenderer(mapxtremeURL);
     ImageRequestComposer imageRC=ImageRequestComposer.create(mapj,256,Color.white ,"image/png");
     render.render(imageRC) ;
     render.toFile("E:\\MapInfo\\study\\png\\created.png") ;
  }catch(Exception e)
  {
    System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
    e.printStackTrace() ;
  }
}
public void searchFeature()
{
  MapJ mapj=new MapJ();
  DoublePoint centerPoint=new DoublePoint(108.9608,34.2729);
  DoubleRect bound=new DoubleRect(centerPoint,0.31,0.21);
  mapj.setBounds(bound) ;
  mapj.setDeviceBounds(new DoubleRect(0,0,800,600)) ;
  Layers layers=null;
  FeatureLayer featureLayer;
  FeatureSet featureSet=null;
  double searchRadius=2;
  List resList=new ArrayList();
  RewindableFeatureSet rfSet=null;
  Feature feature=null;
  try
  {
    mapj.loadMapDefinition(mdfFilePath);
    layers=mapj.getLayers() ;
    int count=0;
    String layerName;
    for(int i=0;i<layers.size() ;i++)
    {
      featureLayer=(FeatureLayer)layers.get(i) ;
      layerName=featureLayer.getName() ;
      feature=null;
      count=0;
//      featureSet=featureLayer.searchWithinRadius(resList,centerPoint,searchRadius,LinearUnit.kilometer ,null);
  //  DoubleRect rect=new DoubleRect(108.9608,34.2729,108.9908,34.3729);
  //    featureSet=featureLayer.searchWithinRectangle(resList,rect,null);
   //   featureSet=featureLayer.searchAtPoint(resList,centerPoint,null) ;
    /*  Attribute attLength=new Attribute(1022);
      String searchCol="length";

      if(layerName.equals("line") )
      {
      featureSet=featureLayer.searchByAttribute(resList,searchCol,attLength,null);
      rfSet=new RewindableFeatureSet(featureSet);
      feature=rfSet.getNextFeature() ;
      }*/
      int searchLen=1022;
      String searchColumn="length";
      //create name list
      List nameList=new ArrayList();
      nameList.add(searchColumn) ;
      //create value list
      List valueList=new ArrayList();
      Attribute searchAttr=new Attribute(searchLen);
      AttTuple searchTuple=new AttTuple(searchAttr);
      valueList.add(searchTuple);
      //create operator list
      List operatorList=new ArrayList();
      operatorList.add(AttOperator.eq ) ;
      //do the search
      if(layerName.equals("line") )
      {
      featureSet=featureLayer.searchByAttributes(resList,nameList,operatorList,valueList,QueryParams.m_defaultQP );
      rfSet=new RewindableFeatureSet(featureSet);
      feature=rfSet.getNextFeature() ;
      //下面這個(gè)是練習(xí),練習(xí)如何得到feature對(duì)應(yīng)的列值,因?yàn)橐粋€(gè)層實(shí)際上對(duì)應(yīng)的就是一個(gè)表,所以一個(gè)feature
         //對(duì)應(yīng)的應(yīng)該就是一列
         for(int ii=0;ii<feature.getAttributeCount() ;ii++)
         {
           Attribute att=feature.getAttribute(ii) ;
           String str=att.getString() ;
           str="wait";
         }

      }

      while(feature!=null)
      {
        count++;
        feature=rfSet.getNextFeature() ;

      }
      System.out.println("there are "+count+" in "+layerName+" layer ") ;
    }
  }catch(java.io.IOException  ioe)
  {
    System.out.println("get a  "+ioe.getClass() +"\nwith message "+ioe.getMessage() ) ;
  }catch(Exception e)
  {
    System.out.println("get a "+e.getClass() +"\nwith message "+e.getMessage() ) ;
  }
}
}

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久不卡网国产精品二区 | 久久精品日产第一区二区三区高清版 | 亚洲午夜电影在线观看| 亚洲一区在线电影| 亚洲免费观看视频| 18成人在线视频| 中文字幕在线不卡一区| 亚洲精品一二三| 亚洲一区二区三区视频在线播放| 亚洲国产精品精华液网站| 亚洲成av人片在线| 久久se这里有精品| 国产精品一区二区91| 日韩av中文字幕一区二区三区| 欧美成人女星排名| 日韩精品一区二区三区在线| 日韩亚洲欧美中文三级| 久久综合一区二区| 国产精品三级电影| 伊人婷婷欧美激情| 天堂av在线一区| 国产一区在线看| 99久久99久久精品免费观看| 在线观看国产日韩| 欧美电影精品一区二区| 1024亚洲合集| 日韩成人免费电影| 成人99免费视频| 3d动漫精品啪啪一区二区竹菊| 午夜久久福利影院| 国产精品88av| 欧美三级中文字幕| 奇米色一区二区| 成人毛片在线观看| 99久久99久久精品免费观看| 91麻豆国产自产在线观看| 7777精品伊人久久久大香线蕉超级流畅| 日韩欧美另类在线| 亚洲精品成a人| 久久99国产精品免费| 色欧美片视频在线观看 | 日韩理论在线观看| 欧美96一区二区免费视频| 99久久综合国产精品| 日韩视频在线你懂得| 亚洲国产高清在线观看视频| 日日欢夜夜爽一区| 91久久国产综合久久| 国产午夜三级一区二区三| 国产成人精品在线看| 久久夜色精品国产噜噜av| 国产精品成人午夜| 美女任你摸久久| 色综合久久九月婷婷色综合| 精品国产人成亚洲区| 亚洲成a天堂v人片| 日本韩国欧美国产| 欧美国产日韩一二三区| 麻豆精品视频在线| 欧美日韩精品高清| 欧美成人video| 色综合色综合色综合色综合色综合| 欧美久久久一区| 亚洲激情一二三区| 91久久免费观看| 亚洲欧美激情在线| 一本高清dvd不卡在线观看| 国产日产欧美一区二区三区| 激情成人午夜视频| 亚洲精品一区二区在线观看| 激情欧美日韩一区二区| 国产精品99久久久久久有的能看 | 成人免费高清在线| 2021久久国产精品不只是精品| 日韩极品在线观看| 欧美三级韩国三级日本三斤| 依依成人精品视频| 欧美日韩国产综合一区二区| 亚洲第一主播视频| 91麻豆精品国产自产在线观看一区 | 欧美日韩一区在线观看| 亚洲图片欧美色图| 美国十次综合导航| 欧美一区二区私人影院日本| 日韩va欧美va亚洲va久久| 91麻豆精品国产91久久久资源速度| 亚洲成人第一页| 日韩亚洲欧美在线观看| 国内精品写真在线观看| 国产欧美日韩一区二区三区在线观看 | 91香蕉视频mp4| 亚洲精品自拍动漫在线| 欧美性猛片aaaaaaa做受| 日韩精品高清不卡| 久久在线观看免费| 99国产欧美另类久久久精品| 亚洲综合激情网| 免费看日韩a级影片| 久久久综合视频| 91小视频在线| 日韩精品国产精品| 国产欧美日本一区视频| 色中色一区二区| 久久精品国产亚洲5555| 中文字幕av在线一区二区三区| 日本韩国欧美一区二区三区| 欧美伦理电影网| 国产盗摄精品一区二区三区在线| 亚洲乱码国产乱码精品精98午夜| 91精品国产高清一区二区三区| 国产91丝袜在线播放九色| 午夜私人影院久久久久| 国产日韩一级二级三级| 欧美乱妇15p| 成人美女视频在线观看| 欧美另类高清zo欧美| 成人综合激情网| 蜜臂av日日欢夜夜爽一区| 日韩一区欧美一区| 中文字幕欧美一| 亚洲猫色日本管| 日韩精品中文字幕一区二区三区| 777a∨成人精品桃花网| 成人av中文字幕| 久久精品国内一区二区三区| 亚洲精品免费播放| 国产偷v国产偷v亚洲高清| 91精品国产乱码| 欧美性大战久久久久久久 | 欧美一区二区精品久久911| 国产一区二区三区在线观看精品| 国产精品妹子av| 欧美一级免费大片| 欧美亚洲国产一卡| 99久久国产综合精品色伊| 国产资源精品在线观看| 日韩精品电影在线| 亚洲国产综合91精品麻豆| 日本一区二区成人| 亚洲美女偷拍久久| 9191精品国产综合久久久久久| 欧美一级久久久| 色老汉av一区二区三区| 国产精品系列在线播放| 极品瑜伽女神91| 免费高清在线一区| 麻豆91在线观看| 欧美a级理论片| 蜜桃av噜噜一区二区三区小说| 天天亚洲美女在线视频| 午夜久久久影院| 丝袜美腿高跟呻吟高潮一区| 婷婷久久综合九色综合伊人色| 亚洲国产成人私人影院tom| 精品国产一区二区三区忘忧草| 色偷偷久久人人79超碰人人澡| 成人午夜视频在线观看| 岛国一区二区在线观看| 国产激情91久久精品导航| 国内精品不卡在线| 国产福利一区二区三区视频| 国产成人免费在线观看不卡| 国产不卡免费视频| 日韩午夜三级在线| 99视频一区二区| eeuss鲁一区二区三区| 粉嫩一区二区三区性色av| heyzo一本久久综合| 在线一区二区三区四区| 欧美日韩卡一卡二| 亚洲另类在线视频| 日欧美一区二区| 激情久久五月天| 99国产精品视频免费观看| 亚洲精品综合在线| 日韩高清不卡一区| 成人性视频网站| 精品污污网站免费看| 日韩精品一区二区三区三区免费 | 乱中年女人伦av一区二区| 国产又黄又大久久| 91浏览器在线视频| 日韩精品一级二级| 国产精品一区不卡| 欧美性高清videossexo| 精品电影一区二区| 亚洲一区二区三区影院| 九九**精品视频免费播放| 99r国产精品| 欧美变态口味重另类| 亚洲视频在线观看三级| 美女免费视频一区| 国产精品久久久久久久岛一牛影视| 亚洲精品高清视频在线观看| 久久99精品国产麻豆不卡| 在线视频一区二区三区| 精品国产一二三区| 午夜私人影院久久久久| 99久久精品国产精品久久| 欧美电视剧在线看免费|