RE: [OpenMap Users] Discovering the minimum scale at which an RPF layer will show

From: Laura Paterson <laura.paterson_at_generaldynamics.uk.com>
Date: Mon, 7 Mar 2005 16:08:12 -0000

sorry, I don't think I was explaining myself very well.

I have attached a couple of screen shots, to see if I can be any clearer.

In another part of my application I have an object which has a geographic
location and coverage. The user can opt to view this object's coverage on
the map. As I know the bounding box of this object, I calculate the object
centre point in order to create a new projection. Previously I was also
using Projection.getScale to work out what scale this projection use.

As you can see in screen shot view_area.jpg, this results in the object
taking up all available height or width of the screen. This object is quite
large (approx 4 miles wide), so we can see some RPF being displayed, but it
is displaying at the scale determined by Projection.getScale, not the
preferred scale of that RPF coverage. My objects can be only a few metres
long, therefore usually the scale determined by Projection.getScale is too
small to see any detailed mapping that we have.

The second screen shots shows the same object selected on the map, but it is
being viewed at 1:500K, the scale of the mapping data. This is the effect I
want to create programmatically.

When I first create the projection that I want to move to, I output the
following for each RPF layer:

   System.out.println(rpf.getName() + " getCoverageBoxes =
"+rpf.getCoverageBoxes().size());
   Vector cvgs = rpf.getFrameProvider().getCoverage((float)minLat,
(float)minLon, (float)maxLat, (float)maxLon, (CADRG)proj);
   System.out.println(rpf.getName() + " fProvider.getCoverage for area =
"+cvgs.size());


My output is:

ONC9 getCoverageBoxes = 0
ONC9 fProvider.getCoverage for area = 0
ONC5 getCoverageBoxes = 0
ONC5 fProvider.getCoverage for area = 0
ONC4 getCoverageBoxes = 0
ONC4 fProvider.getCoverage for area = 0
ONC3 getCoverageBoxes = 0
ONC3 fProvider.getCoverage for area = 0
High Level CADRG getCoverageBoxes = 0
High Level CADRG fProvider.getCoverage for area = 0

I have tried zooming through all levels of mapping in this area, to ensure
that the layers are loaded. They all become visible, but there are still no
coverage boxes reported.

I was just re-running through the above steps to make sure i haven't missed
anything, and I noticed that if I am currently viewing a particular RPF
layer, then ask the map to create the new projection, it will discover
coverages for the layer it is on. However, if I then move out of that
layers scale, it no longer finds it...
Here is the output from this, in order and without restarting/ reloading
anything...

ONC9 getCoverageBoxes = 0
ONC9 fProvider.getCoverage for area = 0
ONC5 getCoverageBoxes = 0
ONC5 fProvider.getCoverage for area = 0
ONC4 getCoverageBoxes = 1
ONC4 fProvider.getCoverage for area = 1
ONC3 getCoverageBoxes = 0
ONC3 fProvider.getCoverage for area = 0
High Level CADRG getCoverageBoxes = 0
High Level CADRG fProvider.getCoverage for area = 0

ONC9 getCoverageBoxes = 0
ONC9 fProvider.getCoverage for area = 0
ONC5 getCoverageBoxes = 1
ONC5 fProvider.getCoverage for area = 0
ONC4 getCoverageBoxes = 1
ONC4 fProvider.getCoverage for area = 1
ONC3 getCoverageBoxes = 0
ONC3 fProvider.getCoverage for area = 0
High Level CADRG getCoverageBoxes = 1
High Level CADRG fProvider.getCoverage for area = 1

ONC9 getCoverageBoxes = 0
ONC9 fProvider.getCoverage for area = 0
ONC5 getCoverageBoxes = 0
ONC5 fProvider.getCoverage for area = 0
ONC4 getCoverageBoxes = 1
ONC4 fProvider.getCoverage for area = 1
ONC3 getCoverageBoxes = 0
ONC3 fProvider.getCoverage for area = 0
High Level CADRG getCoverageBoxes = 1
High Level CADRG fProvider.getCoverage for area = 1

ONC9 getCoverageBoxes = 0
ONC9 fProvider.getCoverage for area = 0
ONC5 getCoverageBoxes = 0
ONC5 fProvider.getCoverage for area = 0
ONC4 getCoverageBoxes = 1
ONC4 fProvider.getCoverage for area = 1
ONC3 getCoverageBoxes = 0
ONC3 fProvider.getCoverage for area = 0
High Level CADRG getCoverageBoxes = 1
High Level CADRG fProvider.getCoverage for area = 1

ONC9 getCoverageBoxes = 0
ONC9 fProvider.getCoverage for area = 0
ONC5 getCoverageBoxes = 0
ONC5 fProvider.getCoverage for area = 0
ONC4 getCoverageBoxes = 0
ONC4 fProvider.getCoverage for area = 0
ONC3 getCoverageBoxes = 0
ONC3 fProvider.getCoverage for area = 0
High Level CADRG getCoverageBoxes = 1
High Level CADRG fProvider.getCoverage for area = 1

Please help - I think I am misunderstanding something here...!

Thanks, Laura


-----Original Message-----
From: Don Dietrick [mailto:dietrick_at_bbn.com]
Sent: 07 March 2005 15:00
To: Laura Paterson
Cc: openmap-users_at_bbn.com
Subject: Re: [OpenMap Users] Discovering the minimum scale at which an
RPF layer will show


Hi Laura,

The code you have is exactly what you want to use. I guess I don't
understand the difference between asking for coverage for a point, and
your problem with having the bounding box in the query being too small.
  It seems like they would both provide the same answer.

Has the RpfLayer been added to the map? The RpfTocHandler doesn't read
the A.TOC file until it needs to display something, so it probably
wouldn't know anything until then.

- Don


On Mar 7, 2005, at 9:29 AM, Laura Paterson wrote:

> Hi Don,
>
> Thank you for your reply.
>
>> You can ask the RpfLayer for it's RpfCoverageProvider, and then ask it
>> for it's coverage over a specific area. Those coverages will tell you
>> what scale you need to view that data. The coverage will viewable at
>> that scale * or / by the scaleFactor of that value.
>
> Ok, I have tried that, but it doesn't quite do what I am looking for.
> Here
> is the code that I used:
>
> for (int i = 0; i < layers.length; i++) {
> if (layers[i] instanceof RpfLayer) {
>
> RpfLayer rpf = (RpfLayer)layers[i];
> RpfFrameProvider fProvider =
> rpf.getFrameProvider();
> Vector cvgs =
> fProvider.getCoverage((float)minLat, (float)minLon, (float)maxLat,
> (float)maxLon, (CADRG)proj);
> for (int j=0; j<cvgs.size(); j++) {
> RpfCoverageBox box =
> (RpfCoverageBox)cvgs.get(j);
> System.out.println(layers[i].getName()
> + "
> scale from coverage = "+box.scale);
> minScale = Math.min(minScale,
> box.scale);
> }
> }
> }
>
>
> Unfortunately there area never any coverages for this bounding box,
> because
> it covers such a small area...
> I tried replacing the Vecor cvgs line with : Vector cvgs =
> rpf.getCoverageBoxes(); However, this Vector is always empty.
>
> I guess what am looking for (ideally!) is to be able to specify a
> point,
> and ask at what scales will this point have rpf coverage. Is there
> anything
> in the API that can help me achive this?
>
> Thanks,
>
> Laura
> This email and any files attached to it are of a confidential nature
> and
> intended for the exclusive use of the individual or entity to whom
> they are
> addressed. If you are not the intended recipient, please be advised
> that you
> have received this email in error and action should be taken to inform
> the
> originator and this email should be deleted immediately and any copies
> made
> should be destroyed. If you are not the intended recipient, any form of
> disclosure, distribution, printing, copying or any other use of this
> email
> or the information in it or in any attachments is strictly prohibited
> and
> may be unlawful. Any views, opinions or other information expressed in
> the
> email and any attachments are those of the originator and not given or
> endorsed by General Dynamics UK Ltd.In compliance with the various
> Regulations and Acts, please be aware that General Dynamics UK Ltd
> reserves
> the right to monitor all emails and email attachments, both inbound and
> outbound, allowing legitimate business practice to continue.In
> addition to
> monitoring, General Dynamics UK Ltd also provides appropriate Antivirus
> measures scanning all incoming and outgoing email and email
> attachments.
> However, email communications cannot be guaranteed to be secure or
> free of
> errors as information may be intercepted, corrupted, amended, lost,
> destroyed or contain viruses. General Dynamics UK Ltd do not accept
> liability or responsibility for any such matters or the consequences
> thereof.
>
> --
> [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"]
>
>


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don Dietrick, dietrick_at_bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
This email and any files attached to it are of a confidential nature and
intended for the exclusive use of the individual or entity to whom they are
addressed. If you are not the intended recipient, please be advised that you
have received this email in error and action should be taken to inform the
originator and this email should be deleted immediately and any copies made
should be destroyed. If you are not the intended recipient, any form of
disclosure, distribution, printing, copying or any other use of this email
or the information in it or in any attachments is strictly prohibited and
may be unlawful. Any views, opinions or other information expressed in the
email and any attachments are those of the originator and not given or
endorsed by General Dynamics UK Ltd.In compliance with the various
Regulations and Acts, please be aware that General Dynamics UK Ltd reserves
the right to monitor all emails and email attachments, both inbound and
outbound, allowing legitimate business practice to continue.In addition to
monitoring, General Dynamics UK Ltd also provides appropriate Antivirus
measures scanning all incoming and outgoing email and email attachments.
However, email communications cannot be guaranteed to be secure or free of
errors as information may be intercepted, corrupted, amended, lost,
destroyed or contain viruses. General Dynamics UK Ltd do not accept
liability or responsibility for any such matters or the consequences
thereof.
    




--
[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"]

view_area.jpg
(image/jpeg attachment: view_area.jpg)

view_area_correct_scale.jpg
(image/jpeg attachment: view_area_correct_scale.jpg)

Received on Mon Mar 07 2005 - 11:10:25 EST

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