I am currently migrating the ArcMap extension to ArcGIS pro extension for my client.
I currently cannot figure out how to get information of projected coordinate system such as central meridian, scale factor similar to arcobject IProjectedCoordinateSystem Interface. Is there anyway to get these properties from ArcGIS Pro sdk spatialreference?
I believe you are talking about ArcGIS.Core.Geometry.SpatialReference (ToJson() ) method.
For toxml call I got :
<ProjectedCoordinateSystem xsi:type='typens:ProjectedCoordinateSystem' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:typens='http://www.esri.com/schemas/ArcGIS/2.5.0'><WKT>PROJCS["AGD_1966_AMG_Zone_50",GEOGCS["GCS_Australian_1966",DATUM["D_Australian_1966",SPHEROID["Australian",6378160.0,298.25]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",10000000.0],PARAMETER["Central_Meridian",117.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0],AUTHORITY["EPSG",20250]]</WKT><XOrigin>-5120900</XOrigin><YOrigin>1800</YOrigin><XYScale>10000</XYScale><ZOrigin>-100000</ZOrigin><ZScale>10000</ZScale><MOrigin>-100000</MOrigin><MScale>10000</MScale><XYTolerance>0.001</XYTolerance><ZTol erance>0.001</ZTolerance><MTolerance>0.001</MTolerance><HighPrecision>true</HighPrecision><WKID>20250</WKID><LatestWKID>20250</LatestWKID></ProjectedCoordinateSystem>
For ToJson() method call I got:
For example: If I want central meridian or to check that pcs is Transverse Mercator, I currently need to parse wkt string and get manually at the moment, I can't find build in specific properties at that moment yet.
Or is that in ArcGIS.core.Internal library?..
For ArcGIS.Core.Geometry.SpatialReference you can use ToXML() method ang then deserialize result string to or GeographicCoordinateSystem (depending on your spatial reference). Then take from coordinate system variable WKT property. For ArcGIS.core.Internal.CIM.SpatialReference you can just take wkt property.
WKT parser you can find on internet. First what I find :
Thank Gintautas Kmieliauskas for your info
Parsing the wkt string is what I am currently doing at the moment. I managed to get these value with regex easily at the moment.
Look like my question is not quite clear.
I want to know whether is there easy way to retrieve those value like how we are able to get from arcobject PCS class library.
Anyway, it seem, these two sdks are quite different.