2012-09-05 32 views

回答

1

如果從SD卡裝載數據,你可以用openmap它具有類SHAPEFILE工作,並試圖將shape文件轉變成graphicslayer它的工作我已經做了。

static public GraphicsLayer SHPtoPOINT(String shpfile) { 
    SpatialReference lSR = SpatialReference.create(26192); 
    Envelope lEnvolope = getSHPEnvelope(shpfile);//to create an extent for your graphics  layer 
    GraphicsLayer graphicLayer = new GraphicsLayer(lSR, lEnvolope); 

    try { 
     File file = new File(shpfile); 
     ShapeFile shp = new ShapeFile(file); 
     ESRIPointRecord e = (ESRIPointRecord) shp.getNextRecord(); 
     SimpleMarkerSymbol c_point = new SimpleMarkerSymbol(Color.BLACK, 1, 
     STYLE.CIRCLE); 
      while (e != null) { 
      graphicLayer.addGraphic(new Graphic(new Point(e.getX(), e.getY()), c_point)); 
      e = (ESRIPointRecord) shp.getNextRecord(); 
      } 
     shp.close(); 
     } catch (IOException e1) { 
     e1.printStackTrace(); 
     } 
     return graphicLayer; 
    } 

Source

編輯:

BBN Technologies的OpenMap TM包是一個開源的JavaBeans TM 基於程序員的工具包。使用OpenMap,您可以快速構建從舊數據庫和 應用程序訪問數據的應用程序和小應用程序 。 OpenMap提供了允許用戶查看和處理地理空間信息的手段。

Link to OpenMap info.

+0

什麼是openmap和我在哪裏可以得到它? –

+0

我在更多關於OpenMap的信息中進行了編輯 –