Re: fun with ESRI shapefiles

From: Don Dietrick <dietrick@bbn.com>
Date: Wed Jan 30 2002 - 11:09:58 EST

Hi Matt,

On Tuesday, January 29, 2002, at 10:35 PM, Matthew McKeon wrote:

>
> Hi folks.
> I pulled down a sample of AND's global road data
> from the ESRI website
> (http://www.esri.com/data/online/and/sampleusadata.html)
> and have been having a devil of a time
> getting it to work in OpenMap.
> I hope someone here might have some insights
> into my problems.
>
> First, since I didn't know about the EsriLayer class
> (I haven't looked at OpenMap for a while)
> I generated ssx's for each shp
> and converted the dbfs to csv's via Excel.
> The conversion left several suspicious characters
> in the csv, but I deleted them and things looked
> kosher. However, when I tried to use an
> AreaShapeLayer to display the data,
> a bunch of errors were thrown along the lines of
> "Don't have information for shape record X".
> I turned on the debug.csv flag and discovered
> that the CSVFile parser wasn't reading in ANYTHING
> from the csv file. I banged my head against this
> for a while, and eventually gave up.

Deleting the characters messes up the csv file, and somehow messes up
the reading of it.. I just tried it with the road data, not changing
the characters, and all's well.

Right now the AreaHandler doesn't use what it finds in the nameIndex of
the file other than to put that name in the InfoLine of the OpenMap app
when that object is gestured over (Gestures mouse mode). You could
modify the AreaHandler to create an OMText object to put on the map.

> Finally, after looking through the list archives
> a bit, I discovered the EsriLayer class
> in com.bbn.openmap.plugin.esri.
> Unfortunately, the first time I ran with it
> the only thing I saw on the map
> were the outlines of the features.
> I had to muck around a bit
> (modifying EsriLayer to set the DrawingAttributes
> on the ShpInputStream in order to get the fill
> and line colors right) in order to get the drawing
> attributes set properly.

Use the EsriPlugIn instead. It lets you set the drawing attributes in
the properties file, and the palette shows the dbf contents in a table.
If you highlight a row in the table, the map object associated with it
highlights, and in the Gesture mouse mode, clicking on a map object will
highlight the table entry.

> So, while I've managed to use this
> to duplicate the functionality of ShapeLayer,
> it's still not enough, since I'd also like to see
> labels for the names of various features
> (highways, names, etc) appear as specified in
> the .dbf file.

That you'll have to do yourself, in both cases.

> So, er, how can I do this?
> Is there some ready-made solution that I'm missing,
> or am I really going to have to get down and dirty
> to get the information from that dbf file
> up on the map?

Yep. The info is accessible in both cases, though. You just have to
decide where to put it.

> Ugh.

Yep.

- Don

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick@bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
[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 Wed Jan 30 11:10:47 2002

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