Select to view content in your preferred language

How to open shape file (*.shp) from SD Card ?

10730
20
04-25-2012 08:10 AM
mrphammrpham
Emerging Contributor
Hi all !

How to open shape file (*.shp) from SD Card ?

Thank you all !
0 Kudos
20 Replies
canwang
Deactivated User
I ve tried to get the attribute using the following way



     File dbf = new File(Environment.getExternalStorageDirectory()
     + "/islreali/TabaYeud.dbf");
     File shape = new File(Environment.getExternalStorageDirectory()
     + "/islreali/TabaYeud.shp");
     File shx = new File(Environment.getExternalStorageDirectory()
     + "/islreali/TabaYeud.shx");

     try {
            URL dbfUrl = dbf.toURI().toURL();
     EsriPlugIn epi = new EsriPlugIn("name", dbfUrl, shape.toURI().toURL(), shx.toURI().toURL());
            EsriGraphicList eGList = epi.getEsriGraphicList();
     Map<Object, Object> attr = eGList.getAttributes();
  } catch (Exception e) {
       e.printStackTrace();
  }



In the above code, it throws an error when it reach the place wher we use EsriPlugIn. I get Noclassdef error. I think this is not supported in android as read from the below link
http://openmap.bbn.com/mailArchives/openmap-users/2011-03/6671.html


Cud anyone advise me how to read the shapefile attributes by using some other method of openmap or some other api.


i get the same Noclassdef error too,then i use the openmap 5.0 instead of 5.0.1,the error is missing,i can read the data from shp file but the speed is too slow. there is another resolution,"Spatialite for Android",just google it .
0 Kudos