Limiting feature class parameter to specific geodatabase?Comparing two geometries in ArcPy?Where clause...

Dealing with an internal ScriptKiddie

Including proofs of known theorems in master's thesis

How can I differentiate duration vs starting time

Are there historical references that show that "diatonic" is a version of 'di-tonic' meaning 'two tonics'?

How can changes in personality/values of a person who turned into a vampire be explained?

Why is Shelob considered evil?

What happened to Hermione’s clothing and other possessions after she wiped her parents’ memories of her?

How do you get rid of the extra space that bold or large face characters make?

In the Lost in Space intro why was Dr. Smith actor listed as a special guest star?

How would an EMP effect spacesuits (and small-arms weapons)?

Tikz: Perpendicular FROM a line

Did ancient Germans take pride in leaving the land untouched?

Can you say "leftside right"?

How unreachable are Jupiter's moons from Mars with the technology developed for going to Mars?

Can you prevent a man in the middle from reading the message?

Probability X1 ≥ X2

Lubuntu 18.10 File Manager: How to view directory tree structure?

Process substitution inside a subshell to set a variable

Do the speed limit reductions due to pollution also apply to electric cars in France?

Is practicing on a digital piano harmful to an experienced piano player?

Why do single electrical receptacles exist?

How can I keep my gold safe from other PCs?

How do I avoid the "chosen hero" feeling?

How to regain lost focus?



Limiting feature class parameter to specific geodatabase?


Comparing two geometries in ArcPy?Where clause problems when all parts are user input variablesCopying polygon features with WHERE clause using arcpy.da?Trying to preserve attributes using SearchCursorPassing ModelBuilder parameter to update cursor gives ERROR 999999?Delete records in feature class that have same ID in CSV table using arcpy cursorsUpdate Cursor to Polyline Creates Records with Missing GeometryIterating through a Feature ClassUpdating a row in a feature class from another feature classAppending polygon features from file geodatabase table to SDE table?













0















I have a tool that will update the geometry of a feature class based on the geometry of another, using a common identifier.



It works great but the way I have it set up, you have to first select the gdb holding the two feature classes, then select each feature class.



Is there a way, once the gdb (which defines the workspace) is selected, to then limit the options for the two feature class parameters to those found in the selected gdb?



When I run it, I know they have to be in the same gdb, but I'd like to share it with colleagues as a tool and I'd like it to be at least a little fool-proof, considering it was fool-made.



Here's the code:



import arcpy

arcpy.env.workspace = arcpy.GetParameterAsText(0)
UpdateData = arcpy.GetParameterAsText(1)
UpdateField = arcpy.GetParameterAsText(2)
ProjectData = arcpy.GetParameterAsText(3)
ProjectField = arcpy.GetParameterAsText(4)

geometries = {key:value for (key,value) in arcpy.da.SearchCursor(UpdateData, [UpdateField, 'SHAPE@'])}

notfound = []

with arcpy.da.UpdateCursor(ProjectData, [ProjectField, 'SHAPE@']) as cursor:
for row in cursor:
try:
row[1] = geometries[row[0]]
cursor.updateRow(row)
except:
notfound.append(row[0])


GUI Screenshot










share|improve this question









