<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cannot create Custom Projected CS from ArcObjects Java SDK? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/cannot-create-custom-projected-cs-from-arcobjects/m-p/580868#M15701</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can find the lambert projected coordinate system simply by examining what is already defined for those parameters either by looking for them in the projection information with the arc* suite or googling&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://spatialreference.org/ref/esri/north-america-lambert-conformal-conic/"&gt;North America Lambert Conformal Conic&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;then just pull out the pieces you need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; font-family: Consolas; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px; word-wrap: break-word;"&gt;PROJCS["North_America_Lambert_Conformal_Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-96],PARAMETER["Standard_Parallel_1",20],PARAMETER["Standard_Parallel_2",60],PARAMETER["Latitude_Of_Origin",40],UNIT["Meter",1]]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 07 Jan 2018 13:47:29 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-01-07T13:47:29Z</dc:date>
    <item>
      <title>Cannot create Custom Projected CS from ArcObjects Java SDK?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cannot-create-custom-projected-cs-from-arcobjects/m-p/580867#M15700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the ArcObjects SDK for Java, there is an example code to create a custom projected CS using IProjectedCoordinateSystemEdit define() method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the link:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcobjects/latest/java/54ece52a-3a53-11dc-a403-4faa7246d1c1.htm" title="https://desktop.arcgis.com/en/arcobjects/latest/java/54ece52a-3a53-11dc-a403-4faa7246d1c1.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;How to create a custom projected coordinate system—ArcObjects 10.4 Help for Java | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;or&amp;nbsp;&lt;A class="link-titled" href="https://desktop.arcgis.com/en/arcobjects/latest/java/" title="https://desktop.arcgis.com/en/arcobjects/latest/java/" rel="nofollow noopener noreferrer" target="_blank"&gt;ArcObjects Help for Java developers | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the example code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;static&lt;/SPAN&gt; IProjectedCoordinateSystem createProjectedCoordinateSystem() &lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;throws&lt;/SPAN&gt; Exception{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; ISpatialReferenceFactory2 spatialReferenceFactory = &lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;new&lt;/SPAN&gt;&amp;nbsp;SpatialReferenceEnvironment();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="" style="color: #008000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create a projection, GeographicCoordinateSystem, and unit using the factory.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; IProjectionGEN projection = (IProjectionGEN)&amp;nbsp;spatialReferenceFactory.createProjection(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;int&lt;/SPAN&gt;)&amp;nbsp;esriSRProjectionType.esriSRProjection_Sinusoidal);
