Git Product home page Git Product logo

Comments (23)

trotor avatar trotor commented on August 22, 2024 2

from arcsdm.

irvcaza avatar irvcaza commented on August 22, 2024 1

Issue sent to Esri DE, waiting for response.

from arcsdm.

trotor avatar trotor commented on August 22, 2024 1

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Could someone test this with new demo dataset?

T

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Waiting for feedback, can't replicate

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Can't replicate this with user description of the problem with new demodata and toolbox (10.4.1 arcgis).

Completed script CalculateResponse...   Succeeded at Wed Jul 19 10:07:13 2017 (Elapsed Time: 1 minutes 17 seconds) | Completed script CalculateResponse...   Succeeded at Wed Jul 19 10:07:13 2017 (Elapsed Time: 1 minutes 17 seconds) | Completed script CalculateResponse... |   | Succeeded at Wed Jul 19 10:07:13 2017 (Elapsed Time: 1 minutes 17 seconds)
-- | -- | -- | -- | --
Completed script CalculateResponse...   Succeeded at Wed Jul 19 10:07:13 2017 (Elapsed Time: 1 minutes 17 seconds) | Completed script CalculateResponse... |   | Succeeded at Wed Jul 19 10:07:13 2017 (Elapsed Time: 1 minutes 17 seconds)
Completed script CalculateResponse...
  | Succeeded at Wed Jul 19 10:07:13 2017 (Elapsed Time: 1 minutes 17 seconds)

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Confirmed crash in ArcGis pro 2.0 investigating

from arcsdm.

trotor avatar trotor commented on August 22, 2024

arcpy.ArcSDM.CalculateResponse("lithoname200k", r"C:\ArcSDM\work\database.gdb\lithoname200k_WC", "orogenic_gold_thin", None, -99, 1, r"C:\ArcSDM\work\database.gdb\W_pprb", r"C:\ArcSDM\work\database.gdb\W_std", r"C:\ArcSDM\work\database.gdb\W_MDvar", r"C:\ArcSDM\work\database.gdb\W_Tstd", r"C:\ArcSDM\work\database.gdb\W_conf")

This crashes the tool - investigating

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Command line :

arcpy.ImportToolbox(r"C:\arcsdm\toolbox\arcsdm.pyt")

arcpy.env.workspace = r"C:\ArcSDM\work\database.gdb"
arcpy.env.scratchWorkspace = r"C:\ArcSDM\work\database.gdb"
arcpy.env.mask = r"C:\ArcSDM\work\database.gdb\study_area"

arcpy.ArcSDM.CalculateResponse(r"C:\ArcSDM\work\database.gdb\lithoname200k", r"C:\ArcSDM\work\database.gdb\lithoname200k_WC", r"C:\ArcSDM\work\database.gdb\orogenic_gold_thin", None, -99, 1, r"C:\ArcSDM\work\database.gdb\W_pprb", r"C:\ArcSDM\work\database.gdb\W_std", r"C:\ArcSDM\work\database.gdb\W_MDvar", r"C:\ArcSDM\work\database.gdb\W_Tstd", r"C:\ArcSDM\work\database.gdb\W_conf")

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Crash happens on this line (186):
gp.AddJoin_management(RasterLayer,"Value",Wts_Table,"CLASS")

from arcsdm.

irvcaza avatar irvcaza commented on August 22, 2024

Managed to execute Calculate response successfully using only

  • rc_till_cu
  • rc_magn_res4k
  • rc_em_real
    But any combination that contains
  • rc_dnsstru or
  • lithoname_200k
    produces the error. Therefore is more related to the layers.

Studding deeper I found out that the Coordinate Systems differ

  • orogenic_gold_thin -> EUREF_FIN_TM35FIN
  • rc_dnsstru -> ETRS_1989_Transverse_Mercator
  • rc_em_real -> EUREF_FIN_TM35FIN
  • rc_till_cu -> EUREF_FIN_TM35FIN
  • rc_magn_res4k -> EUREF_FIN_TM35FIN
  • lithoname200k -> ETRS_1989_Transverse_Mercator

That is possibly the origin of our error

from arcsdm.

trotor avatar trotor commented on August 22, 2024

It is problem with output spatial reference - needs confirmation

from arcsdm.

trotor avatar trotor commented on August 22, 2024

https://www.dropbox.com/s/nxmzxex0jhpbskq/issue44.rar?dl=0

Waiting for confirmation of bug.

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Closing this - demodata fixed and problem pinpointed. Thanks!

from arcsdm.

trotor avatar trotor commented on August 22, 2024

Reopening this because of #98

from arcsdm.

Eliasmgprado avatar Eliasmgprado commented on August 22, 2024

I'm with the same problem, using the data in ArcSDM_Demodata/DemoData_version_files (dowloaded from github) using the following layers for Wofe Demo testing:

  • orogenic_Au
  • lithoname200k
  • rc_till_cu
  • rc_till_co
  • rc_dst_worms
  • rc_appa_res
  • rc_magn_res4k

ArcMap crashes when Calculate Response is executed. I have already checked the spatial reference and its ok.

Running on ArcMap 10.5.1

from arcsdm.

trotor avatar trotor commented on August 22, 2024

from arcsdm.

Eliasmgprado avatar Eliasmgprado commented on August 22, 2024

Running on ArcMap 10.5.1

from arcsdm.

Eliasmgprado avatar Eliasmgprado commented on August 22, 2024

I got it!

The problem is in line 211 of calculateresponse.py

arcpy.AddJoin_management(RasterLayer,"VALUE",Wts_Table,"CLASS")

When i run the code below

