VDS Technologies

 

Proection via CoordinateSystem not working

6/12/2014 3:25:11 PM
Total Posts 13

Proection via CoordinateSystem not working

I am creating a new CoordinateSystem object and using LoadFromFile to read the ESRI ShapeFile PRJ file.  The file is in WKT format, but does ActualMap really read the ESRI WKT format?  After the LoadFromFile the Code always returns unknown.

 

I have several layers, each of which are in different state plane coord systems.  I am gived an x,y pair in wGS 84 (from a GPS) and need to locate in each layer the map point and plan to use the CoordinateSystem to convert the points for me.

 

6/13/2014 1:28:05 AM
MVP
Total Posts 323

Re: Proection via CoordinateSystem not working

For a custom coordinate system from a WKT file, the coordinate system code is obtained from the AUTHORITY tag. If the file misses this tag, the code will be unknown.

6/13/2014 8:11:29 AM
Total Posts 13

Re: Proection via CoordinateSystem not working

Nothing custom in the prj file.  It was created by ESRI.

 

PROJCS["NAD_1983_StatePlane_Maryland_FIPS_1900_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",1312333.333333333],
PARAMETER["False_Northing",0.0],
PARAMETER["Central_Meridian",-77.0],
PARAMETER["Standard_Parallel_1",38.3],
PARAMETER["Standard_Parallel_2",39.45],
PARAMETER["Latitude_Of_Origin",37.66666666666666],
UNIT["Foot_US",0.3048006096012192]]

I decided to look at a prj file supplied with the examples from

"C:\Program Files\VDS Technologies\ActualMap 4.4\SampleAppsVB\MAPS\PROJECTED\capitals.prj"

GEOGCS["GCS_WGS_1984",
DATUM["D_WGS_1984",
SPHEROID["WGS_1984",6378137,298.257223563]],
PRIMEM["Greenwich",0],
UNIT["Degree",0.0174532925199433]]

and

"C:\Program Files\VDS Technologies\ActualMap 4.4\SampleAppsVB\MAPS\PROJECTED\world.prj"

PROJCS["World_Mercator",
GEOGCS["GCS_WGS_1984",
DATUM["WGS_1984",
SPHEROID["WGS_1984",6378137,298.257223563]],
PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],
PROJECTION["Mercator_1SP"],
PARAMETER["False_Easting",0],
PARAMETER["False_Northing",0],
PARAMETER["Central_Meridian",0],
PARAMETER["Standard_Parallel_1",0],
UNIT["Meter",1]]

I have looked at 20 different prj files from a variety of shape file sets.  I found no "AUTHORITY" tags.

 

 

 

 

6/13/2014 8:26:35 AM
Total Posts 13

Re: Proection via CoordinateSystem not working

After reviewing several articles on the net,I found:

 

"There are other dialects of WKT. The most common dialect is this "ESRI WKT" dialect. But for projections other than WGS84, this one does not include the TOWGS84 and AUTHORITY nodes parameters"

 

So I'll re-ask my questions:

1) Does ActualMap load the prj file into the layers CoordinateSystem when the shapefile if loaded?

2) If not, if I use LoadFromFile and use the ESRI WKT prj file for the layers CoordinateSystem, and the prj is state plane, can it be used to convert my incoming WGS84 coordinated to the layers coordinates?

3) Is there another solution.

 

 

6/14/2014 12:21:03 AM
MVP
Total Posts 323

Re: Proection via CoordinateSystem not working

A .prj file is loaded automatically. If the AUTHORITY tag is missed, the Code property will return 0, but this does not mean that the .prj file has been loaded unsuccessfully (only if Layer.CoordinateSystem is null).

To transform coordinates on-the-fly, set coordinate systems to Map.CoordinateSystem and Layer.CoordinateSystem(unless the layer has a .prj file). This way coordinates will be transformed implicitly. All other coordinates must be transformed to map/layer coordinate systems explicitly by using the methods of the CoordSystem class.

Instead of the .prj file, you may use the pre-defined constants:

CoordSystem sys = new CoordSystem(CoordSystemCode.PCS_NAD1983StatePlaneMarylandFIPS1900Feet);