How can I define a Mapping Toolbox stereographic projection using the information from a projection file (.prj) ?

I want to parse a projection (.prj) file and create a stereographic projection using the parameters from the projection file.

 Accepted Answer

The ability to automatically parse a projection file and create a projection is not available in the Mapping Toolbox.
To work around this issue, you can manually parse the projection file and use the parameters to create a stereographic projection. For example, a stereographic projection file has the following contents:
PROJCS["WGS_1984_Stereographic_South_Pole",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Stereographic_South_Pole"],PARAMETER["False_Easting",0.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",0.0],PARAMETER["Standard_Parallel_1",-71.0],UNIT["Meter",1.0]]
You can create a Mapping Toolbox stereographic projection structure from the parameters in the .prj file as follows:
mstereo = defaultm('stereo')
mstereo.geoid = [6378137.0, flat2ecc(1/298.257223563)] ;
mstereo.falseeasting = 0;
mstereo.falsenorthing = 0;
mstereo.nparallels = 1;
mstereo.mapparallels = -71;
mstereo.origin = [-90 0];
mstereo = defaultm(mstereo);
To use this projection structure to display latitude and longitude coastline vector data, you can use the following commands:
figure
axesm(mstereo)
load coast
plotm(lat, long)
To transform map coordinate data (given x,y coordinate arrays) to latitude and longitude, use:
[lat,lon] = minvtran(mstereo, x, y);

More Answers (1)

Alternatively, with Antarctic Mapping Tools available on File Exchange, simply type
antmap
to initialize a southern hemisphere polar stereographic map. Andrew Roberts has a function called ncpolarm which is a northern hemisphere equivalent and it is available on File Exchange.

1 Comment

Hi Andrea
The ability to automatically parse a projection file and create a projection is still not available in the Mapping Toolbox. But if you have any specific questions, please contact MathWorks Technical Support and raise a help ticket. I am sure our team will be very happy to help you.
- Abhishek

Sign in to comment.

Categories

Find more on Geology in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!