Re: Query on OpenmapApplet with Link Server ...

From: Donald F. Dietrick <dietrick@bbn.com>
Date: Wed May 23 2001 - 14:07:24 EDT

Hi Pradeep,

Responses inline...

PRADEEP RAMACHANDRAN wrote:
>
> Hello Don,
>
> This is with regard to a query in this list on providing colors with the link
> layer ... there were a couple of things I needed help in figuring out ... this
> long mail is a fallout of that ... !
>
> >that is, it takes a csv file to organize to a shape >file. Specifying the shape
> >file, and the
> >csv file, can take place on the server side. You >could also have the properties
> >on how you want the >areas colored simply read in on the server side.
>
> Woud this be similar to what the AreaHandler does for AreaShapeLayer ... , viz.
> From what I could understand of the AreaHandler ... upon initialising, it seems
> to be reading the csvfile (using CSVShapeInfoFile) records and storing the tokens
> ( ID ) for the areas property (for which the special attributes are being set)
> onto a vector (areaItems).
>
> At the same time the AreaHandler seems to use a DrawingAttributes object to load
> the specialised attributes for each ID onto a HashTable ( drawingParams ), the
> key being the the ID for the area and the AreaDrawParams object as the value for
> that key.
>
> The getGraphics method in AreaHandler reads in records from the shapefile and for > each record creates a new Vector with the fields in that record - ( Vector info =
> infoFile.getRecord(recordNumber-1); ) . A keyIndex obtained earlier would then > be used to extract from this vector the ID for the area.
>
> This ID would then be used to fetch the corresponding AreaDrawParams object (
> value ) from the hashtable. This AreaDrawParams object would then be added to the
> OMGraphicsList for that record and the record number is saved in setAppObj() ...
>
> Would these deductions be accurate as far as the AreaHandler goes ... ?!

Yes, exactly.

> Coming back to the LinkLayer or rather the ShapeLinkServer, could the same
> mechanism be used to read the file? If so, how would the Properties be set
> afterwards. For when you say - have the server read in the properties does it
> mean read from a local properties file or from the link ? Either way, the
> writeLinkGraphics method of ESRILinkRecord writes the record to the
> LinkGraphicList param it receives ... would preceding this step with
> "esrilinkrec.addOMGraphics(recList, drawParams.drawingAttributes); " as in the
> AreaHandler do the trick with the ShapeLinkServer too ... and can the
> DrawingAttribute and AreaDrawParams objects be used like this by the
> ShapeLinkServer.

In order to get defined areas to work for a LinkServer, modifications
will have to be made to the ShapeLinkServer - right now it contains a
reference to a LinkSpatialIndex, which is an extension to the
SpatialIndex in the shape package. You might have to write a
AreaShapeLinkServer, that uses an AreaHandler instead, modified in the
same way that the LinkSpatialIndex was modified to use the link to write
graphics onto, instead of creating OMGraphics.

How the properties are set depends on how much control you want to
provide to the user to change things. I think I'd opt for the server,
or who ever launches the server, to determine how the graphics are
rendered. The ShapeLinkServer/ShapeServerStarter would have to be
extended/modified so that it is launched with a properties file
containing the DrawingAttributes properties for the areas. You could
also have it contain the shape and spatial index file properties in it,
too, since the drawing attributes depend on those.

If you want the client to have some control over the drawing attributes,
you could add code to use the link request properties to reset some of
those values when they come in.
 
> ShapeLinkServer seems to be reading in properties from the link based on the
> LinkPropertiesConstants, if the interpretation of reading from the link is right,
> would it be possible to read in other specialized attributes also from the link
> and set these in the LinkGraphicsList ? Would new link property constants need
> to be defined to support this ... ?

The key values of the property list do not have to be defined as a link
property constant. The ones that are defined are those used by the link
package components, for convenience. But you can pass any key-values
you want. The ones that the server can understand will be used - this
also implies that the server is actually under no contract to act on the
property keys that are defined as LinkPropertyConstants.

- Don

--
[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 May 23 14:07:38 2001

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