Toblerity / Fiona

Fiona reads and writes geographic data files
https://fiona.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
1.15k stars 202 forks source link

Make features printable again #1379

Closed loicdtx closed 5 months ago

loicdtx commented 5 months ago

I have a (hopefully easy) feature suggestion. I miss the ability to simply print a feature and inspects its properties; geometry coordinates, etc. This used to be possible in previous versions of Fiona that used a different data model, but is no longer the case. Any chance to bring this back? Would adding a __str__() method to Object be sufficient?

sgillies commented 5 months ago

Agreed @loicdtx. I could add a __repr__() to model classes that returns a GeoJSON-like dict representation. __str__() would use that by default. Would that work for you?

loicdtx commented 5 months ago

@sgillies that's precisely what I'm after. Great!