Re: [OpenMap Users] Reading shp files with the OpenMap classes

From: Don Dietrick <>
Date: Fri, 23 Sep 2005 09:52:56 -0400

Hi Dave,

I think you are seeing the effect of OpenMap OMGraphics and
Projections not being able to handle projection data coordinates.
They require pixel coordinates or decimal degree lat/lon data.

On Sep 23, 2005, at 9:19 AM, Dav Stott wrote:

> Dear all,
> I'm using the com.bbn.openmap.dataAccess.shape classes from some
> Coldfusion scripts to read the contents of ESRI .shp files and have
> been largely successful, so thanks all round for OpenMap!
> I can read everything I need to from both points and polygons, but
> have a bit of a puzzling issue with the polygon vertex coordinates.
> My .shp files always have their coordinates stored as x & y values
> against the UK national grid.
> Reading the coordinates of a point is simple enough, I call the
> getLat() and getLon() methods and the numbers are returned exactly
> as they exist in the .shp file.
> However, when I look at the results of getLonLatArray() from the
> EsriPolygon object, the numbers come out scaled down by a factor of
> approximately 57.29.
> The javadoc suggests that all lat & lons are stored internally as
> radians. The units themselves are largely irrelevant as I'm not
> processing them at all using the OpenMap classes.

I'm not sure that's true. The coordinates are expected to be decimal
degree lat/lon data, and the coordinates may be outside the range of
-180/180, -90/90, which would cause them to be unwrapped until they

> In a straw clutching moment, I tried putting the getLonLatArray()
> through ProjMath.arrayRadToDeg() in the hope that would undo
> whatever transformation was applied when the EsriPolygon objects
> were created, but that wasn't helpful either.
> I guess my question is:
> - what transformation is occuring with the polygon coordinates that
> isn't with
> the point coordinates?

Nothing, both get converted to radians before projection (and then

> - and what, exactly, is the inverse operation?

The inverse operation is the method for the projection to translate
window x/y coordinates into lat/lon space.

- Don

Don Dietrick,
BBN Technologies, Cambridge, MA

[To unsubscribe to this list send an email to ""
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Fri Sep 23 2005 - 09:53:18 EDT

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