-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitOrigin-RevId: 6d3315ddd9c1042aa2042bb24c48188f85632a87
- Loading branch information
1 parent
e0eed27
commit 092bb20
Showing
24 changed files
with
3,756 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from typing import Any, Dict | ||
from uuid import uuid4 | ||
|
||
from pydantic import BaseModel, Field | ||
|
||
|
||
class VectorBaseModel(BaseModel): | ||
uuid: str = Field( | ||
default_factory=uuid4, | ||
json_schema_extra={"primary_key": True}, | ||
) | ||
|
||
|
||
class PointBaseModel(VectorBaseModel): | ||
geometry: str = Field(json_schema_extra={"geometry": "POINT"}) | ||
|
||
|
||
class LineBaseModel(VectorBaseModel): | ||
geometry: str = Field(json_schema_extra={"geometry": "LINESTRING"}) | ||
|
||
|
||
class PolygonBaseModel(VectorBaseModel): | ||
geometry: str = Field(json_schema_extra={"geometry": "POLYGON"}) | ||
|
||
|
||
class MultiPointBaseModel(VectorBaseModel): | ||
geometry: str = Field(json_schema_extra={"geometry": "MULTIPOINT"}) | ||
|
||
|
||
class MultiLineBaseModel(VectorBaseModel): | ||
geometry: str = Field(json_schema_extra={"geometry": "MULTILINESTRING"}) | ||
|
||
|
||
class MultiPolygonBaseModel(VectorBaseModel): | ||
geometry: str = Field(json_schema_extra={"geometry": "MULTIPOLYGON"}) | ||
|
||
|
||
class GenericFeatureBaseModel(VectorBaseModel): | ||
geometry: str = Field(json_schema_extra={"geometry": "GEOMETRY"}) | ||
properties: Dict[str, Any] = {} |
Oops, something went wrong.