developmentseed/geojson-pydantic

Question: What is the purpose of __geo_interface__

Closed this issue · 1 comments

I am wondering what the purpose of __geo_interface__ is? I did some profiling of my FastAPI application and it turns out this property contributes second most to CPU time used:
image

def __geo_interface__(self):

the __geo_interface__ property is a standard for geometry object (supported by plenty GIS software) see: https://gist.github.com/sgillies/2217756

In geojson-pydantic, the property just call the Pydantic dict() method which require some CPU... but that's on the pydantic side 🤷‍♂️

it's kinda weird that this method is called 6680 time in your process.