green3g / vscode-arcgis-assistant

An arcgis administration tool for vscode
MIT License
29 stars 0 forks source link

Read FeatureService with multiple layers and tables #2

Closed lisastaehli closed 5 years ago

lisastaehli commented 5 years ago

Hi @roemhildtg. First of all, thanks for putting this plugin out there!

I am frequently editing the JSON of AGOL items (hosted feature services uploaded from FGDB) and it is very cumbersome sometimes, so this plugin is very exciting :). 👍

Unfortunately, reading FeatureServices with multiple layers and tables is not supported, which most of my items are. Do you think it should be possible to support this?

I can provide you with an example Feature Service (should be publicly available, has 3 layers and 5 tables): https://services9.arcgis.com/ZpmTCcECcEOnkrrK/arcgis/rest/services/Template_Master_Feature_Layer/FeatureServer

Thanks!

green3g commented 5 years ago

Hey @lisastaehli I'm not 100% sure. What is the item ID in AGO? I'll take a look at it.

You're not referring to editing actual features right? You're referring to the Feature layer JSON in portal?

lisastaehli commented 5 years ago

Yes, I am referring to the Feature Layer JSON in portal, not editing features. The Portal Item ID is: 31120a69fdc6474a956b2f71fa3360d9

green3g commented 5 years ago

I was able to modify the featurelayer json using these steps:

  1. Added the item to my ago account
  2. At this point I noticed, editing the feature layer in vscode showed an empty ""
  3. In arcgis online, I went to the feature layer -> Visualization
  4. I made some small change to the feature layer popup
  5. I saved the layer
  6. Now in VSCode, the JSON is fully populated and modifiable.
lisastaehli commented 5 years ago

Interesting. I will try that then. Seems a bit odd to me though, as if publishing a FGDB to a hosted feature service with multiple layers and tables does not create a correct JSON initially. But thanks for having a look at it :)

green3g commented 5 years ago

I too find it odd...I suppose there's some logic in AGO that checks to see if the layer has a JSON definition and if not, it builds its own from the rest endpoint.

Not the first time we've been fooled by AGO quirks and probably won't be the last :smile: