NetTopologySuite / ProjNet4GeoAPI

.NET Spatial Reference and Projection Engine
GNU Lesser General Public License v2.1
275 stars 83 forks source link

CreateFromWkt() in a Xamarin.Android project #27

Open JasonKost opened 6 years ago

JasonKost commented 6 years ago

I am attempting to use a CoordinateSystemFactory in order to project a wgs84 latitude/longitude into a state plane coordinate system. I have tried using the current stable version (1.3.0.4) and a few 1.3.2 pre-release versions too.

This code generates a run-time exception:

CoordinateSystemFactory csFact = new CoordinateSystemFactory();
var nebraska = csFact.CreateFromWkt("PROJCS[\"NAD83(HARN) / Nebraska\",GEOGCS[\"NAD83(HARN)\",DATUM[\"NAD83_High_Accuracy_Regional_Network\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],AUTHORITY[\"EPSG\",\"6152\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4152\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",43],PARAMETER[\"standard_parallel_2\",40],PARAMETER[\"latitude_of_origin\",39.83333333333334],PARAMETER[\"central_meridian\",-100],PARAMETER[\"false_easting\",500000],PARAMETER[\"false_northing\",0],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"2819\"]]");

The exception message string is "'P' is not recognized."

I have tried many other WKT strings too, all with the same result.

I saw a similar issue here. That issue was apparently resolved by using version 1.3.2-pre1, but I have tried both 1.3.2-pre1 and 1.3.2-pre004 and the exception persists.

Is there any other way to transform to state plane coordinates that would bypass the parsing that CreateFromWkt() does?

FObermaier commented 5 years ago

Is this resolved?