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

From: Don Dietrick <dietrick_at_bbn.com>
Date: Wed, 4 Oct 2006 13:43:12 -0400

Hi JR,

There isn't an automatic reader for the .prj files, but you were on
the right track of using the LambertConformalLoader to create a state
plane projectino with those values.

But that's not the real problem. If you have data that has already
been projected (like the state plane projection), there's really no
mechanism to create an object represented by those coordinates. The
OMGraphics are expecting decimal degree lat/lon data.

OpenMap 4.7 will be able to handle OMGraphics to projected data, but
I haven't written that OMGraphic code yet. I'm trying to find the
time to work on that.

- Don

On Oct 3, 2006, at 11:43 AM, JR Andreassen wrote:

> Hi...
> 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:
> GEOGCS["GCS_North_American_1983",DATUM
> ["D_North_American_1983",SPHEROID["GRS_1980",
> 6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",
> 0.0174532925199433]]
> Some of my other sources use :
> PROJCS["NAD_1983_StatePlane_Texas_Central_FIPS_4203_Feet",GEOGCS
> ["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID
> ["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT
> ["Degree",0.0174532925199433]],PROJECTION
> ["Lambert_Conformal_Conic"],PARAMETER["False_Easting",
> 2296583.333333333],PARAMETER["False_Northing",9842500.0],PARAMETER
> ["Central_Meridian",-100.3333333333333],PARAMETER
> ["Standard_Parallel_1",30.11666666666667],PARAMETER
> ["Standard_Parallel_2",31.88333333333333],PARAMETER
> ["Latitude_Of_Origin",29.66666666666667],UNIT["Foot_US",
> 0.3048006096012192]]
>
> 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.
> Thanks
> JR
> ----------------------------------------------------------------------
> ----------------------------------------------------------------
> I found this entry in the Mail Archives from : Rob Ratcliff
> <rratcliff_at_ticom-geo.com>
>
> 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
> PROJCS["NAD_1983_StatePlane_Texas_Central_FIPS_4203",GEOGCS
> ["GCS_North_American_1983",DATUM["D_North_Ameri
> can_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM
> ["Greenwich",0],UNIT["Degree",0.017453292519943295]
> ],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",
> 700000],PARAMETER["False_Northing",3000000],
> PARAMETER["Central_Meridian",-100.3333333333333],PARAMETER
> ["Standard_Parallel_1",30.11666666666667],PARAMETE
> R["Standard_Parallel_2",31.88333333333333],PARAMETER
> ["Latitude_Of_Origin",29.66666666666667],UNIT["Meter",1]]
>
> 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
>
> Thanks,
> Rob
>
>
>
> --
> [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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=


--
[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 Wed Oct 04 2006 - 13:47:39 EDT

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