Is there a helper function that will take a PointShape whose X and Y are in degrees and translate that point shape so X and Y are in meters? The formula I need to pass the point shape into is expecting the units to be meters but my map is in degrees.
Change pointshape from degrees to meters
Peter,
I just want to clarify one thing. Do you want to do this to just a single point or to a series of points like for a polygon or line. It makes a big difference depending on your answer.
David
Both. I want to do this to a point and a polygon. I think I may have figured it out use the other forums. Let me know if I’m on the right track.
I figure out what zone I’m in using the NAD 83 datum. I add 26900 to that zone. After creating my projection class, I use the convert to external to get a shape based on meters instead of degrees, manipulate it, and then convert to internal when it is time to project it back to the map.
It seems to give me the results I need.
int zone = (int)((polygon.GetCenterPoint().X + 180.0) / 6.0) + 1;
int epsgZone = 26900 + zone;
Proj4Projection proj4Projection = new Proj4Projection();
proj4Projection.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(epsgZone); //UTM
proj4Projection.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326); //geodetic
Peter,
I think you are on the right track by using projection to transfer data from one datum to another.
Any more questions just feel free to let me know.
Thanks.
Yale
Hi,
I have a similar problem: I want to convert a set of points (four corners of a rectangle) from feet to decimal degrees. Any suggestions?
Matt,
Welcome you to ThinkGeo Map Suite Desktop Discussion forum.
Before doing anything, you have to make sure the projection SRID or projection string for your feet unit.
Following code is just a simple template, you have to change the paramertes accroding your case:
000000000
int feetProjectionSrid = 900913;
Proj4Projection proj4Projection = new Proj4Projection();
proj4Projection.InternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(900913);
proj4Projection.ExternalProjectionParametersString = Proj4Projection.GetEpsgParametersString(4326);
Vertex[] vertices = new Vertex[]{};
foreach(Vertex vertex in vertices)
{
Vertex projectedVertex = proj4Projection.ConvertToExternalProjection(vertex.X, vertex.Y);
}
Any more questions just feel free to let me know.
Thanks.
Yale
Matt,
If you have a rectangle in feet that is not in a projection but just in feet regard to the dimensions of the rectangle then you have another way. For this you can use the Register method on the rectangle shape. Using this you set a anchor point and then the rectangle in feet with be registered to the ground and everything converted to decimal degrees.
David
Thanks for the help!
David, I assume that I need to convert one vertex before using your method so that I can anchor it? If that is true, what is the best way to determine what the SRID is? I'm mapping a shapefile that is projected in feet. If I look at the file in ArcMap I see the following details. I've tried using "4602" but that does not produce the results I would expect.
Data Type: Shapefile Feature Class
Shapefile: C:\Shapefile\Primary Overhead.shp
Geometry Type: Line
Projected Coordinate System: NAD_1983_StatePlane_Washington_South_FIPS_4602_Feet
Projection: Lambert_Conformal_Conic
False_Easting: 1640416.66666667
False_Northing: 0.00000000
Central_Meridian: -120.50000000
Standard_Parallel_1: 45.83333333
Standard_Parallel_2: 47.33333333
Latitude_Of_Origin: 45.33333333
Linear Unit: Foot_US
Geographic Coordinate System: GCS_North_American_1983
Datum: D_North_American_1983
Prime Meridian: Greenwich
Angular Unit: Degree
I think I figured it out. There is a SRID lookup document included with the ThinkGeo install (found at C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0\Documentation\Projections).
Matt,
Thanks for letting me know your status. I am glad to hear you have find your way.
Please feel free to let me know any more questions.
Thanks.
Yale