Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

Is it possible to publish a file geodatabase with two feature classes as two hosted feature services? #313

Closed AlexArcPy closed 7 years ago

AlexArcPy commented 7 years ago

ArcRest

Version 3.5.6

Enhancement

Repo Steps or Enhancement details

I have a file geodatabase with two feature classes. I want to create two hosted feature services in AGOL for organizations. Right now, I zip the file geodatabase, use addItem(), then use publishItem(). I do create a single hosted feature service containing two feature layers. Is there any way to create multiple hosted feature services - each for every feature class found within the zipped file geodatabase?

I currently publish multiple services by programmatically creating multiple geodatabases each containing a single feature class, but I feel there should be support for a more efficient workflow.

achapkowski commented 7 years ago

@AlexArcPy the normal workflow is that every feature class in the FGDB will be put in a single Feature Service. To split the FGDB, what you should probably do is just create multiple FGDB from the single source zip them up and upload individually. There is no REST function to split up a FGDB feature class/tables into separate HFS.

You could also use create service to manually create each HFS on portal/agol based on each feature class in the FGDB as well. To get the data in there, you would then use the addFeature() to add all the existing records. This is probably the hardest solution to implement initially, but it would give you the greatest flexibility in what you could do with the services.

AlexArcPy commented 7 years ago

@achapkowski , thanks a ton, good to know I haven't missed anything! I'll probably stick to the current workflow - just create multiple FGDB to publish each feature class individually. Thanks a lot for the detailed explanation, appreciated.