Select to view content in your preferred language

Convert Schema Report not working after modifying the SpatialReference Schema Report tab

801
5
06-05-2024 11:40 AM
Labels (3)
gis_bCapell
Occasional Contributor

I attempted to utilize this workflow advertised with the ArcGIS Pro 3.3 release and recieved an error. 

I used Generate Schema Report to produce a .xlsx file. I edited the SpatialReference tab to this:

gis_bCapell_0-1717612456053.png using the name and code from the ArcGIS Pro map coordinate system setting options, and the wkt from this https://epsg.io/102022.wkt. Then I attempted to run Convert Schema Report and received the error below. @ShareUser Where can I access standard spatial reference content to use when modifying the schema report so I use the correct formatting?

Traceback (most recent call last):
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\ConvertSchemaReport.tool\tool.script.execute.py", line 4, in <module>
    result = gdbschema.convert_report(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 168, in convert_report
    _convert(report, **files)
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 103, in _convert
    converter = ConvertPayload(input_file)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 9, in __init__
    self.payload = self._convert_file(input_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 19, in _convert_file
    return ConvertDataElement(file).to_json()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\to_json\workspace.py", line 210, in __init__
    self.spatial_references: dict[int, dict] = dict(self._extract_spatial_references())
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\to_json\workspace.py", line 228, in _extract_spatial_references
    extent = arcpy.Extent(spatial_reference=arcpy.SpatialReference(text=row[SpatialReference.WKT])).JSON
                                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\arcobjects\mixins.py", line 276, in __init__
    self._arc_object.loadFromString(text)
ValueError: SpatialReference: Spatial reference string is invalid.
Failed script Convert Schema Report...
Failed to execute (ConvertSchemaReport).

 

5 Replies
GISAdminApplications
Emerging Contributor

I am experiencing a similar issue after modifying the Schema Report

Traceback (most recent call last):
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\toolboxes\Data Management Tools.tbx\ConvertSchemaReport.tool\tool.script.execute.py", line 4, in <module>
    result = gdbschema.convert_report(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 168, in convert_report
    _convert(report, **files)
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 103, in _convert
    converter = ConvertPayload(input_file)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 9, in __init__
    self.payload = self._convert_file(input_file)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\__init__.py", line 19, in _convert_file
    return ConvertDataElement(file).to_json()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\to_json\workspace.py", line 600, in to_json
    **self.convert_workspace_properties(),
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\to_json\workspace.py", line 270, in convert_workspace_properties
    return Workspace.to_json(props.data(True))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "c:\program files\arcgis\pro\Resources\ArcToolbox\Scripts\gdbschema\conversion\__init__.py", line 129, in to_json
    result["catalogPath"] = pathlib.Path(result["catalogPath"]).joinpath(result["name"]).as_posix()
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\pathlib.py", line 871, in __new__
    self = cls._from_parts(args)
           ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\pathlib.py", line 509, in _from_parts
    drv, root, parts = self._parse_args(args)
                       ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\pathlib.py", line 493, in _parse_args
    a = os.fspath(a)
        ^^^^^^^^^^^^
TypeError: expected str, bytes or os.PathLike object, not NoneType

Failed script Convert Schema Report...
Failed to execute (ConvertSchemaReport).
Y_Chau
by
Frequent Contributor

I am experiencing this problem too. Esri, please advise.

In my case I am trying to edit the spatial reference from XY only to XYZ. I copied the contents of Spatial Reference sheet from another excel.

Is XY to XYZ not allowed?

SummerBailey-Kerber
New Contributor

I'm getting the same error following the same documented workflow in ArcPro 3.3.2 but just changing the order of the fields in the schema report.

LauraleeGann25
Emerging Contributor

I had the same error issue until I read the part below in Editing Schema Reports for XML Conversion   2. XML conversion supports reports at the geodatabase level only

In ArcGIS Pro 3.3, only reports generated at the geodatabase level produce a valid XML workspace document. Schema reports created from individual feature classes, tables, or feature datasets lack geodatabase level information required for a complete XML workspace document. In the coming release of ArcGIS Pro 3.4, Convert Schema Report has been enhanced to support converting reports produced from individual feature classes, tables, and feature datasets.

KevinN_CSJ
Occasional Contributor

THANK YOU!! If I could give you more than one kudo I would.

This was driving me crazy trying to figure out why it was failing to convert my edited JSON schema report back to XML so I could import it, but I had exported the original JSON from my feature class instead of the GDB level.