Aug 28, 2008 at 10:05 PM
Edited Sep 9, 2008 at 3:51 PM
I'm trying to project a geographic point to Albers. The result is not what I expected. Can someone look at my code and help me out?
--Declare @Pnt geometry = geometry::Point( 193132.393610252,-2740515.20026403, 9822);
37.5, 29.5, 45.5)
POINT (0.0092216785304098364 -0.131441507182944)
I'm looking for this point:
Sep 9, 2008 at 3:44 PM
Edited Sep 9, 2008 at 3:45 PM
Your input point:
fi = 0.523899687814635 (30.017241 deg)
lambda = -1.66485400514046 (-95.389108 deg)
Origin of cartesian coordinates:
fi0 = 0.654498469497874 (37.5 deg)
lambda0 = -1.67551608191456 (-96 deg)
fi1 = 0.514872129338327 (29.5 deg)
fi2 = 0.79412480965742 (45.5 deg)
Acording to http://mathworld.wolfram.com/AlbersEqual-AreaConicProjection.html the equations are:
n = (sin(fi1) + sin(fi2)) / 2 = 0.602837004628824
theta = n * (lambda - lambda0) = 0.00642749442561693
C = cos^2(fi1) + 2n * sin(fi1) = 1.3512213254179
p = sqrt(C - 2n sin(fi)) / n = 1.43473357041667
p0 = sqrt(C - 2n sin(fi0)) / n = 1.30326242698802
and finally the output point:
x = p * sin(theta) = 0.00922167853040983
y = p0 - p * cos(theta) = -0.131441507182944
It looks like your expected coordinates are scaled by ~20.8e6.
You can use the AffineTransform class to scale the output geometry. There are examples in scripts directory.
I will try out the transformation.
Can you explain exactly what the projection returns? How do I determine the scale?
I had a point in WGS84 Lat/Long and wanted to get it to Albers with a GCS of NAD83.
Here is the projection info from ESRI.
Linear Unit: Foot (0.304800)
Geographic Coordinate System: GCS_North_American_1983
Angular Unit: Degree (0.017453292519943299)
Prime Meridian: Greenwich (0.000000000000000000)
Semimajor Axis: 6378137.000000000000000000
Semiminor Axis: 6356752.314140356100000000
Inverse Flattening: 298.257222101000020000
Thanks for the help.
Sep 13, 2008 at 2:19 AM
The projection that is being returned is effectively a unit sphere, though certainly not a unit sphere anywhere close to the scale you would be expecting. The USGS Professional Publication 1395, "Map Projections---A Working Manual", by John
Snyder, is the standard reference on map projections and lists equations for both the spherical Albers and for the ellipsoidal Albers. You can download the PDF of this book here:
http://pubs.er.usgs.gov/usgspubs/pp/pp1395 If you take a look at it, our guess is that your expectations correspond more closely with the ellipsoidal Albers
Let us know if that seems like what is going on. We are looking into how to update the codeplex sample, but may just update the projection to a more reasonable scale. We'll keep you updated either way.
Sep 22, 2008 at 3:01 PM
Edited Sep 22, 2008 at 3:07 PM
Sorry for the late reply. I was dealing with Hurricane Ike over the last week.
Yes, I'm looking for the ellipsoidal Albers map projection based on GRS1980 ellipsoid, not Clarke1866.
I'll check out the book.
I appreciate the help you guys have given me. I am in the process of evaluating SqlServer 2008 for it's geospatial operations. I am hoping to remove bottlenecks in our current geospatial data processing operations which lay outside
the database using other GIS desktop software. I look forward to any updates regarding projections and linear referencing.