Converting spatially enabled dataframe to feature class returns empty feature class

4291
6
12-18-2021 02:16 PM
DarrenConly
Occasional Contributor

Greetings All,

I'm trying to do the following:

  1. Convert JSON results from OpenRouteService API into geodataframe
  2. Convert a geopandas geodataframe to a Spatially enabled dataframe (SEDF) using .from_geodataframe() 
  3. Export the SEDF to a feature class using .to_featureclass()

 

As the screenshot below shows, the conversion from geopandas GDF to ESRI SEDF is successful, but when I try exporting the SEDF to a feature class, the resulting feature class has no features in it.

Other notes

  • I do have arcpy installed and imported it.
  • I also tried exporting SEDF to SHP, but that also returns zero features.
  • If I import a feature class to an SEDF then re-export the SEDF back to feature class, it works and I get the features as expected.
  • There *is* a workaround if I do the following: convert SEDF to FeatureSet > FeatureSet to geojson > run JSON to features in arcgis pro. The feature class resulting from this does work and contains the features I expect. But this is clunky!
  •  

Has anyone else experienced this?

Capture.PNG

 

Has anyone else experienced this?

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

related? Solved: Converting geodataframe to spatially enabled dataf... - Esri Community

there are some issues under consideration on github


... sort of retired...
0 Kudos
DarrenConly
Occasional Contributor

Could be. I read the thread you linked to. Problem is similar (issue going from SEDF to FC), but instead of my issue (writing empty FC), it seems to mangle the geometry when writing. Looking at the GitHub issue they opened, there will be a fix for the mangled geometry coming in January 2022, maybe that fix will also fix my problem?

0 Kudos
jcarlson
MVP Esteemed Contributor

I'm unable to replicate this issue. JSON -> GDF -> SEDF -> FC works like a charm anywhere I use the process (which is admittedly not often).

Have you done some other testing on your geodataframe to make sure it's valid? Like plot it, or run some other validation?

- Josh Carlson
Kendall County GIS
0 Kudos
DarrenConly
Occasional Contributor

Yes, it plots correctly when I plot the geopandas geodataframe:

DarrenConly_0-1639956849014.png

It also plots correctly after I convert the GDF to ESRI's SEDF:

DarrenConly_1-1639956918472.png

And as I mentioned in my original post, if I do SEDF > FeatureSet > GeoJSON File > Feature class, it works. So the kink is when trying to directly go from SEDF to feature class.

 

0 Kudos
BillyHansen6
New Contributor

I'm having the same problem! Would love some help if anybody has an idea why this is happening.

0 Kudos
BillyHansen6
New Contributor

Okay for me the problem was solved when I removed the date fields from my spatial dataframe. For some reason those were breaking the export. 

0 Kudos