Re: [OpenMap Users] Array Index Out of Bounds

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 27 Apr 2005 18:27:16 -0400

I'm not sure the ScaleFilterLayer handles plugins defined without
explicitly defining the PlugInLayer in the properties, and then
defining the plugin in the PlugInLayer properties.

The LayerHandler, which reads the openmap.layers property list and
creates the layers, is smart enough to check to see if the object in
the list is a PlugIn, and will create the PlugInLayer for that new
PlugIn. The ScaleFilterLayer doesn't do this (I'd say this is an
oversight).

- Don

On Apr 27, 2005, at 11:50 AM, James R Erickson wrote:

> All,
>
> I am trying to use the EarthImagePlugIn to display an earth image
> and then as I zoom in I would like to display a CADRG. I got this
> to work using the ScaleFilterLayer class and a shapefile instead of
> the earth file but I'm getting an Array Index Out of Bounds Error
> when I try it with the Earth Layer. I can display the earth file by
> itself as well. Also is the search engine down for searching the
> archives?? My properties files looks like this:
>
> # MAP STARTUP PROJECTION PARAMETERS
> # Latitude and longitude in decimal degrees
> openmap.Latitude=20f
> openmap.Longitude=-20f
> # Scale: zoom level (1:scale)
> openmap.Scale=3000000000f
>
> openmap.Projection=com.bbn.openmap.proj.CADRG
>
> # APPLICATION WINDOW DIMENSIONS
> # Width and Height of map, in pixels
> openmap.Width=640
> openmap.Height=480
>
> # WINDOW STARTUP LOCATION
> # pixel X/Y window position (if values < 0, then center the window
> on the screen)
> openmap.x=-1
> openmap.y=-1
>
> openmap.layers=scaledLayers
> openmap.startUpLayers=scaledLayers
>
> #ScaledLayers uses the ScaleFilterLayer to switch between layers at
> certain scales.
> scaledLayers.class=com.bbn.openmap.layer.ScaleFilterLayer
> scaledLayers.prettyName=All Layers
> #scaledLayers.layers=shapePolitical jrpf
> scaledLayers.layers=earthImage jrpf
> scaledLayers.transitionScales=10000000
>
> ### Java RPF properties
> jrpf.class=com.bbn.openmap.layer.rpf.RpfLayer
> jrpf.prettyName=CADRG
> # This property should reflect the paths to the RPF directories
> jrpf.paths=data/CADRG/RPF
> # Number between 0-255: 0 is transparent, 255 is opaque
> jrpf.opaque=255
> # Number of colors to use on the maps - 16, 32, 216
> jrpf.number.colors=216
> # Display maps on startup
> jrpf.showmaps=true
> # Display attribute information on startup
> jrpf.showinfo=false
> # Scale images to fit the map scale
> jrpf.scaleImages=true
> jrpf.imageScaleFactor=250000/4
> jrpf.killCache=true
> jrpf.chartSeries=ANY
> jrpf.autofetchAttributes=false
> jrpf.coverage=true
> jrpf.subframeCacheSize=1
> jrpf.auxSubframeCacheSize=1
>
> earthImage.class=com.bbn.openmap.plugin.earthImage.EarthImagePlugIn
> earthImage.prettyName=Earth Image Layer
> earthImage.image=file:///C:/openmap-4.6.2/share/data/earth/
> wsiearth.tif
>
>
> This is the error along with some debugging statements:
>
> ScaleFilterLayer.parseLayers(): Instantiated
> com.bbn.openmap.plugin.earthImage.EarthImagePlugIn
> ScaleFilterLayer.parseLayers(): Instantiated
> com.bbn.openmap.layer.rpf.RpfLayer
> Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
> at com.bbn.openmap.layer.ScaleFilterLayer.parseScales
> (ScaleFilterLayer.java:296)
> at com.bbn.openmap.layer.ScaleFilterLayer.setProperties
> (ScaleFilterLayer.java:162)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:440)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:346)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:298)
> at com.bbn.openmap.LayerHandler.getLayers(LayerHandler.java:
> 365)
> at com.bbn.openmap.LayerHandler.getLayers(LayerHandler.java:
> 320)
> at com.bbn.openmap.LayerHandler.init(LayerHandler.java:204)
> at com.bbn.openmap.LayerHandler.setProperties
> (LayerHandler.java:190)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:440)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:346)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:298)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:236)
> at com.bbn.openmap.util.ComponentFactory.create
> (ComponentFactory.java:161)
> at com.bbn.openmap.PropertyHandler.createComponents
> (PropertyHandler.java:826)
> at com.bbn.openmap.gui.BasicMapPanel.createComponents
> (BasicMapPanel.java:170)
> at com.bbn.openmap.gui.BasicMapPanel.create
> (BasicMapPanel.java:129)
> at com.bbn.openmap.gui.BasicMapPanel.<init>
> (BasicMapPanel.java:117)
> at com.bbn.openmap.gui.BasicMapPanel.<init>
> (BasicMapPanel.java:102)
> at com.bbn.openmap.app.OpenMap.<init>(OpenMap.java:72)
> at com.bbn.openmap.app.OpenMap.create(OpenMap.java:162)
> at com.bbn.openmap.app.OpenMap.main(OpenMap.java:183)
>
> --
> Jimmy Erickson
>
>
> --
> [To unsubscribe to this list send an email to "majdart_at_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_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Apr 27 2005 - 18:27:46 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT