RE: [OpenMap Users] Displaying shapeFile attributes

From: Martin Chapman <martin.chapman@softwize.net>
Date: Mon Jul 21 2003 - 19:32:11 EDT

Chris,

If you save your dbf file as a .cvs file then you can use the
CVSLoaction Handler in the properties file like so without using code.
You can turn the names on and off at different scales by not passing the
layer name into the http request querystring:

# USGS100K points with no names
usgs100k.class=com.bbn.openmap.layer.location.LocationLayer
usgs100k.prettyName=USGS 100K Quad Points
usgs100k.locationHandlers=usgs100kquadnames
usgs100k.useDeclutter=false
usgs100k.declutterMatrix=com.bbn.openmap.layer.DeclutterMatrix

# USGS100K points with no names location handlers
usgs100kquadnames.class=com.bbn.openmap.layer.location.csv.CSVLocationHa
ndler
usgs100kquadnames.prettyName=USGS 100K Quad Names
usgs100kquadnames.locationFile=data/index_100k.csv
usgs100kquadnames.csvFileHasHeader=true
usgs100kquadnames.locationColor=FF0000
usgs100kquadnames.nameColor=000000
usgs100kquadnames.showNames=true
usgs100kquadnames.showLocations=true
usgs100kquadnames.nameIndex=4
usgs100kquadnames.latIndex=0
usgs100kquadnames.lonIndex=1
usgs100kquadnames.csvFileHasHeader=true

NOTE: The first entry "# USGS100K points with no names" is the location
layer
         The second entry "# USGS100K points with no names location
handlers" specifies the .cvs file. The nameIndex field is the 0 based
field in the cvs file, in other words the index of the column that has
the text you want to display on the map. Make one layer like this that
shows the names and then another that just shows the shape like this:

### USGS 100K
shapeUSGS100K.class=com.bbn.openmap.layer.shape.ShapeLayer
shapeUSGS100K.prettyName=USGS 100K
shapeUSGS100K.shapeFile=data/shape/index_100k.shp
shapeUSGS100K.spatialIndex=data/shape/index_100k.ssx
shapeUSGS100K.lineColor=000000

Then show the ShapeLayer first and lay the names layer on top like:

&LAYERS=USGS usgs100kquadnames,usgs100k,shapeUSGS100K

That will put text on the map for a shape layer using only the
properties file.

Hope that is what you need.

Martin

-----Original Message-----
From: owner-openmap-users@bbn.com [mailto:owner-openmap-users@bbn.com]
On Behalf Of Christian Weaves
Sent: Monday, July 21, 2003 4:41 AM
To: openmap-users@bbn.com
Subject: [OpenMap Users] Displaying shapeFile attributes

Greetings!

Hope you can help, this problem shouldn't be too testing for you
experts!

I am using the Simple Http Image Server to server my map data over the
internet...

I have included a shapeFile in my openmap.properties file like so:

tellus.class=com.bbn.openmap.layer.shape.ShapeLayer
tellus.prettyName=Tellus tellus.shapeFile=data/shape/TellusBasins.shp
tellus.spatialIndex=data/shape/TellusBasins.ssx
tellus.lineColor=0066cc
tellus.fillColor=11ff0000

The shape file defines a number polygons. Each polygon has a
'basin_name' attribute. Is it possible to display the basin_name
attribute on the map with a simple command (ie. tellus.basin_name =
visible) or is more work required?

I have searched the API documentation but couldn't find any relevant
information. Thanks in advance, Chris!

-- 
Robertson Research International             Telephone: +44+ (0)1492
581811
Tyn-y-coed Site                                    Fax: +44+ (0)1492
583416
Llanrhos                                         
Llandudno                                               
North Wales
UK   LL30 1SA                                             
General Email: info@robresint.co.uk          Encryption Type Acceptable:
uuencoded 
World Wide Website: www.robresint.co.uk
 ********************************************************************
 * This email may contain  confidential and  privileged information *
 * intended solely for the individual or organisation to whom it is *
 * addressed. If the reader is not the  intended  addressee, or the *
 * employee  or agent responsible  to deliver  it to the addressee, *
 * you are hereby notified that any  dissemination, distribution or * 
 * copying is strictly prohibited.  If you have received this email *
 * in error, please notify the  sender and either destroy the email * 
 * or return it to info@robresint.co.uk                             *
 * Please note this email is not intended to create legal relations.*
 ********************************************************************
--
[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"]
--
[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 Mon Jul 21 19:29:30 2003

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