Ahad, 19 Disember 2010

Reference Geographic Coordinate System and Projection from MapInfo to Shapefile's

Now I want to convert the Projection and Geographic Coordinate System from MapInfo to create PRJ file for my shape files. I read in MapInfo.prj but I don't know the rule.

Example, In MapInfo Coorsys is:
"UTM Zone 28 (ED 50)\p23028", 8, 28, 7, -15, 0, 0.9996, 500000, 0

What are they following ESRI shape file (.prj)

Could you tell me the way to solve the problem?

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Luckily, the MapInfo Coordsys line includes the POSC code. In this case it's "23028".

So, create a ProjCoordSys object using MO, and set its Type property to 23028 (which is the same as the moProjCS_ED_1950_UTM_28N constant). Then use the ProjCoordSys's Export method, which will generate the PRJ file.

Following those instructions, here is what that PRJ file will look like:

 
PROJCS["ED_1950_UTM_Zone_28N",
GEOGCS["GCS_European_1950",
DATUM["D_European_1950",
SPHEROID["International_1924",6378388.0,297.0]],
PRIMEM["Greenwich",0.0],
UNIT["Degree",0.0174532925199433]],
PROJECTION["Transverse_Mercator"],
PARAMETER["False_Easting",500000.0],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-15.0],
PARAMETER["Scale_Factor",0.9996],
PARAMETER["Latitude_Of_Origin",0.0],
UNIT["Meter",1.0]]

Using settings from the MAPINFOW.PRJ file.

Question:
How can the values in the MAPINFOW.PRJ file be used?

Answer:
Using Settings from MAPINFOW.PRJ.

In MapInfo Professional, there is a file called MAPINFOW.PRJ in the same directory as the MapInfo executable. MAPINFOW.PRJ is a text file containing the parameters that define MapInfo's coordinate systems. A copy of MAPINFOW.PRJ is included with MapX. Suppose it is required to use a specific projection in MapInfo, the Robinson projection for example and it is desired to specify that projection in a MapX application. The MAPINFOW.PRJ file gives the information necessary to fill in the various parameters to MapX methods, such as CoordSys.Set.

Entries in MAPINFOW.PRJ have the following parameters. Parameters are separated by commas.

Part - Description

Description - A string that describes the coordinate system. This description appears in dialog boxes.

Type - A number that usually matches one of the CoordSysTypeConstants exactly. This number may be customized in two ways: To specify an Affine Transformation, 1000 is added to this number; to specify bounds, 2000 is added to this number.

Datum - A number representing one of the Datums supported by MapX, or a special number (999 or 9999) indicating a custom datum.

[Units - [Set of 4 Custom Datum Arguments] - Optional; applies only if the Datum number is 999.

[Set of 9 Custom Datum Arguments] - Optional; applies only if the Datum number is 9999.

Set of Projection Parameters From zero to 8 parameters, depending on which Type is specified. Refer to Summary of Parameters Used by Coordinate Systems", to see which parameters are used by this Type in the online help file.

[Set of 7 Affine Transformation Parameters] - Optional; applies only if the Type number is exactly 1000 or 3000 greater than a CoordSysTypeConstant.

[Set of 4 Bounds Parameters] - Optional; applies only if the Type number is exactly 2000 or 3000 greater than a CoordSysTypeConstant.

MAPINFO.PRJ Example

Open MAPINFOW.PRJ in a text editor, or in a word processing package.

Note: MapX uses this file when interpreting and setting the map coordinate system. Make a back up of this file prior to making any changes.

Within MAPINFOW.PRJ, search for the name of a MapInfo projection, such as "Robinson". The line found contains the definition for the Robinson projection:

"Robinson", 12, 62, 7, 0

This line tells several things about the Robinson coordinate system:

The string at the start of the line is a description. The first number after the description, 12 in this example, tells what type of coordinate system applies. Check the number 12 against the table of MapX CoordSysType constants, and type 12 matches the MapX constant, miRobinson. (In this case, the description made it obvious that the coordinate system uses a Robinson projection; but in other cases, the projection might not be obvious.)

Refer to "Summary of Parameters Used by Coordinate Systems" to see which parameters are used by Robinson maps. Robinson maps use only three parameters: datum, units, and origin longitude. Now, to interpret the rest of the numbers on the line: 62 is the datum number, 7 is the unit number, and 0 is the Origin Longitude. From the list of datums supported by MapX, it can be determined that datum 62 represents NAD 27 for the continental US.

From the table of MapUnit constants, it is possible to determine that unit type number 7 matches the value of the MapX constant, miUnitMeter.

This set of values (12, 62, 7, 0) can be used as the parameters when calling the CoordSys.Set method. For example:

objCoordSys.Set 12, 62, 7, 0

For more information see help topics:

How to Interpret Special Datum Numbers

How to Interpret Special CoordSys Type Numbers

How to Interpret Special Datum Numbers

MapInfo users can customize the MAPINFOW.PRJ file by creating custom datum definitions. There are two types of custom datum definitions:

A full custom datum definition consists of datum number 9999, immediately followed by nine other custom datum parameters, separated by commas.

A simplified custom datum definition consists of datum number 999, immediately followed by four other custom datum parameters, separated by commas.

If a line in MAPINFOW.PRJ specifies datum number 999 or 9999, then the custom datum parameters appear before the rest of the coordinate system parameters (units, origin longitude, etc.). For more information on custom datum syntax, see the section Defining Custom Datums later in this chapter.

How to Interpret Special CoordSys Type Numbers

The coordinate system type number that appears in MAPINFOW.PRJ (such as 12, in the example above) might not match any of the MapX CoordSysType constant values. It may be necessary to subtract 1000, 2000, or 3000 from the number to obtain a number that represents a valid MapX CoordSysType.

If a line from MAPINFOW.PRJ contains an affine transformation, then the coordinate system type number will have 1000 added to it, and the seven affine transformation parameters will be added to the end of the line.

If the line includes a bounds definition, then the projection type number will have 2000 added to it, and the four bounds parameters will be added to the end of the line.

For example, the following line from a hypothetical MAPINFOW.PRJ file represents a coordinate system with both an affine transformation and a bounds definition. This coordinate system uses UTM Zone 10 (coordinate system type: miTransverseMercator, which has a value of 8). However, because this coordinate system includes both an affine transformation and a bounds description, the number following the description is 3008 (8 + 1000 + 2000).

"DCS", 3008, 74, 7, -123, 0, 0.9996, 500000, 0, 3, 1.57, -0.21, 84120.5, 0.19, 2.81, -20318.0, 70000, 0, 80000, 50000

Although the number 3008 is valid within MAPINFOW.PRJ, the unaltered number, 8, must be used in MapX.

The "DCS" example above can be interpreted as follows:

name,

CoordSysType + 3000,

the projection parameters (Transverse Mercator uses 7 parameters),

the 7 affine transformation parameters,

The 4 bounds parameters (in the order: xmin, ymin, xmax, ymax)

Copyright © 2001 MapInfo Corporation. All rights reserved. Please send comments and suggestions to: MapXDocs@MapInfo.com.

Last Modified: 10/05/2001 12:30:54

Remote sensing: models and methods for image processing