Why support WKT? #95
-
I was working on a fix for #89 and it broke the WKT implementation and corresponding tests. I went down the rabbit hole and started refactoring all of it so it would work better and cleaner but it got me thinking: Why does
It is a library for creating and validating GeoJSON based on the spec. And directly supporting WKT does not serve that purpose. I checked and https://github.com/jazzband/geojson and it does not directly support WKT either. Why should a GeoJSON library support anything other than GeoJSON and Since the library already supports from shapely.geometry import shape
from geojson_pydantic import Point
shape(Point(type="Point", coordinates=(1,1))).wkt
# 'POINT (1 1)' Arguments against keeping WKT:
Arguments for keeping WKT:
And don't get me wrong. It is convenient, even nice to have in some cases, but it also seems like its outside the scope of the library. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
@eseglem thanks for working on this. As I'm the one who added WKT, I will argue that it's a really useful feature which at the time didn't look like something that would requirement too much work and burden to maintain. In a sense, you can export a model to
Shapely is a HUGE library which comes with some C lib, geojson-pydantic has only pydantic has requirement so it's relatively lightweight which make have a WKT feature really interesting. |
Beta Was this translation helpful? Give feedback.
@eseglem thanks for working on this.
As I'm the one who added WKT, I will argue that it's a really useful feature which at the time didn't look like something that would requirement too much work and burden to maintain.
In a sense, you can export a model to
dict
andjson
so why notwkt
🤷♂️Shapely is a HUGE library which comes with some C lib, geojson-pydantic has only pydantic has re…