&amp;nbsp;&amp;nbsp;&amp;nbsp; IGeographicCoordinateSystem geographicCoordinateSystem =&amp;nbsp;spatialReferenceFactory.createGeographicCoordinateSystem(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;int&lt;/SPAN&gt;)&amp;nbsp;esriSRGeoCSType.esriSRGeoCS_WGS1984);
&amp;nbsp;&amp;nbsp;&amp;nbsp; ILinearUnit unit = (ILinearUnit)spatialReferenceFactory.createUnit(
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;int&lt;/SPAN&gt;)&amp;nbsp;esriSRUnitType.esriSRUnit_Meter);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="" style="color: #008000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Get the default parameters from the projection.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; IParameter[] parameters = projection.getDefaultParameters();&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="" style="color: #008000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create a projected coordinate system using the Define method.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; IProjectedCoordinateSystemEdit projectedCoordinateSystemEdit = &lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;new&lt;/SPAN&gt;&amp;nbsp;ProjectedCoordinateSystem();
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object name = &lt;SPAN class="" style="color: #2a00ff;"&gt;"Newfoundland"&lt;/SPAN&gt;;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object alias = &lt;SPAN class="" style="color: #2a00ff;"&gt;"NF_LAB"&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object abbreviation = &lt;SPAN class="" style="color: #2a00ff;"&gt;"NF"&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object remarks = &lt;SPAN class="" style="color: #2a00ff;"&gt;"Most Eastern Province in Canada"&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object usage = &lt;SPAN class="" style="color: #2a00ff;"&gt;"When making maps of Newfoundland"&lt;/SPAN&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object geographicCoordinateSystemObject = geographicCoordinateSystem;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object unitObject = unit;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object projectionObject = projection;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; Object parametersObject = parameters;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; projectedCoordinateSystemEdit.define(name, alias, abbreviation, remarks, usage,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; geographicCoordinateSystemObject, unitObject, projectionObject,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parametersObject); &lt;SPAN style="color: #ff6600;"&gt;// &amp;lt;-- problem part. If I put &lt;STRONG&gt;null&lt;/STRONG&gt;, then it works.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="" style="color: #7f0055; font-weight: bold;"&gt;&amp;nbsp; return&lt;/SPAN&gt; (IProjectedCoordinateSystem)projectedCoordinateSystemEdit; 
}&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've run the code, but wont work and throwing native library error:&amp;nbsp;&lt;STRONG&gt;Execution protection violation&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Below I've attached the error log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've identified the problem part. The IParameter[] parameter is making the define() method crashes.&amp;nbsp;If I substitute the parameter using &lt;STRONG&gt;null&lt;/STRONG&gt; values, the define() method works perfectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to create a Lambert Azimuthal Equal Area PCS in which I can custumize the central latitude and longitude.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thankyou,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using:&lt;/P&gt;&lt;P&gt;ArcGIS Developer Kit 10.5&lt;/P&gt;&lt;P&gt;ArcGIS Engine 10.5&lt;/P&gt;&lt;P&gt;JDK ver. 1.8.0_151 32bit&amp;nbsp;&lt;/P&gt;&lt;P&gt;JRE ver. 1.8.0_121 32bit (in the ArcGIS Developer Kit 10.5 folder)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:59:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cannot-create-custom-projected-cs-from-arcobjects/m-p/580867#M15700</guid>
      <dc:creator>KeenanGebze1</dc:creator>
      <dc:date>2021-12-12T00:59:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create Custom Projected CS from ArcObjects Java SDK?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cannot-create-custom-projected-cs-from-arcobjects/m-p/580868#M15701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can find the lambert projected coordinate system simply by examining what is already defined for those parameters either by looking for them in the projection information with the arc* suite or googling&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://spatialreference.org/ref/esri/north-america-lambert-conformal-conic/"&gt;North America Lambert Conformal Conic&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;then just pull out the pieces you need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ie&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #000000; font-family: Consolas; font-size: 13.33px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: pre-wrap; word-spacing: 0px; word-wrap: break-word;"&gt;PROJCS["North_America_Lambert_Conformal_Conic",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",0],PARAMETER["False_Northing",0],PARAMETER["Central_Meridian",-96],PARAMETER["Standard_Parallel_1",20],PARAMETER["Standard_Parallel_2",60],PARAMETER["Latitude_Of_Origin",40],UNIT["Meter",1]]&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 07 Jan 2018 13:47:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cannot-create-custom-projected-cs-from-arcobjects/m-p/580868#M15701</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-01-07T13:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot create Custom Projected CS from ArcObjects Java SDK?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/cannot-create-custom-projected-cs-from-arcobjects/m-p/580869#M15702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thankyou,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've followed your advice by saving the said projection in to a .prj file (from ArcMap) and then pass the content of the prj file into SpatialReferenceEnvironment's&lt;EM&gt; createESRISpatialReferenceFromPRJ(String prj)&lt;/EM&gt; method with few modified parameters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But an exception came out: &lt;STRONG&gt;AutomationException&lt;/STRONG&gt;: 0x80040207 - The input is not a &lt;EM&gt;workstation prj file&lt;/EM&gt;. in '"esri.SpatRefEnvironment"'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't find much documentation about this (&lt;EM&gt;ArcInfo?) workstation prj file&lt;/EM&gt; and struggled to create it. (I found one but not much of a help:&amp;nbsp;&lt;A class="link-titled" href="https://support.esri.com/en/technical-article/000007002" title="https://support.esri.com/en/technical-article/000007002"&gt;How To: Make the Projections Tools for coverages work in ArcToolBox&lt;/A&gt;&amp;nbsp;)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the code worked when I use the &lt;EM&gt;createESRISpatialReferenceFromPRJ(String prjFile) &lt;/EM&gt;method:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SpatialReferenceEnvironment sre = new SpatialReferenceEnvironment();&lt;/P&gt;&lt;P&gt;return sre.createESRISpatialReferenceFromPRJFile("..\\South Pole Lambert Azimuthal Equal Area.prj");&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P style="color: #000000;"&gt;Of course I would not prefer using this method because I've to write and read to a file every time, just to edit few parameters.&lt;/P&gt;&lt;P style="color: #000000;"&gt;&lt;/P&gt;&lt;P style="color: #000000;"&gt;So If there is a documentation about this "ArcInfo workstation prj" file or other solution, that would be helpful.&lt;/P&gt;&lt;P style="color: #000000;"&gt;&lt;/P&gt;&lt;P style="color: #000000;"&gt;I'll also try using ArcObjects SDK / Engine 10.4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 08 Jan 2018 16:43:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/cannot-create-custom-projected-cs-from-arcobjects/m-p/580869#M15702</guid>
      <dc:creator>KeenanGebze1</dc:creator>
      <dc:date>2018-01-08T16:43:51Z</dc:date>
    </item>
  </channel>
</rss>

