<?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: restricting input dataset coordinate system in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/restricting-input-dataset-coordinate-system/m-p/285230#M22022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Provide the check and if it isn't what you want, bail.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; Describe 

&lt;SPAN class="comment token"&gt;# Spatial reference object&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;get_SR&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; verbose&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="string token"&gt;"""Return the spatial reference of a featureclass."""&lt;/SPAN&gt;
    desc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    SR &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; desc&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'spatialReference'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; verbose&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SR name: {}  factory code: {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SR&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SR&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;factoryCode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; SR‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note that "Describe"&amp;nbsp; in the 'da' module has a 'spatialReference' access point.&amp;nbsp; On line 9, you can use a variety of things (name, factoryCode etc) to compare against.&amp;nbsp; so just pull in the information from the featureclass, get its SR and compare, bailing if it doesn't match&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 13:47:45 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2021-12-11T13:47:45Z</dc:date>
    <item>
      <title>restricting input dataset coordinate system</title>
      <link>https://community.esri.com/t5/python-questions/restricting-input-dataset-coordinate-system/m-p/285229#M22021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How does one restrict the input datasets to a certain coordinate system projection?&lt;/P&gt;&lt;P&gt;I think it involves setting up some kind of parameter dependency filter that I have been writing in the&amp;nbsp;def getParameterInfo(self): section of a python script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;param03 = arcpy.Parameter(displayName = 'Input Regional DAMAGE_POINTS_FLAT_ALBERS dataset(s) from file (no need to load into the Table of Contents)',&lt;BR /&gt; name = 'Input_Regional_Damage_Point_Dataset',&lt;BR /&gt; datatype = 'DEFeatureClass',&lt;BR /&gt; parameterType = "Required",&lt;BR /&gt; direction = "Input",&lt;BR /&gt; multiValue = True)&lt;BR /&gt; param03.filter.list = ["Point","Multipoint"]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also want to restrict this points and multipoints to the albers projection (or any specific coordinate system).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I presume it is something like this, but have been unable to figure it exactly out:&lt;/P&gt;&lt;P&gt;patam03.parameterDependencies&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perhaps with enviroment worked in:&amp;nbsp;&lt;SPAN&gt;param03.parameterDependencies.environment&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, for I am a python novice willing to jump in and try to figure out syntax, but have had no formal python training.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Jan 2020 22:18:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/restricting-input-dataset-coordinate-system/m-p/285229#M22021</guid>
      <dc:creator>JeffKaiden1</dc:creator>
      <dc:date>2020-01-17T22:18:17Z</dc:date>
    </item>
    <item>
      <title>Re: restricting input dataset coordinate system</title>
      <link>https://community.esri.com/t5/python-questions/restricting-input-dataset-coordinate-system/m-p/285230#M22022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Provide the check and if it isn't what you want, bail.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;from&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da &lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; Describe 

&lt;SPAN class="comment token"&gt;# Spatial reference object&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;get_SR&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fc&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; verbose&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token boolean"&gt;False&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
    &lt;SPAN class="string token"&gt;"""Return the spatial reference of a featureclass."""&lt;/SPAN&gt;
    desc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;in_fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    SR &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; desc&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'spatialReference'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; verbose&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SR name: {}  factory code: {}"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;SR&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;name&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SR&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;factoryCode&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
    &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; SR‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note that "Describe"&amp;nbsp; in the 'da' module has a 'spatialReference' access point.&amp;nbsp; On line 9, you can use a variety of things (name, factoryCode etc) to compare against.&amp;nbsp; so just pull in the information from the featureclass, get its SR and compare, bailing if it doesn't match&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 13:47:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/restricting-input-dataset-coordinate-system/m-p/285230#M22022</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2021-12-11T13:47:45Z</dc:date>
    </item>
  </channel>
</rss>

