[OpenMap Users] finding extents of map?

From: Ben Podoll <benjamin.podoll_at_und.edu>
Date: Sun, 8 Aug 2004 00:24:57 -0500

I am having trouble finding the extents of my display (am I doing it

Projection proj = basicMapPanel.getMapBean().getProjection();
LatLonPoint upperLeft = proj.getUpperLeft();
LatLonPoint lowerRight = proj.getLowerRight();
println("center: " + proj.getCenter().toString());
println("upper left: " + upperLeft.toString());
println("lower right: " + lowerRight.toString());
println("width: " + String.valueOf(proj.getWidth()));
println("height: " + String.valueOf(proj.getHeight()));
println("scale: " + String.valueOf(proj.getScale()));
println("upper left (x,y): " + proj.forward(upperLeft));
println("lower right (x,y): " + proj.forward(lowerRight));

Here is my output:

center: LatLonPoint[lat=43.724747,lon=-94.012375]
upper left: LatLonPoint[lat=56.325226,lon=-120.36881]
lower right: LatLonPoint[lat=27.789461,lon=-67.65593]
width: 1600
height: 1200
scale: 1.2E7
upper left (x,y): java.awt.Point[x=0,y=0]
lower right (x,y): java.awt.Point[x=1600,y=1200]

My display GUI is very small and it states that the lower right corner is
1600,1200? But that is the resolution of my entire screen, and the GUI is
way smaller.

The whole reason for this is that I want to determine what shapes (in a
shapefile) are valid for my current view. Per a previous response to another
email I sent to the openmap userlist I am using a SpatialIndex like so:

SpatialIndex si = new
ESRIRecord[] shapes = si.locateRecords(?, ?, ?, ?);

But I don't know what to put for the locateRecords() parameter... Can
someone give me a pointer? I assume it is x,y values which I don't know how
to give.

[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 Sun Aug 08 2004 - 01:29:40 EDT

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