Re: [OpenMap Users] How to retrieve names of places from OpenStreetMap data?

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Fri, 6 Jul 2012 13:15:33 -0400

Hi Liu,

Do you know what version of OpenMap the GIS module is using?

Anyway, the OMGraphic.getAttributes will not give you what you are looking for. Those key-value pairs are stored somewhere else. Each OMGraphic should have a index stored under the com.bbn.openmap.dataAccess.shape.ShapeConstants.SHAPE_INDEX_ATTRIBUTE key. That will tell you the index of the shape from the shape file. The table holding the attributes is stored in the top level list attributes, under the DBF_ATTRIBUTE key. Asking the top level list for the DBF_ATTRIBUTE will get you the DbfTableModel, which holds all the attributes. You can ask it for column information, and for values at particular indexes (which you retrieve from the OMGraphic).

If you want to use the OpenMap API directly on your shape files, you can use the com.bbn.openmap.dataAccess.shape.EsriGraphicList to create an OMGraphicList from the file that holds the information I've described. That might be a more direct route.

Hope this helps,

Don

On Jul 4, 2012, at 9:38 AM, Bin Liu wrote:

> Hi,
>
> I am new to GIS and just start to learn OpenMap. Now I meet a basic problem that is how to get info of places, such as buildings, streets and so on. My work is based on a software having a GIS module based on OpenMap. Using that software's API, I can get the com.bbn.openmap.layer.shape.areas.AreaShapeLayer instance. Then by areaShapeLayer.getAreas().getGraphics().getOMGraphicAt(i), I can access to each OMGraphic, such as OMPoly and OMPoint. But oMGraphic.getAttributes() returns null, which I expected to get the Key-Value Map info. My sample data is OpenStreetMap data from http://metro.teczno.com/, and I convert it to shp and dbf files by Quantum GIS with OpenStreetMap plugin. In both OpenStreetMap and Quantum, I can read place info, such as ABC school or XYZ hospital. In my software with OpenMap module, I can also see the signs of places, like OMPoint? But I need to know how to retrieve these info, like names by Op! enMap API. Please Help!
>
> Best regards,
> Liu, Bin
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Jul 06 2012 - 13:16:18 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT