Re: [OpenMap Users] Re[2]: Data Access Problem (ESRI Shapefile)

From: Don Dietrick <dietrick@bbn.com>
Date: Fri Mar 28 2003 - 09:39:04 EST

Hi Vladimir,

On Friday, March 28, 2003, at 08:48 AM, Vladimir Cotfas wrote:

> Hello Don,
>
> DD> Is the gid the index (row number) of the shape, or some field in
> the
> DD> dbf file?
> DD> The _list is expecting the row number, and it might be row - 1.
> The
> DD> list index starts at 0, and I think the table row indexes start at
> 1.
> It is the first field in the dbf file. The set of gid's has "holes"
> (i.e.
> I took a bigger map and I eliminated some streets [using
> PostGIS/Postgres] - one may have the set of gid's like {2, 9, 10, 11,
> 12}).
>
> However there is a one-to-one relationship [based on gid] between
> records in all
> three files.

I think this is the problem. You are using the gid as the index when
you call _list.getOMGraphicAt(gid), when the gid has nothing to do with
the index of the shape in the file after you edit it. If you reset the
gids to reflect where that shape is in the file, it should work
(although you would want to call _list.getOMGraphicAt(gid -1)).

>>> My data is of type=3 (Polyline). I cast omg to an EsriPolyLine egr.
>>> Then I look at egr.getExtents() and I find the values to be
>>> _incorrect_.
> DD> I'm not sure why that is. Those extents should be set when the
> data
> DD> file is read and the list is created. Are you able to view the
> data if
> DD> you load the shp file into the EsriPlugIn?
> YES, correctly. But EsriPlugIn won't put on its layer any ancillary
> data
> from the dbf file
>
> As a side note [not related to my modifications]: if one configures
> the mouse
> to give the Distance when I point at a certain street and then I
> enlarge the
> circle a tooltip will appear on the screen presumably showing the
> street name.
> The caption is incorrect and always shows the same street name.
>
> [I've tried this by running bin/openmap multiple times using the same
> dataset -- the _same_ street name shows up].
>

The code that figures out what the tooltip text should be does a
reverse lookup based on its own index, so it should be finding the
right entry in the DbfTableModel. I'd check to see what index the
street thinks it is when the EsriPlugIn gets a mouseMoved() event.

- Don

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, BBN Technologies, dietrick@bbn.com
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 Fri Mar 28 09:39:31 2003

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:35 EDT