Skip to content

Conversation

@eseglem
Copy link
Collaborator

@eseglem eseglem commented Aug 1, 2022

What I am changing

  • Make the _wkt_type function work when the class is inherited from.

How I did it

  • Switched the _wkt_type function to use the type. Since a "type" MUST exist in the spec, and it cannot be modified. It will always match the WKT type unlike the class name.

How you can test it

  • Tests still run properly. And now this works:
from geojson_pydantic import Point
class PointType(Point):
    ...

print(PointType(coordinates=[123, 123]).wkt)
# POINT (123.0 123.0)

Related Issues

Copy link
Contributor

@geospatial-jeff geospatial-jeff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vincentsarago vincentsarago merged commit b53d412 into developmentseed:master Aug 5, 2022
@eseglem eseglem deleted the feature/wtk-from-type branch February 10, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with "wkt" method.

3 participants