New contributor




Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have a tool that will update the geometry of a feature class based on the geometry of another, using a common identifier.



    It works great but the way I have it set up, you have to first select the gdb holding the two feature classes, then select each feature class.



    Is there a way, once the gdb (which defines the workspace) is selected, to then limit the options for the two feature class parameters to those found in the selected gdb?



    When I run it, I know they have to be in the same gdb, but I'd like to share it with colleagues as a tool and I'd like it to be at least a little fool-proof, considering it was fool-made.



    Here's the code:



    import arcpy

    arcpy.env.workspace = arcpy.GetParameterAsText(0)
    UpdateData = arcpy.GetParameterAsText(1)
    UpdateField = arcpy.GetParameterAsText(2)
    ProjectData = arcpy.GetParameterAsText(3)
    ProjectField = arcpy.GetParameterAsText(4)

    geometries = {key:value for (key,value) in arcpy.da.SearchCursor(UpdateData, [UpdateField, 'SHAPE@'])}

    notfound = []

    with arcpy.da.UpdateCursor(ProjectData, [ProjectField, 'SHAPE@']) as cursor:
    for row in cursor:
    try:
    row[1] = geometries[row[0]]
    cursor.updateRow(row)
    except:
    notfound.append(row[0])


    GUI Screenshot










    share|improve this question









    New contributor




    Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have a tool that will update the geometry of a feature class based on the geometry of another, using a common identifier.



      It works great but the way I have it set up, you have to first select the gdb holding the two feature classes, then select each feature class.



      Is there a way, once the gdb (which defines the workspace) is selected, to then limit the options for the two feature class parameters to those found in the selected gdb?



      When I run it, I know they have to be in the same gdb, but I'd like to share it with colleagues as a tool and I'd like it to be at least a little fool-proof, considering it was fool-made.



      Here's the code:



      import arcpy

      arcpy.env.workspace = arcpy.GetParameterAsText(0)
      UpdateData = arcpy.GetParameterAsText(1)
      UpdateField = arcpy.GetParameterAsText(2)
      ProjectData = arcpy.GetParameterAsText(3)
      ProjectField = arcpy.GetParameterAsText(4)

      geometries = {key:value for (key,value) in arcpy.da.SearchCursor(UpdateData, [UpdateField, 'SHAPE@'])}

      notfound = []

      with arcpy.da.UpdateCursor(ProjectData, [ProjectField, 'SHAPE@']) as cursor:
      for row in cursor:
      try:
      row[1] = geometries[row[0]]
      cursor.updateRow(row)
      except:
      notfound.append(row[0])


      GUI Screenshot










      share|improve this question









      New contributor




      Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a tool that will update the geometry of a feature class based on the geometry of another, using a common identifier.



      It works great but the way I have it set up, you have to first select the gdb holding the two feature classes, then select each feature class.



      Is there a way, once the gdb (which defines the workspace) is selected, to then limit the options for the two feature class parameters to those found in the selected gdb?



      When I run it, I know they have to be in the same gdb, but I'd like to share it with colleagues as a tool and I'd like it to be at least a little fool-proof, considering it was fool-made.



      Here's the code:



      import arcpy

      arcpy.env.workspace = arcpy.GetParameterAsText(0)
      UpdateData = arcpy.GetParameterAsText(1)
      UpdateField = arcpy.GetParameterAsText(2)
      ProjectData = arcpy.GetParameterAsText(3)
      ProjectField = arcpy.GetParameterAsText(4)

      geometries = {key:value for (key,value) in arcpy.da.SearchCursor(UpdateData, [UpdateField, 'SHAPE@'])}

      notfound = []

      with arcpy.da.UpdateCursor(ProjectData, [ProjectField, 'SHAPE@']) as cursor:
      for row in cursor:
      try:
      row[1] = geometries[row[0]]
      cursor.updateRow(row)
      except:
      notfound.append(row[0])


      GUI Screenshot







      arcpy python-script-tool






      share|improve this question









      New contributor




      Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 7 mins ago









      PolyGeo

      53.6k1780240




      53.6k1780240






      New contributor




      Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 4 hours ago









      DanteDante

      1




      1




      New contributor




      Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Dante is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          Dante is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313350%2flimiting-feature-class-parameter-to-specific-geodatabase%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Dante is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Dante is a new contributor. Be nice, and check out our Code of Conduct.













          Dante is a new contributor. Be nice, and check out our Code of Conduct.












          Dante is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Geographic Information Systems Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313350%2flimiting-feature-class-parameter-to-specific-geodatabase%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Щит и меч (фильм) Содержание Названия серий | Сюжет |...

          Венесуэла на летних Олимпийских играх 2000 Содержание Состав...

          Meter-Bus Содержание Параметры шины | Стандартизация |...