my_raster_layer = arcpy.Raster(RasterLayer)
if my_raster_layer.hasRAT:
     arcpy.AddMessage("Has a VAT!")
else:
     arcpy.AddMessage("No VAT!")

before the line 205 - arcpy.MakeRasterLayer_management(Input_Raster,RasterLayer) -
the algorithm output "No VAT", that is, the RasterLayer created do not have Attribute Table, probably this is causing the crash.

This way, i have make the following modifications to the calculateresponse.py code for circunvent this issue.

  • Comment line 205
    arcpy.MakeRasterLayer_management(Input_Raster,RasterLayer)
  • Modified line 211, replacing RasterLayer by Input_Raster
    arcpy.AddJoin_management(Input_Raster,"VALUE",Wts_Table,"CLASS")
  • Modified line 236, replacing RasterLayer by Input_Raster
    arcpy.CopyRaster_management(Input_Raster,Temp_Raster,'#','#',NoDataArg2)
  • Comment line 381
    gp.makerasterlayer(Input_Raster,RasterLayer)
  • Comment line 383, No need for AddJoin again, as the Input_Raster already has the join
    gp.AddJoin_management(Input_Raster,"Value",Wts_Table,"CLASS")
  • Modified line 397, replacing RasterLayer by Input_Raster
    arcpy.CopyRaster_management(Input_Raster, Temp_Raster,"#","#",NoDataArg2)

After these modifications the code is running well. However for AddJoin_management() function work with the Input_Raster, i have to export all the used rasters to a gdb before running the tool.

Thanks for the attention, and for the help.

from arcsdm.

Eliasmgprado avatar Eliasmgprado commented on August 22, 2024

Yes, for AddJoin_management to work without use the makerasterlayer function, the input must be with geodatabase. But if you want the tool to accept file system inputs, you can add some lines of code to transform the input files to geodatabase before start join the tables.

from arcsdm.

artolaiho avatar artolaiho commented on August 22, 2024

I haven't same test data than above but I have tested with current data. My experience is that Calculate Response (from arto-dev branch) works with ArcMap and ArcGIS Pro if workspace is either File Geodatabase (which I recommend) or File System.

Here is short test using python on ArcMap 10.6.1:

import arcpy
print (arcpy.env.mask)
C:\ArcSDM\Work\DemoData_version_files\derivatives\study_area_g\study_area_g
import arcgisscripting
gp = arcgisscripting.create()
print(gp.workspace)
C:\ArcSDM\work
print(gp.scratchworkspace)
C:\ArcSDM\work\Scratch
Input_Raster = r"C:\ArcSDM\Work\DemoData_version_files\geology\lithoname200k\lithoname200k"
!!! Calculate Response may crash if Input Raster is RasterDataset but don't crash if it is RasterBand
Wts_Table = r"C:\ArcSDM\Work\DemoData_version_files\lithoname200k_CT.dbf"
!!! This table is output from Calculate Weights.
Training_Points = r"C:\ArcSDM\Work\DemoData_version_files\shape_files\Orogenic_Au.shp"
outputrastername = Input_Raster.replace(".","_")
outputrastername = outputrastername[:10] + "W"
Output_Raster = gp.CreateScratchName(outputrastername, '', 'rst', gp.scratchworkspace)
RasterLayer = "OutRas_lyr"
arcpy.MakeRasterLayer_management(Input_Raster,RasterLayer)
<Result 'OutRas_lyr'>
!!! MakeRasterLayer writes RasterLayer to TEMP folder.
arcpy.AddJoin_management(RasterLayer,"VALUE",Wts_Table,"CLASS")
<Result 'OutRas_lyr'>
Temp_Raster = gp.CreateScratchName('tmp_rst', '', 'rst', gp.scratchworkspace)
arcpy.CopyRaster_management(RasterLayer,Temp_Raster,'#','#','#')
<Result 'C:\ArcSDM\work\Scratch\tmp_rst17'>
outras = arcpy.sa.Lookup(Temp_Raster,"WEIGHT")

and so on... (without crash)

from arcsdm.

artolaiho avatar artolaiho commented on August 22, 2024

This works also with ArcMap 10.6.1 and ArcGIS Pro 2.5:
import arcpy
arcpy.ImportToolbox(r"C:\ArcSDM\Toolbox\ArcSDM.pyt")
arcpy.env.workspace = r"C:\ArcSDM\Work"
arcpy.env.scratchWorkspace = r"C:\ArcSDM\Work\Scratch"
arcpy.env.mask = r"C:\ArcSDM\Work\DemoData_version_files\derivatives\study_area_g\study_area_g"
!!! Note: Mask must be RasterBand, not RasterDataset (study_area_g twice above)
!!! Also Input raster must be RasterBand, not RasterDataset (lithoname200k twice below)
arcpy.ArcSDM.CalculateResponse(r"C:\ArcSDM\work\DemoData_version_files\geology\lithoname200k\lithoname200k", r"C:\ArcSDM\Work\DemoData_version_files\lithoname200k_CT.dbf", r"C:\ArcSDM\work\DemoData_version_files\shape_files\Orogenic_Au.shp", "#", -99, 1, r"C:\ArcSDM\work\W_pprb", r"C:\ArcSDM\work\W_std", r"C:\ArcSDM\work\W_MDvar", r"C:\ArcSDM\work\W_Tstd", r"C:\ArcSDM\work\W_conf")

from arcsdm.

artolaiho avatar artolaiho commented on August 22, 2024

Load the newest version of ArcSDM (V5.02) and test again. If the problem persists, reopen this issue.

from arcsdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.