CIB scale OVERVIEW1

27 views
Skip to first unread message

petaga...@gmail.com

unread,
Mar 3, 2016, 9:16:16 AM3/3/16
to openmap-users
Hello, I have CIB files that A.TOC entry includes "OVERVIEW<n>" (like referenced in an older post http://openmap.bbn.com/mailArchives/openmap-users/2004-08/3094.html) :
RpfTocEntry ##################
 vertInterval 7.193092447916674E-4, horizInterval 7.411861979166693E-4
 vertResolution 79.99997574074082, horizResolution 76.10829296296323
 horizFrames 1, vertFrames 1
 zone 1
 scale OVERVIEW1
...

When using Openmap v4.6.5 there is no issue loading RPF layer with this data file.   

But when using v5.1.13 I get an exception:
textScaleToLong: Number Format Exception!!!!OVERVIEW1
Exception in thread "main" java.lang.ExceptionInInitializerError
        at com.bbn.openmap.layer.rpf.RpfConstants.<clinit>(RpfConstants.java:216
)
        at com.bbn.openmap.layer.rpf.RpfTocHandler.textScaleToLong(RpfTocHandler
.java:782)
        at com.bbn.openmap.layer.rpf.RpfTocEntry.read(RpfTocEntry.java:100)
        at com.bbn.openmap.layer.rpf.RpfTocEntry.<init>(RpfTocEntry.java:71)
        at com.bbn.openmap.layer.rpf.RpfTocHandler.parseToc(RpfTocHandler.java:3
47)
        at com.bbn.openmap.layer.rpf.RpfTocHandler.loadFile(RpfTocHandler.java:2
56)
        at com.bbn.openmap.layer.rpf.RpfTocHandler.<init>(RpfTocHandler.java:159
)
        at com.bbn.openmap.layer.rpf.RpfFrameCacheHandler.createTocHandlers(RpfF
rameCacheHandler.java:631)
        at com.bbn.openmap.layer.rpf.RpfFrameCacheHandler.<init>(RpfFrameCacheHa
ndler.java:82)
        at com.bbn.openmap.layer.rpf.RpfFrameCacheHandler.<init>(RpfFrameCacheHa
ndler.java:71)
        at com.bbn.openmap.layer.rpf.RpfLayer.setPaths(RpfLayer.java:215)
        at com.bbn.openmap.layer.rpf.RpfLayer.setProperties(RpfLayer.java:266)
        at com.bbn.openmap.util.ComponentFactory._create(ComponentFactory.java:4
92)
        at com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:39
0)
        at com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:36
9)
        at com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:32
3)
        at com.bbn.openmap.LayerHandler.getLayers(LayerHandler.java:422)
        at com.bbn.openmap.LayerHandler.getLayers(LayerHandler.java:375)
        at com.bbn.openmap.LayerHandler.init(LayerHandler.java:218)
        at com.bbn.openmap.LayerHandler.setProperties(LayerHandler.java:204)
        at com.bbn.openmap.util.ComponentFactory._create(ComponentFactory.java:4
92)
        at com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:39
0)
        at com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:36
9)
        at com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:32
3)
        at com.bbn.openmap.util.ComponentFactory._create(ComponentFactory.java:2
67)
        at com.bbn.openmap.util.ComponentFactory.create(ComponentFactory.java:18
3)
        at com.bbn.openmap.PropertyHandler.createComponents(PropertyHandler.java
:809)
        at com.bbn.openmap.gui.BasicMapPanel.createComponents(BasicMapPanel.java
:197)
        at com.bbn.openmap.gui.BasicMapPanel.create(BasicMapPanel.java:159)
        at com.bbn.openmap.app.OpenMap.configureMapPanel(OpenMap.java:91)
        at com.bbn.openmap.app.OpenMap.<init>(OpenMap.java:71)
        at com.bbn.openmap.app.OpenMap.create(OpenMap.java:176)
        at xxx.xxxx.xx.omnilayer.OmniOpenMap.main(OmniOpenMap.java:164)
Caused by: java.lang.NullPointerException
        at com.bbn.openmap.layer.rpf.RpfProductInfo.<clinit>(RpfProductInfo.java
:66)
        ... 33 more


The difference I notice from v4.6.5 line 796
if (!expValue.equals("")) {


to v5.1.13 line 763
if (expValue.length() > 0) {

Is v4.6.5 "ignoring" scale values of "OVERVIEW1/OVERVIEW2"?  Any suggestions on what to do in order to handle scale OVERVIEW<n> for CIB data in v5.1.13?
thanks
Maria Cruz


petaga...@gmail.com

unread,
Mar 12, 2016, 3:42:21 PM3/12/16
to openmap-users
Bump, any advice on handling "OVERVIEW" scale?  thanks

Don Dietrick

unread,
Mar 16, 2016, 3:42:19 PM3/16/16
to petaga...@gmail.com, openmap-users
Hi Maria,

Thanks for the bug report - I’ll have to update the  RpfTocHandler to ignore RpfTocEntries that cause scale problems.  I’ve never seen CIB/RPF overview images that are georeferenced, that must be something (relatively, maybe) new.  Weird that they just don’t include some scale number for the overview image if it otherwise conforms to the RPF spec.

- Don

petaga...@gmail.com

unread,
Mar 16, 2016, 8:08:19 PM3/16/16
to openmap-users, petaga...@gmail.com
Any code suggestion for me to update  RpfTocHandler to ignore RpfTocEntries that cause scale problems?  I would like to test the CIB data I have.
thanks
maria

petaga...@gmail.com

unread,
Mar 16, 2016, 8:47:29 PM3/16/16
to openmap-users, petaga...@gmail.com
Also I noticed when the exception is caught, you are returning the following, which is NOT a long number, but defined as "various" in RpfConstants.java
catch (NumberFormatException nfe) {
if (Debug.debugging("rpftoc")) {
Debug.output("textScaleToLong: Number Format Exception!!!!" + textScale);
}
return (long) RpfConstants.UK.scale;

RpfConstants.java
public final static RpfProductInfo UK = new RpfProductInfo("UK", "Unknown", VARIOUS, Various, "Unknown", CADRG);

maria 

Don Dietrick

unread,
Mar 16, 2016, 9:35:06 PM3/16/16
to petaga...@gmail.com, openmap-users
If you replace RpfTocHandler line 782:

return (long) RpfConstants.UK.scale;
with:

return (long) RpfConstants.Various;

does that solve the problem?

I’ve already refactored this code in the v6.0b branch, I’m just looking for a quick fix for the v5.x version.  It’s kind of a weird bug - the OVERVIEWX string isn’t tripping up the code, it looks like it’s the initial reference to the RpfProductInfo UK object. 

- Don

petaga...@gmail.com

unread,
Mar 17, 2016, 4:00:35 PM3/17/16
to openmap-users, petaga...@gmail.com
thanks!!!! that worked.  
maria
Reply all
Reply to author
Forward
0 new messages