Select to view content in your preferred language

Stacked Joined Feature View Layers using ArcGIS Python API

101
1
Tuesday
EstherJesintha
New Contributor
Hi,
 
I am attempting to recreate the stacked joined feature view layers as implemented in the ArcGIS SDG Solution Template, where a base polygon layer is joined with multiple goal-specific indicator tables to produce reusable thematic views (refer to screenshot)
EstherJesintha_0-1750826297259.png

 

Since this functionality isn’t available out-of-the-box, I’ve been exploring a custom implementation using the ArcGIS Python API, guided by the workflow described in this article.
 
In my case:
 
  • The base is a hosted feature layer (ReportingAreas)
  • The indicators are stored as structured tables within a single feature layer item (screenshot attached)
    EstherJesintha_1-1750826297261.png
  • The shared join field is Geography_ID

 

1. To test the operation, I have fetched my Feature Layer [ReportingAreas] and Table Layer [which has the individual goal layers]
EstherJesintha_2-1750826297262.png
 
2. While indexing on the basis of the common Geography_ID field, I get a schema-related error, despite editing operations being enabled on a service level.
EstherJesintha_3-1750826297262.png

 

The intended outcome is to programmatically create joined feature view layers for each of the 17 indicator tables, using Geography_ID as the join key, in a form that is scalable for future updates.  [as shown in the first screenshot]
 
If there are publishing configurations or coded mechanisms (as used in the SDG deployment) that enable this, any insight into the recommended approach would be appreciated as I align my implementation accordingly. Kindly advise.
 
0 Kudos
1 Reply
Clubdebambos
MVP Regular Contributor

Hi @EstherJesintha,

You can try set the sourceSchemaChangesAllowed property for a Feature Service to true, since being false is what is causing the error. You might have to do this for you table too.

from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection

agol = GIS("home")

item = agol.content.get("FS_ITEM_ID")

flc = FeatureLayerCollection.fromitem(item)

print(flc.manager.update_definition({"sourceSchemaChangesAllowed" : True}))

 

 

~ learn.finaldraftmapping.com
0 Kudos