archesproject / arches-her

6 stars 12 forks source link

Creating resources via the ArcGIS Pro plugin doesn't add geometries to Arches resource overlay map or spatial view (and attr table) #1343

Closed SDScandrettKint closed 2 months ago

SDScandrettKint commented 2 months ago

When using the ArcGIS Pro plugin's Create Resource feature, the created resource and it's geometry doesn't show on the Arches search overlay layer (despite being added to the geojson_geometries table) and isn't added to the spatial view, thus doesn't show on the ArcGIS Pro map.

Steps to reproduce:

  1. Create a resource using the ArcGIS Pro plugin
  2. Open up Arches and toggle on the resource overlay map - the geometry won't show
  3. Refresh the sp_attr table eg. select * from sp_attr_activity and the resourceinstanceid won't show as a row
  4. Refresh all geojson_geometries using SELECT refresh_geojson_geometries(); - now the geometry should show on the search page
  5. The geometry will, however, still not be in the spatial attributes table
SDScandrettKint commented 2 months ago

The first issue, seems to be solvable by changing the following line https://github.com/archesproject/arches/blob/20ce4f34e37a631875c99eba1fee86af4e4a31f0/arches/app/models/tile.py#L586 of tile.py to the following:

nodes = [SimpleNamespace(node) for node in self.serialized_graph["nodes"] if node["nodegroup_id"] == str(self.nodegroup_id)]

Adding str(self.nodegroup_id) allows the node to be found, which can then allow the geojson datatype to fire up the following function in datatypes.py https://github.com/archesproject/arches/blob/20ce4f34e37a631875c99eba1fee86af4e4a31f0/arches/app/datatypes/datatypes.py#L1417

This does not add the resource to the spatial attributes table. The database trigger is either not working, or happening out of time.

aj-he commented 2 months ago

@SDScandrettKint - this appears to be two separate issue as we do not have the bug above, but we do have the issue where spatial view doesn't add a row when the resource is created via NodeValue.

I suggest that the issue above is submitted as a core fix to 7.6, and then once approved, we temporarily patch in the fix until AfHER upgrades to 7.6.

The other issue of the spatial view being updated will also need to go into 7.6 as a migration and we'll need to see how we can hotfix now that AfHER is using the application pattern and running parallel migrations.

chiatt commented 2 months ago

This should be resolved by this fix: archesproject/arches#11483