Publishing Geospatial data with a joined table

1498
4
04-30-2021 10:40 AM
James_Armstrong
Occasional Contributor

Ok,  here is the senario:

  • I have a some line and point data, (Water Lines and Hydrants, amoung others).  Both the water line and hydrant data have attributes, but not the ones that are needed.  Athese feature classes are contained in a Postgre database. These feature class have been published to a Portal and are to be consumed in a dashboard.
  • I have an excel table (from a third party) that has a number of attribute data the we desire as we want to use them as part of the previously mentioned Dashboard.
  • After publishing both FC and the table, I tried to join them within a Web Map.  A big issue is that such a join creates a hosted feature set that is no longer connected to the orginal publish feature class. This is important as there are edits being done to the Enterprise Data sets and FC.
  • I have tried to join the FC and table in ArcGIS Pro before publishing, but it errors out 99999.

Overall, Im not sure I am thinking about the process in the correct way.  Any ideas anyone?

4 Replies
DavidPike
MVP Frequent Contributor

Do you need to retain the relationship of the join or do you just need to transfer the attributes once?  I'd just add the join then export to a new feature class and publish that.  It's probably erroring because the server can't see or publish the xls.

jcarlson
MVP Esteemed Contributor

We had a similar situation in the past, joining parcel data to outside assessment data. What we did:

  1. Copy the outside data into the Postgres database as a table
    1. May want to script it out if this is updated frequently
  2. Create a Query Layer that joins the tables together
  3. Publish the service

The resulting service will show the fields like they were "baked in", so to speak. End users will have no way of knowing that the source of the data is actually multiple tables. Since the query layer references the database, as the underlying tables are updated, so too will the query layer update.

- Josh Carlson
Kendall County GIS
James_Armstrong
Occasional Contributor

Josh,  thanks to the insight.  I believe this is the process that I need.  The current issue is that when importing the table (csv) into the Enterprise GDB, an Object-id field is created.  This seems to casue a duplicated field.  Unfortunatly, I dont seem to be able to delete the ObjectID field in the new table.  Ay ideas?

0 Kudos
jcarlson
MVP Esteemed Contributor

It's true, there will be an objectID field. But if you're publishing the service from a query, you only need to include one unique identifier. You can leave the objectID on the imported table for the database's own internal management, but the query layer need not expose that field.

SELECT
  a.objectid,
  a.some_field,
  b.another_field,
  b.etcetera,
  a.shape
FROM first_table a
LEFT JOIN second_table b ON a.shared_field = b.shared_field

 

- Josh Carlson
Kendall County GIS
0 Kudos