so there is something wrong with this dataframe, that it seems i cant see.
SOURCE | Change | SHAPE | |
---|---|---|---|
1 | file_c | -0.29 | {'rings': [[[1788402.41, 13301439.29... |
2 | file_c | -0.24 | {'rings': [[[1788428.41, 13301463.29... |
5 | file_c | -0.24 | {'rings': [[[1788447.41, 13301429.29... |
When i try to write this to a featureclass
df.spatial.to_featureclass(r"C:\tmp\sample.shp")
I get
IndexError: only integers, slices (`:`), ellipsis (`...`), numpy.newaxis (`None`)....
What am i missing with this dataframe?
Solved! Go to Solution.
I am not sure if this is your only issue, but the syntax of you method call is incorrect:
to_featureclass
(out_location, out_name, overwrite=True, skip_invalid=True)converts a SpatialDataFrame to a feature class
Argument Description out_location Required string. A save location workspace out_name Required string. The name of the feature class to save as overwrite Optional boolean. True means to erase and replace value, false means to append skip_invalids Optional boolean. If True, any bad rows will be ignored.
Returns: string
I am not sure if this is your only issue, but the syntax of you method call is incorrect:
to_featureclass
(out_location, out_name, overwrite=True, skip_invalid=True)converts a SpatialDataFrame to a feature class
Argument Description out_location Required string. A save location workspace out_name Required string. The name of the feature class to save as overwrite Optional boolean. True means to erase and replace value, false means to append skip_invalids Optional boolean. If True, any bad rows will be ignored.
Returns: string
No, it works as i posted on all other dataframes.
perhaps those docs are out of date?
arcgis.features module — arcgis 1.6.2 documentation
to_featureclass(location, overwrite=True)
exports a geo enabled dataframe to a feature class.
So like i said, there is something odd with this dataframe that i can't seem to find
My bad, i thought you were using the older spatial dataframe, not the current geo-enabled dataframe. The syntax changed with the new dataframe.
What are the dtypes of the dataframe?
No problem, but as shocking as this may sound, i do believe that it was user error after all.
it was just where i was appending the dataframes earlier in the code. I still marked your response as helpful and correct.
Ah, it happens to the best of us. Since my response didn't directly address your issue, I will unmark my answer as correct, but I will mark the thread as assumed answered to close it out.
UPDATE: I forgot I am not a moderator in this space, so I can't make the change I stated above. I can't wait to get off this old Jive product for GeoNet.