I’m using the attached shapefile and trying to load the projection based on the prj. However, when I use Proj4Projection.ConverPrjToProj4(path) it returns an empty string. I checked the prj file and it seems to have everything in there, so I must be missing something. Here is the code I’m using. The shapefile is attached. Thanks for any help you can provide.
featureLayer =
new
ShapeFileFeatureLayer(layer.Path);
string
prjPath = System.IO.Path.ChangeExtension(layer.Path,
“prj”
);
Proj4Projection projection =
new
Proj4Projection();
projection.InternalProjectionParametersString = Proj4Projection.ConvertPrjToProj4(prjPath);
projection.ExternalProjectionParametersString = Proj4Projection.GetDecimalDegreesParametersString();
if
(!
string
.IsNullOrWhiteSpace(projection.InternalProjectionParametersString) &&
!
string
.IsNullOrWhiteSpace(projection.ExternalProjectionParametersString) &&
projection.InternalProjectionParametersString != projection.ExternalProjectionParametersString)
{
featureLayer.FeatureSource.Projection = projection;
}
Streets.zip (1.47 MB)