Creating user defined input to simplify Reclassify tool and negate need for remap The 2019 Stack Overflow Developer Survey Results Are InUnable to Provide Input for a MultiValue Parameter Script ToolPrompting for user input during ArcGIS Python script tool execution?Error when kriging: “output variance prediction raster”Problems with Reclassify and RemapRange in ArcPy?Using Arcmap 10.2.2, Con tool and Reclassify not working correctlyError 000875 when using setting workspace with user input for slope spatial analyst toolRemapRange for Reclassify Error in ArcPyReclassify Tool Resulting in NoData where Input has DataCreating Python Script Tool with Sortable Field Multi-Value Input?Con tool not working In ArcGIS Desktop 10.5?

What is this sharp, curved notch on my knife for?

Dropping list elements from nested list after evaluation

A female thief is not sold to make restitution -- so what happens instead?

What is preventing me from simply constructing a hash that's lower than the current target?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

How to notate time signature switching consistently every measure

How to support a colleague who finds meetings extremely tiring?

How to charge AirPods to keep battery healthy?

Pokemon Turn Based battle (Python)

Kerning for subscripts of sigma?

Ubuntu Server install with full GUI

Why are there uneven bright areas in this photo of black hole?

Why can I use a list index as an indexing variable in a for loop?

Match Roman Numerals

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?

Is bread bad for ducks?

Short story: child made less intelligent and less attractive

Why doesn't UInt have a toDouble()?

writing variables above the numbers in tikz picture

Why can't devices on different VLANs, but on the same subnet, communicate?

How come people say “Would of”?

Did Scotland spend $250,000 for the slogan "Welcome to Scotland"?

Can there be female White Walkers?

What do I do when my TA workload is more than expected?



Creating user defined input to simplify Reclassify tool and negate need for remap



The 2019 Stack Overflow Developer Survey Results Are InUnable to Provide Input for a MultiValue Parameter Script ToolPrompting for user input during ArcGIS Python script tool execution?Error when kriging: “output variance prediction raster”Problems with Reclassify and RemapRange in ArcPy?Using Arcmap 10.2.2, Con tool and Reclassify not working correctlyError 000875 when using setting workspace with user input for slope spatial analyst toolRemapRange for Reclassify Error in ArcPyReclassify Tool Resulting in NoData where Input has DataCreating Python Script Tool with Sortable Field Multi-Value Input?Con tool not working In ArcGIS Desktop 10.5?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I would like to build a script tool using Arcpy that reclassifies a raster layer based on a single user input parameter. For example, if the user inputs the number 7, then 0 - 7 would reclassify as 1, anything > 7 would become NoData.



The reason I need this is; I am building a site selection tool which contains many processes. In the middle of the tool there is a Reclassify process. The workflow goes something like this:



Elevation > Slope > Slope + 0.5 > Int > Reclassify > Raster to Polygon - This is the final vector that becomes part of other vector analysis to perform a site selection. It is a polygon of all areas of suitable slope.



I have been playing around with various attempts but to no avail, mostly because the Reclassify tool will not take a variable as part of the input. Everything else in the tool works fine but I don't know to have a user-defined input determine the Reclassify process.



# Import arcpy module
import arcpy
from arcpy.sa import *

# Script arguments
Elevation_Data = arcpy.GetParameterAsText(0)
Slope_Value = arcpy.GetParameterAsText(1)

# Local variables:
Slope_1 = "D:egm722DataScratch.gdb\Slope_1"
Int_Slope = "D:egm722DataScratch.gdb\Int_Slope"
Reclass = "D:egm722DataScratch.gdb\Reclass"
RasPoly = "D:egm722DataScratch.gdb\RasPoly"

# Process: Slope
arcpy.gp.Slope_sa(Elevation_Data, Slope_1, "DEGREE", "1", "PLANAR", "METER")

# Process: Raster Calculator
Slope_2 = Raster(Slope_1) + 0.5
Slope_2.save("D:egm722DataScratch.gdb\Slope_2")

# Process: Int
arcpy.gp.Int_sa(Slope_2, Int_Slope)

# Process: Reclassify
arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")

# Process: Raster to Polygon
arcpy.RasterToPolygon_conversion(Reclass, RasPoly, "SIMPLIFY", "VALUE")


