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

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

?? featureclass.java

?? CreateMyFirstMap
?? JAVA
字號(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() ;

      }
      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() ) ;
  }
}
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲色图制服丝袜| 国产一区二区在线影院| 日本高清免费不卡视频| 亚洲欧美日韩在线不卡| 欧美亚洲国产一区二区三区va| 亚洲v精品v日韩v欧美v专区| 3d成人h动漫网站入口| 精品一区二区三区在线播放视频| 精品国产区一区| 丁香激情综合国产| 一区二区三区高清不卡| 欧美一区二区国产| 粉嫩高潮美女一区二区三区| 亚洲精品高清在线观看| 欧美综合亚洲图片综合区| 蜜桃视频免费观看一区| 久久九九久精品国产免费直播| 91免费视频网址| 青娱乐精品在线视频| 久久久精品国产免费观看同学| 99久久er热在这里只有精品15 | 国产麻豆精品在线| 国产欧美日韩综合精品一区二区| thepron国产精品| 亚洲va欧美va天堂v国产综合| 久久这里只精品最新地址| 91免费看`日韩一区二区| 日本不卡高清视频| 综合中文字幕亚洲| 日韩欧美国产综合在线一区二区三区| www.欧美色图| 麻豆成人久久精品二区三区小说| 国产精品午夜在线观看| 欧美一区二区大片| 91在线云播放| 国产又粗又猛又爽又黄91精品| 亚洲最新在线观看| 国产三级一区二区| 91精品国产91热久久久做人人| av一区二区三区黑人| 奇米影视一区二区三区| 一区二区三区在线免费观看 | 激情综合色综合久久综合| 亚洲视频精选在线| 久久色.com| 欧美一区二区三区在线视频| 色嗨嗨av一区二区三区| 成人一级片在线观看| 蜜桃视频在线观看一区| 美腿丝袜亚洲色图| 亚洲欧美另类小说视频| 久久精品这里都是精品| 欧美一区二区三区色| 在线亚洲免费视频| 不卡欧美aaaaa| 国产成人在线视频免费播放| 精品一区二区三区视频| 美女性感视频久久| 秋霞午夜鲁丝一区二区老狼| 亚洲国产精品久久久久秋霞影院 | 中文字幕在线免费不卡| 久久九九久精品国产免费直播| 欧美一区二区三级| 欧美日韩视频在线第一区| 色狠狠色噜噜噜综合网| 91麻豆免费在线观看| 不卡在线观看av| 国产91丝袜在线播放九色| 国产一区二区三区四区五区美女| 美女一区二区三区| 免费人成精品欧美精品| 日韩av高清在线观看| 蜜臀av在线播放一区二区三区| 日韩激情一区二区| 麻豆精品久久精品色综合| 麻豆中文一区二区| 老司机精品视频线观看86| 捆绑调教美女网站视频一区| 精品一区二区日韩| 国产一区二区视频在线| 成人性生交大片免费看视频在线 | 久久久久久99精品| 国产欧美日韩视频在线观看| 欧美国产精品中文字幕| 中文字幕在线视频一区| 亚洲色图在线视频| 亚洲国产精品久久艾草纯爱 | 国产一区二区在线电影| 国产高清久久久| 97精品久久久午夜一区二区三区| 色琪琪一区二区三区亚洲区| 欧美色综合影院| 日韩欧美一区在线| 国产亚洲欧美日韩在线一区| 国产精品色噜噜| 亚洲狠狠丁香婷婷综合久久久| 无码av免费一区二区三区试看| 日韩精品电影在线观看| 国产精品白丝jk黑袜喷水| 99视频精品全部免费在线| 在线视频综合导航| 日韩美女在线视频| 国产精品久久久久久久午夜片| 一区二区在线观看免费视频播放| 天天影视涩香欲综合网| 国产一区二区三区免费| 色天天综合久久久久综合片| 日韩一级视频免费观看在线| 久久久精品影视| 亚洲一级电影视频| 91精品国产免费| 欧美人牲a欧美精品| 久久精品夜夜夜夜久久| 亚洲一二三区在线观看| 久久成人久久鬼色| 99re在线精品| 日韩精品一区二区三区在线观看 | 色综合天天综合| 欧美一区二区久久| 专区另类欧美日韩| 麻豆精品国产91久久久久久| 91在线观看成人| 精品免费国产二区三区| 一区二区三区视频在线观看| 韩国v欧美v亚洲v日本v| 在线观看网站黄不卡| 久久久久青草大香线综合精品| 亚洲最大成人网4388xx| 国产高清无密码一区二区三区| 欧美日韩高清一区二区不卡| 中文字幕免费不卡| 久久国内精品视频| 欧美三级视频在线观看| 国产精品不卡在线观看| 国产精一区二区三区| 制服丝袜在线91| 亚洲午夜久久久久中文字幕久| 国产成人免费在线观看| 日韩欧美一级精品久久| 亚洲国产一区二区三区| 91影院在线观看| 国产精品麻豆99久久久久久| 久久69国产一区二区蜜臀| 7777精品伊人久久久大香线蕉超级流畅 | 亚洲国产视频直播| 97久久精品人人爽人人爽蜜臀| 久久日韩精品一区二区五区| 日本在线不卡一区| 在线日韩av片| 亚洲日穴在线视频| 成人avav影音| 国产精品丝袜一区| 国产成人综合在线播放| 精品久久久久99| 韩国精品在线观看| 欧美mv日韩mv| 激情综合五月婷婷| www国产亚洲精品久久麻豆| 精品在线观看视频| 欧美本精品男人aⅴ天堂| 欧美精品一区二区高清在线观看| 日本一区二区三区免费乱视频| 精品在线你懂的| 国产婷婷一区二区| 国产iv一区二区三区| 国产欧美中文在线| 不卡的av在线| 自拍偷在线精品自拍偷无码专区| av一区二区三区在线| 亚洲欧美一区二区三区久本道91| 色综合久久综合网97色综合| 艳妇臀荡乳欲伦亚洲一区| 欧美午夜精品久久久| 亚洲成av人影院在线观看网| 欧美丰满少妇xxxxx高潮对白| 天堂在线一区二区| 日韩三级av在线播放| 狠狠色丁香婷婷综合| 国产人成亚洲第一网站在线播放 | 日韩免费电影一区| 国产在线一区观看| 国产精品福利一区| 色爱区综合激月婷婷| 日韩激情av在线| 国产婷婷色一区二区三区四区| 成人黄色大片在线观看| 一级做a爱片久久| 日韩一区二区三| 国产成a人亚洲精| 亚洲精选免费视频| 正在播放一区二区| 国产传媒日韩欧美成人| 夜夜揉揉日日人人青青一国产精品 | 七七婷婷婷婷精品国产| 亚洲精品一线二线三线| 成人av先锋影音| 亚洲www啪成人一区二区麻豆| 日韩视频免费直播| www.亚洲色图| 午夜久久福利影院|