Hi there,
I am using an SEDF in ArcGIS Pro 3.1.0 on a regular basis. So far I am constructing it each day anew from an Excel file, which is slow. Now I would like to safe the data as a .parquet file, so I can quickly safe the SEDF on disk and load it whenever in a fast manner.
I tried two approaches.
1. with DASK
I used ddf = from_pandas(sdf, npartitions=1) and ddf.to_parquet(path_dir + 'test.parquet'
This throwns an Error:
ValueError: Failed to convert partition to expected pyarrow schema:
`ArrowInvalid("Could not convert bytearray(b'\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00 \\xf2\\xbd!A\\x00\\x00\\x00@^\\x9cVA') with type bytearray: converting to null type", 'Conversion failed for column SHAPE with type geometry')`
Any idea how I could get past the error?
I found the geoparquet file type, but no way to use dask for that?
Apparently geopandas has some compability, which at the moment I cant install as package ...
2. with the ArcGIS API
As described here, you can apparently write parquet files containing geometry with the ArcGIS API, but I couldn't read them with the sdf = pd.DataFrame.spatial.from_parquet('test.parquet') function, telling me:
ValueError: Missing geo metadata in Parquet/Feather file.
Use pandas.read_parquet/read_feather() instead.The doc allready tells me:
if no geometry columns are read, this will raise a ValueError - you should use the pandas read_parquet method instead.
Which from my perspective dosen't make a lot of sense since a geometry col is present ...
Edit1:
Changed the title to specify parquet.
Edit2:
Changed the title to specify feather/parquet/arrow
--------
In case this is useful, the output of sdf.info()
<class 'pandas.core.frame.DataFrame'>
Int64Index: 293321 entries, 0 to 293324
Data columns (total 23 columns):
# Column Non-Null Count Dtype
--- ------ -------------- -----
0 Date_Time_Alarm 293321 non-null datetime64[ns]
1 HE_Event_Num 292795 non-null string
2 Call_Sign 293321 non-null string
3 Station 293309 non-null string
4 E_Event_Num 293321 non-null string
5 Event_type 293321 non-null string
6 Destination 274531 non-null string
7 Orga_Name 293321 non-null string
8 Orga_Group 293321 non-null string
9 Event_min 293278 non-null float32
10 Transit_min 267680 non-null float32
11 Deployment_sec 291714 non-null float32
12 X 293321 non-null float32
13 Y 293321 non-null float32
14 Street 293219 non-null string
15 Housenumber 266766 non-null string
16 Address 275289 non-null string
17 DAT_TD_ND_CT 293321 non-null string
18 DAT_Weekday 293321 non-null string
19 Hour_CT_EVENT 293321 non-null int16
20 Month_CT_EVENT 293321 non-null int16
21 Year_CT_EVENT 293321 non-null int16
22 SHAPE 293321 non-null geometry
dtypes: datetime64[ns](1), float32(5), geometry(1), int16(3), string(13)
memory usage: 51.1 MB