Here, I have attempted the variable Slope_Value to be the user-defined input as a script tool parameter type 'Long', but of course this does not work.



enter image description here



Traceback (most recent call last):
File "D:egm722elev.py", line 26, in <module>
arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")
File "c:program files (x86)arcgisdesktop10.5arcpyarcpygeoprocessing_base.py", line 510, in <lambda>
return lambda *args: val(*gp_fixargs(args, True))
ExecuteError: ERROR 000622: Failed to execute (Reclassify). Parameters are not valid.
ERROR 000628: Cannot set input into parameter remap.


I cannot skip the reclassify process and delete values from the 'Raster to Polygon' output (using Select tool for example) because converting non-reclassified Raster layers using 'Raster to Polygon' takes far too long for it to be considered a viable tool.










share|improve this question









New contributor




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


























    0















    I would like to build a script tool using Arcpy that reclassifies a raster layer based on a single user input parameter. For example, if the user inputs the number 7, then 0 - 7 would reclassify as 1, anything > 7 would become NoData.



    The reason I need this is; I am building a site selection tool which contains many processes. In the middle of the tool there is a Reclassify process. The workflow goes something like this:



    Elevation > Slope > Slope + 0.5 > Int > Reclassify > Raster to Polygon - This is the final vector that becomes part of other vector analysis to perform a site selection. It is a polygon of all areas of suitable slope.



    I have been playing around with various attempts but to no avail, mostly because the Reclassify tool will not take a variable as part of the input. Everything else in the tool works fine but I don't know to have a user-defined input determine the Reclassify process.



    # Import arcpy module
    import arcpy
    from arcpy.sa import *

    # Script arguments
    Elevation_Data = arcpy.GetParameterAsText(0)
    Slope_Value = arcpy.GetParameterAsText(1)

    # Local variables:
    Slope_1 = "D:egm722DataScratch.gdb\Slope_1"
    Int_Slope = "D:egm722DataScratch.gdb\Int_Slope"
    Reclass = "D:egm722DataScratch.gdb\Reclass"
    RasPoly = "D:egm722DataScratch.gdb\RasPoly"

    # Process: Slope
    arcpy.gp.Slope_sa(Elevation_Data, Slope_1, "DEGREE", "1", "PLANAR", "METER")

    # Process: Raster Calculator
    Slope_2 = Raster(Slope_1) + 0.5
    Slope_2.save("D:egm722DataScratch.gdb\Slope_2")

    # Process: Int
    arcpy.gp.Int_sa(Slope_2, Int_Slope)

    # Process: Reclassify
    arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")

    # Process: Raster to Polygon
    arcpy.RasterToPolygon_conversion(Reclass, RasPoly, "SIMPLIFY", "VALUE")


    Here, I have attempted the variable Slope_Value to be the user-defined input as a script tool parameter type 'Long', but of course this does not work.



    enter image description here



    Traceback (most recent call last):
    File "D:egm722elev.py", line 26, in <module>
    arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")
    File "c:program files (x86)arcgisdesktop10.5arcpyarcpygeoprocessing_base.py", line 510, in <lambda>
    return lambda *args: val(*gp_fixargs(args, True))
    ExecuteError: ERROR 000622: Failed to execute (Reclassify). Parameters are not valid.
    ERROR 000628: Cannot set input into parameter remap.


    I cannot skip the reclassify process and delete values from the 'Raster to Polygon' output (using Select tool for example) because converting non-reclassified Raster layers using 'Raster to Polygon' takes far too long for it to be considered a viable tool.










    share|improve this question









    New contributor




    Lee Powell 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 would like to build a script tool using Arcpy that reclassifies a raster layer based on a single user input parameter. For example, if the user inputs the number 7, then 0 - 7 would reclassify as 1, anything > 7 would become NoData.



      The reason I need this is; I am building a site selection tool which contains many processes. In the middle of the tool there is a Reclassify process. The workflow goes something like this:



      Elevation > Slope > Slope + 0.5 > Int > Reclassify > Raster to Polygon - This is the final vector that becomes part of other vector analysis to perform a site selection. It is a polygon of all areas of suitable slope.



      I have been playing around with various attempts but to no avail, mostly because the Reclassify tool will not take a variable as part of the input. Everything else in the tool works fine but I don't know to have a user-defined input determine the Reclassify process.



      # Import arcpy module
      import arcpy
      from arcpy.sa import *

      # Script arguments
      Elevation_Data = arcpy.GetParameterAsText(0)
      Slope_Value = arcpy.GetParameterAsText(1)

      # Local variables:
      Slope_1 = "D:egm722DataScratch.gdb\Slope_1"
      Int_Slope = "D:egm722DataScratch.gdb\Int_Slope"
      Reclass = "D:egm722DataScratch.gdb\Reclass"
      RasPoly = "D:egm722DataScratch.gdb\RasPoly"

      # Process: Slope
      arcpy.gp.Slope_sa(Elevation_Data, Slope_1, "DEGREE", "1", "PLANAR", "METER")

      # Process: Raster Calculator
      Slope_2 = Raster(Slope_1) + 0.5
      Slope_2.save("D:egm722DataScratch.gdb\Slope_2")

      # Process: Int
      arcpy.gp.Int_sa(Slope_2, Int_Slope)

      # Process: Reclassify
      arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")

      # Process: Raster to Polygon
      arcpy.RasterToPolygon_conversion(Reclass, RasPoly, "SIMPLIFY", "VALUE")


      Here, I have attempted the variable Slope_Value to be the user-defined input as a script tool parameter type 'Long', but of course this does not work.



      enter image description here



      Traceback (most recent call last):
      File "D:egm722elev.py", line 26, in <module>
      arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")
      File "c:program files (x86)arcgisdesktop10.5arcpyarcpygeoprocessing_base.py", line 510, in <lambda>
      return lambda *args: val(*gp_fixargs(args, True))
      ExecuteError: ERROR 000622: Failed to execute (Reclassify). Parameters are not valid.
      ERROR 000628: Cannot set input into parameter remap.


      I cannot skip the reclassify process and delete values from the 'Raster to Polygon' output (using Select tool for example) because converting non-reclassified Raster layers using 'Raster to Polygon' takes far too long for it to be considered a viable tool.










      share|improve this question









      New contributor




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












      I would like to build a script tool using Arcpy that reclassifies a raster layer based on a single user input parameter. For example, if the user inputs the number 7, then 0 - 7 would reclassify as 1, anything > 7 would become NoData.



      The reason I need this is; I am building a site selection tool which contains many processes. In the middle of the tool there is a Reclassify process. The workflow goes something like this:



      Elevation > Slope > Slope + 0.5 > Int > Reclassify > Raster to Polygon - This is the final vector that becomes part of other vector analysis to perform a site selection. It is a polygon of all areas of suitable slope.



      I have been playing around with various attempts but to no avail, mostly because the Reclassify tool will not take a variable as part of the input. Everything else in the tool works fine but I don't know to have a user-defined input determine the Reclassify process.



      # Import arcpy module
      import arcpy
      from arcpy.sa import *

      # Script arguments
      Elevation_Data = arcpy.GetParameterAsText(0)
      Slope_Value = arcpy.GetParameterAsText(1)

      # Local variables:
      Slope_1 = "D:egm722DataScratch.gdb\Slope_1"
      Int_Slope = "D:egm722DataScratch.gdb\Int_Slope"
      Reclass = "D:egm722DataScratch.gdb\Reclass"
      RasPoly = "D:egm722DataScratch.gdb\RasPoly"

      # Process: Slope
      arcpy.gp.Slope_sa(Elevation_Data, Slope_1, "DEGREE", "1", "PLANAR", "METER")

      # Process: Raster Calculator
      Slope_2 = Raster(Slope_1) + 0.5
      Slope_2.save("D:egm722DataScratch.gdb\Slope_2")

      # Process: Int
      arcpy.gp.Int_sa(Slope_2, Int_Slope)

      # Process: Reclassify
      arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")

      # Process: Raster to Polygon
      arcpy.RasterToPolygon_conversion(Reclass, RasPoly, "SIMPLIFY", "VALUE")


      Here, I have attempted the variable Slope_Value to be the user-defined input as a script tool parameter type 'Long', but of course this does not work.



      enter image description here



      Traceback (most recent call last):
      File "D:egm722elev.py", line 26, in <module>
      arcpy.gp.Reclassify_sa(Int_Slope, "VALUE", "0 Slope_Value 1", Reclass, "NODATA")
      File "c:program files (x86)arcgisdesktop10.5arcpyarcpygeoprocessing_base.py", line 510, in <lambda>
      return lambda *args: val(*gp_fixargs(args, True))
      ExecuteError: ERROR 000622: Failed to execute (Reclassify). Parameters are not valid.
      ERROR 000628: Cannot set input into parameter remap.


      I cannot skip the reclassify process and delete values from the 'Raster to Polygon' output (using Select tool for example) because converting non-reclassified Raster layers using 'Raster to Polygon' takes far too long for it to be considered a viable tool.







      arcpy spatial-analyst reclassify error-000622






      share|improve this question









      New contributor




      Lee Powell 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




      Lee Powell 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 Apr 6 at 10:56









      PolyGeo

      53.9k1782246




      53.9k1782246






      New contributor




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









      asked Apr 6 at 10:39









      Lee PowellLee Powell

      61




      61




      New contributor




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





      New contributor





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






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




















          1 Answer
          1






          active

          oldest

          votes


















          0














          I solved the issue above by placing the remap within a list variable:



          remap = RemapRange([[0,Slope_Value,1]])
          Reclass = Reclassify(Int_Slope, "VALUE", remap, "NODATA")
          Reclass.save(os.path.join(temp_Fgdb + "\Reclass"))





          share|improve this answer








          New contributor




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




















            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
            );



            );






            Lee Powell 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%2f317972%2fcreating-user-defined-input-to-simplify-reclassify-tool-and-negate-need-for-rema%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I solved the issue above by placing the remap within a list variable:



            remap = RemapRange([[0,Slope_Value,1]])
            Reclass = Reclassify(Int_Slope, "VALUE", remap, "NODATA")
            Reclass.save(os.path.join(temp_Fgdb + "\Reclass"))





            share|improve this answer








            New contributor




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
























              0














              I solved the issue above by placing the remap within a list variable:



              remap = RemapRange([[0,Slope_Value,1]])
              Reclass = Reclassify(Int_Slope, "VALUE", remap, "NODATA")
              Reclass.save(os.path.join(temp_Fgdb + "\Reclass"))





              share|improve this answer








              New contributor




              Lee Powell 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 solved the issue above by placing the remap within a list variable:



                remap = RemapRange([[0,Slope_Value,1]])
                Reclass = Reclassify(Int_Slope, "VALUE", remap, "NODATA")
                Reclass.save(os.path.join(temp_Fgdb + "\Reclass"))





                share|improve this answer








                New contributor




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










                I solved the issue above by placing the remap within a list variable:



                remap = RemapRange([[0,Slope_Value,1]])
                Reclass = Reclassify(Int_Slope, "VALUE", remap, "NODATA")
                Reclass.save(os.path.join(temp_Fgdb + "\Reclass"))






                share|improve this answer








                New contributor




                Lee Powell 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 answer



                share|improve this answer






                New contributor




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









                answered Apr 6 at 11:38









                Lee PowellLee Powell

                61




                61




                New contributor




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





                New contributor





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






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




















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









                    draft saved

                    draft discarded


















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












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











                    Lee Powell 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%2f317972%2fcreating-user-defined-input-to-simplify-reclassify-tool-and-negate-need-for-rema%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

                    រឿង រ៉ូមេអូ និង ហ្ស៊ុយលីយេ សង្ខេបរឿង តួអង្គ បញ្ជីណែនាំ

                    QGIS export composer to PDF scale the map [closed] Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Print Composer QGIS 2.6, how to export image?QGIS 2.8.1 print composer won't export all OpenCycleMap base layer tilesSave Print/Map QGIS composer view as PNG/PDF using Python (without changing anything in visible layout)?Export QGIS Print Composer PDF with searchable text labelsQGIS Print Composer does not change from landscape to portrait orientation?How can I avoid map size and scale changes in print composer?Fuzzy PDF export in QGIS running on macSierra OSExport the legend into its 100% size using Print ComposerScale-dependent rendering in QGIS PDF output

                    PDF-ში გადმოწერა სანავიგაციო მენიუproject page