[OpenMap Users] Projections and loading (Shape '.prj')...

From: JR Andreassen <janrune_at_io.com>
Date: Tue, 03 Oct 2006 10:43:47 -0500

 Does anybody know or have anyone made anything to read the accompanying
'.prj' files with shape files ?

There are two issues or question.
Have anyone made any routines to parse the '.prj' files ?

How do I map a projection into the com.bbn.openmap.proj.Proj.
It would solve several problems I have with dataset's comming from
different sources.
The default to I use for OpenMap is:
Some of my other sources use :

How do I load the projection ?

I found the class :com.bbn.openmap.proj.LambertConformalLoader, but I
can't figure out what to load from and what the
syntax is.
The next issue is how to either chain them or load a spesific one for a
dataset or shape file.

I couldn't figure out exactly what the algorithm is for projecting.
 From what I remember from my graphics class( it's been a while), we
allways used point(vector) transformation(matrix) operations.
The nice thing about that approach is that you can chain the ops, sorry
if I telling anyone what they already know.

I couldn't find any matrecies in the proj class or it's children so I
assume it's not done that way.
If someone could either give me a brief desrciption of how it's done and
why, or where to find the info, that would be great.

If anyone could shed some light on this, I'd appriciate it.
I found this entry in the Mail Archives from : Rob Ratcliff

I'm writing a simple little client that queries a ArcGIS server for data.
The data is in the
NAD_1983_StatePlane_Texas_Central_FIPS_4203 projection which is defined as:

32139 NAD_1983_StatePlane_Texas_Central_FIPS_4203

I have to give it an envelope with the coordinates defined in it's
coordinate system. I'm using the CADRG projection within OpenMap.

After fiddling with it awhile and bugging Don and others with questions, I
came up with this approximation:

         double factor = 5280*1.1508;
         // origin of local coordinate system
         float lat0 = 29.666667f;
         float lon0 = -100.333333f;
         float x0 = 2296583.333333f;
         float y0 = 9842500.0000f;

         // bounds of openmap screen
         float minx = this.getProjection().getUpperLeft().getLongitude();
         float maxy = this.getProjection().getUpperLeft().getLatitude();
         float maxx = this.getProjection().getLowerRight().getLongitude();
         float miny = this.getProjection().getLowerRight().getLatitude();

         // calculate bounds in local coordinate system
         double rminx = factor*Geo.distanceNM(lat0,lon0,lat0,minx) + x0;
         double rmaxx = factor*Geo.distanceNM(lat0,lon0,lat0,maxx) + x0;
         double rminy = factor*Geo.distanceNM(lat0,lon0,miny,lon0) + y0;
         double rmaxy = factor*Geo.distanceNM(lat0,lon0,maxy,lon0) + y0;

         lines.append("<ENVELOPE minx='"+rminx+"' miny='"+rminy+"' " +"maxx='"+rmaxx+"' maxy='"+rmaxy +"' " +
                                                                "name='Initial_Extent' />");
         //lines.append("<MAPUNITS units=\"decimal_degrees\" />");
         //lines.append("<FILTERCOORDSYS id='32139' />");
         //lines.append("<FEATURECOORDSYS id='4326' />");
         lines.append("<MAPUNITS units='feet' />");

Unfortunately, I'm off by 10,000 ft or so. Has somebody done this kind of
thing before?

I should be getting numbers like this example:

Bounding Coordinates:
West Bounding Coordinate: -98.179725
East Bounding Coordinate: -97.363673
North Bounding Coordinate: 30.630058
South Bounding Coordinate: 30.015643

Local Bounding Coordinates:
Left Bounding Coordinate: 2978077.571114
Right Bounding Coordinate: 3230603.902780
Bottom Bounding Coordinate: 9981817.451761
Top Bounding Coordinate: 10199521.410375


[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 Tue Oct 03 2006 - 11:47:46 EDT

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