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 linkhttp://openmap.bbn.com/mailArchives/openmap-users/2011-03/6671.htmlCud anyone advise me how to read the shapefile attributes by using some other method of openmap or some other api.
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(); }
Can you tell me how to use the openmap after add the lib?or show me a sample/tutorial of open shape file from SD card by openmap.
Download code from:http://www.openmap.org/and then point to the jar files in the "lib" directory through the Java Build Path Libraries Tab in Eclsipse
"From where will I get SimpleMarkerSymbol class. I downloaded openmap 5.0 and the jars from there but could not find SimpleMarkerSymbol , Envelope , SpatialReference classes?"
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; }
where to store the shapefiles in sd card (location path)?
Please can you say to us where download from? and how use it, and if can you be a little more specific, I'm rookieThanks!
you can work with openmap it has a class SHapefile and try to transform your shapefile to an graphicslayer it will work i've already done it
i'd like to know 2
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.