Spatially Enabled Dataframe to Feature Service - how to avoid shapefile conversion?

426
3
11-15-2022 11:37 AM
I_AM_ERROR
Occasional Contributor

Hi All,

Fairly new to publishing spatially enabled dataframes, looking for advice on the following

  • python env either does not have arcpy, or has arcpy but does not have a license (not checked out or connected to license server
  • create a spatially enabled dataframe from various data inputs
  • publish to AGOL/Portal using either df.spatial.to_featurelayer() or gis.content.import_data()

Both of the above methods seem to export the dataframe out to shapefile first before publishing to feature class. This is causing a couple issues on the back end (field values are being converted to different datatypes resulting in a failed publish)

Is there a better way to publish spatially enabled dataframes in an environment that is not using arcpy?

Thanks!

 

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

A better way would probably be to avoid it entirely. I've had lots of similar trouble publishing from a dataframe directly to a layer.

Personally, I would built the destination layer first in order to control the data types, then use the Python API to append data to it.

- Josh Carlson
Kendall County GIS
I_AM_ERROR
Occasional Contributor

I was considering that and, yeah it would probably give better control over the destination schema.

0 Kudos
I_AM_ERROR
Occasional Contributor

Just feels pretty odd having to write a file out to disk just to immediately read it back in....😐

0 Kudos