Hi Joonhwan,
The contents of the dbf attribute data file may be different for each
dataset, so that's what you are seeing when you inspect them. There may
not be a simple solution that works for all types of data, but data from
the same producer should be pretty similar.
There is an implicit relationship between the order of the graphics in
the .shp file and the order of the entries in the .dbf file, which is
how you resolve the two - that's the index.
I just took a look at the SpatialIndex object, and there doesn't seem to
be a way to get a graphic based on an index - but you can write a method
to do that based on the locateRecords method, where you can jump to the
right point in the spatial index file, and from that place in that file,
find the file offset into the shape file to get the graphic coordinates
for that graphic. There may be an off-by-one issue if you deal with the
CSVInfoFile. Check the com.bbn.openmap.layer.shape.areas.AreaHandler
object for details on how it deals with it.
Hope this helps,
Don
On Saturday, September 15, 2001, at 10:25 AM, Joonhwan Lee wrote:
> Thanks for your reply. and sorry for bugging you again.
> I tried as you advised, but still am very confusing.
> Can you give me more explanation for getting Lat/Lon?
> First, I don't know what kind of index am I getting.
> I took a look at several street data, and all the fields in dbf files
> are different.
> Also after getting index, I don't know what to do.
> Am I getting ESRIRecord object with that index as a result?
>
> Thanks,
> Joonhwan
>
>
> -----Original Message-----
> From: Donald Dietrick [mailto:dietrick@bbn.com]
> Sent: Saturday, September 08, 2001 3:17 PM
> To: joonhwan@cmu.edu
> Cc: openmap-users@bbn.com
> Subject: Re: Getting LAT/LON coordination?
>
> Hi Joonhwan,
>
> This functionality isn't built into OpenMap, but you could use parts of
> OpenMap to do it. Right now, the main obstacle you'll have to get
> around is accessing the address information out of the dbf files. You
> have a couple of options:
>
> 1. Doug Van Auken submitted a package that reads dbf file that goes
> with his implementation of a ShapeLayer. That package hasn't been
> integrated into the OpenMap package yet, but it's available for
> download on the submissions page of the OpenMap website
> (http://openmap.bbn.com).
>
> 2. You can convert the dbf file to a csv file (using Excel), and use
> OpenMap components to access it. The com.bbn.openmap.layer.shape.areas
> package is an example of how to tie csv files and shape files together.
>
> If you find the street address in the data file, you will have the
> index of the corresponding graphic in the shape file, and you can
> access that graphic with the com.bbn.openmap.layer.shape components (I
> think SpatialIndex). You may have to play around with address ranges
> from the database file to interpolate a specific point. Anyway, that
> graphic will have the coordinates for that address.
>
> Hope this helps,
>
> Don
>
>
> On Saturday, September 8, 2001, at 03:24 AM, Joonhwan Lee wrote:
>
> Hello,
>
> I would like to get latitude and longitude coordination from street
> theme.
> Is it possible to do with OpenMap?
> I'm going to use ESRI Shape files.
>
> Thanks,
> Joonhwan Lee
>
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Donald F. Dietrick, dietrick@bbn.com
BBN Technologies, 10 Moulton Street, Cambridge, MA 02138
617.873.3031 FAX 2794
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Tue Sep 18 11:52:00 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT