API reference

Geometry constructors

Import geometry models from cql2json_pydantic. The first argument accepts lists or tuples; additional fields such as bbox are keyword arguments.

Model First argument Coordinate structure
Point coordinates One position
Linestring coordinates Positions along a line
Polygon coordinates Rings, exterior first, then holes
Multipoint coordinates Positions
Multilinestring coordinates Lines of positions
Multipolygon coordinates Polygons of rings of positions
Geometrycollection geometries At least two geometry model instances

These are Pydantic models. They retain model_validate(), model_validate_json(), model_dump(), and model_dump_json(). Keyword construction and existing generated coordinate wrappers remain supported. The CQL2 schema and its validation constraints are unchanged.

See Build geometries for runnable examples.

Package API

Pydantic v2 models for building CQL2 JSON filters.

Array

Bases: RootModel[list[Union['Casei', Accenti, str, ArithmeticExpression, float, AndOrExpression, 'NotExpression', 'BinaryComparisonPredicate', 'IsLikePredicate', 'IsBetweenPredicate', 'IsInListPredicate', 'IsNullPredicate', 'SpatialPredicate', 'TemporalPredicate', 'ArrayPredicate', 'FunctionRef', bool, Point, Linestring, Polygon, Multipoint, Multilinestring, Multipolygon, Geometrycollection, BboxLiteral, DateInstant, TimestampInstant, 'IntervalInstance', 'Array', PropertyRef]]]

A recursive CQL2 array literal.

Source code in src/cql2json_pydantic/models.py
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
class Array(
    RootModel[
        list[
            Union[
                "Casei",
                Accenti,
                str,
                ArithmeticExpression,
                float,
                AndOrExpression,
                "NotExpression",
                "BinaryComparisonPredicate",
                "IsLikePredicate",
                "IsBetweenPredicate",
                "IsInListPredicate",
                "IsNullPredicate",
                "SpatialPredicate",
                "TemporalPredicate",
                "ArrayPredicate",
                "FunctionRef",
                bool,
                Point,
                Linestring,
                Polygon,
                Multipoint,
                Multilinestring,
                Multipolygon,
                Geometrycollection,
                BboxLiteral,
                DateInstant,
                TimestampInstant,
                "IntervalInstance",
                "Array",
                PropertyRef,
            ]
        ]
    ]
):
    """
    A recursive CQL2 array literal.
    """

    root: Annotated[
        list[
            Casei
            | Accenti
            | str
            | ArithmeticExpression
            | float
            | AndOrExpression
            | NotExpression
            | BinaryComparisonPredicate
            | IsLikePredicate
            | IsBetweenPredicate
            | IsInListPredicate
            | IsNullPredicate
            | SpatialPredicate
            | TemporalPredicate
            | ArrayPredicate
            | FunctionRef
            | bool
            | Point
            | Linestring
            | Polygon
            | Multipoint
            | Multilinestring
            | Multipolygon
            | Geometrycollection
            | BboxLiteral
            | DateInstant
            | TimestampInstant
            | IntervalInstance
            | Array
            | PropertyRef
        ],
        Field(min_length=0),
    ]
    """
    A recursive CQL2 array literal.
    """

root instance-attribute

A recursive CQL2 array literal.

Geometrycollection

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
class Geometrycollection(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["GeometryCollection"] = "GeometryCollection"
    geometries: Annotated[
        list[Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon],
        Field(min_length=2),
    ]

    def __init__(
        self,
        geometries: Sequence[
            Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon
        ]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword geometries.

        Args:
            geometries: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if geometries is not PydanticUndefined:
            data["geometries"] = geometries
        super().__init__(**data)

__init__(geometries=PydanticUndefined, **data)

Build a geometry from positional or keyword geometries.

Parameters:
  • geometries (Sequence[Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
def __init__(
    self,
    geometries: Sequence[
        Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon
    ]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword geometries.

    Args:
        geometries: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if geometries is not PydanticUndefined:
        data["geometries"] = geometries
    super().__init__(**data)

Linestring

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
class Linestring(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["LineString"] = "LineString"
    coordinates: Annotated[list[LinestringCoordinate], Field(min_length=2)]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[LinestringCoordinate | Sequence[float]]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[LinestringCoordinate | Sequence[float]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
def __init__(
    self,
    coordinates: Sequence[LinestringCoordinate | Sequence[float]]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Multilinestring

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
class Multilinestring(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["MultiLineString"] = "MultiLineString"
    coordinates: list[MultilinestringCoordinate]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[
            MultilinestringCoordinate | Sequence[MultilinestringCoordinateItem | Sequence[float]]
        ]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[MultilinestringCoordinate | Sequence[MultilinestringCoordinateItem | Sequence[float]]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
def __init__(
    self,
    coordinates: Sequence[
        MultilinestringCoordinate | Sequence[MultilinestringCoordinateItem | Sequence[float]]
    ]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Multipoint

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
class Multipoint(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["MultiPoint"] = "MultiPoint"
    coordinates: list[MultipointCoordinate]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[MultipointCoordinate | Sequence[float]]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[MultipointCoordinate | Sequence[float]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
def __init__(
    self,
    coordinates: Sequence[MultipointCoordinate | Sequence[float]]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Multipolygon

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
class Multipolygon(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["MultiPolygon"] = "MultiPolygon"
    coordinates: list[list[MultipolygonCoordinate]]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[
            Sequence[
                MultipolygonCoordinate | Sequence[MultipolygonCoordinateItem | Sequence[float]]
            ]
        ]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[Sequence[MultipolygonCoordinate | Sequence[MultipolygonCoordinateItem | Sequence[float]]]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
def __init__(
    self,
    coordinates: Sequence[
        Sequence[
            MultipolygonCoordinate | Sequence[MultipolygonCoordinateItem | Sequence[float]]
        ]
    ]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Point

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class Point(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["Point"] = "Point"
    coordinates: Annotated[list[float], Field(min_length=2)]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[float] | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[float] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
def __init__(
    self,
    coordinates: Sequence[float] | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Polygon

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
class Polygon(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["Polygon"] = "Polygon"
    coordinates: list[PolygonCoordinate]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[PolygonCoordinate | Sequence[PolygonCoordinateItem | Sequence[float]]]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[PolygonCoordinate | Sequence[PolygonCoordinateItem | Sequence[float]]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
def __init__(
    self,
    coordinates: Sequence[PolygonCoordinate | Sequence[PolygonCoordinateItem | Sequence[float]]]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Generated models

Array

Bases: RootModel[list[Union['Casei', Accenti, str, ArithmeticExpression, float, AndOrExpression, 'NotExpression', 'BinaryComparisonPredicate', 'IsLikePredicate', 'IsBetweenPredicate', 'IsInListPredicate', 'IsNullPredicate', 'SpatialPredicate', 'TemporalPredicate', 'ArrayPredicate', 'FunctionRef', bool, Point, Linestring, Polygon, Multipoint, Multilinestring, Multipolygon, Geometrycollection, BboxLiteral, DateInstant, TimestampInstant, 'IntervalInstance', 'Array', PropertyRef]]]

A recursive CQL2 array literal.

Source code in src/cql2json_pydantic/models.py
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
class Array(
    RootModel[
        list[
            Union[
                "Casei",
                Accenti,
                str,
                ArithmeticExpression,
                float,
                AndOrExpression,
                "NotExpression",
                "BinaryComparisonPredicate",
                "IsLikePredicate",
                "IsBetweenPredicate",
                "IsInListPredicate",
                "IsNullPredicate",
                "SpatialPredicate",
                "TemporalPredicate",
                "ArrayPredicate",
                "FunctionRef",
                bool,
                Point,
                Linestring,
                Polygon,
                Multipoint,
                Multilinestring,
                Multipolygon,
                Geometrycollection,
                BboxLiteral,
                DateInstant,
                TimestampInstant,
                "IntervalInstance",
                "Array",
                PropertyRef,
            ]
        ]
    ]
):
    """
    A recursive CQL2 array literal.
    """

    root: Annotated[
        list[
            Casei
            | Accenti
            | str
            | ArithmeticExpression
            | float
            | AndOrExpression
            | NotExpression
            | BinaryComparisonPredicate
            | IsLikePredicate
            | IsBetweenPredicate
            | IsInListPredicate
            | IsNullPredicate
            | SpatialPredicate
            | TemporalPredicate
            | ArrayPredicate
            | FunctionRef
            | bool
            | Point
            | Linestring
            | Polygon
            | Multipoint
            | Multilinestring
            | Multipolygon
            | Geometrycollection
            | BboxLiteral
            | DateInstant
            | TimestampInstant
            | IntervalInstance
            | Array
            | PropertyRef
        ],
        Field(min_length=0),
    ]
    """
    A recursive CQL2 array literal.
    """

root instance-attribute

A recursive CQL2 array literal.

Geometrycollection

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
class Geometrycollection(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["GeometryCollection"] = "GeometryCollection"
    geometries: Annotated[
        list[Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon],
        Field(min_length=2),
    ]

    def __init__(
        self,
        geometries: Sequence[
            Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon
        ]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword geometries.

        Args:
            geometries: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if geometries is not PydanticUndefined:
            data["geometries"] = geometries
        super().__init__(**data)

__init__(geometries=PydanticUndefined, **data)

Build a geometry from positional or keyword geometries.

Parameters:
  • geometries (Sequence[Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
def __init__(
    self,
    geometries: Sequence[
        Point | Linestring | Polygon | Multipoint | Multilinestring | Multipolygon
    ]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword geometries.

    Args:
        geometries: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if geometries is not PydanticUndefined:
        data["geometries"] = geometries
    super().__init__(**data)

Linestring

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
class Linestring(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["LineString"] = "LineString"
    coordinates: Annotated[list[LinestringCoordinate], Field(min_length=2)]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[LinestringCoordinate | Sequence[float]]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[LinestringCoordinate | Sequence[float]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
def __init__(
    self,
    coordinates: Sequence[LinestringCoordinate | Sequence[float]]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Multilinestring

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
class Multilinestring(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["MultiLineString"] = "MultiLineString"
    coordinates: list[MultilinestringCoordinate]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[
            MultilinestringCoordinate | Sequence[MultilinestringCoordinateItem | Sequence[float]]
        ]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[MultilinestringCoordinate | Sequence[MultilinestringCoordinateItem | Sequence[float]]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
def __init__(
    self,
    coordinates: Sequence[
        MultilinestringCoordinate | Sequence[MultilinestringCoordinateItem | Sequence[float]]
    ]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Multipoint

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
class Multipoint(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["MultiPoint"] = "MultiPoint"
    coordinates: list[MultipointCoordinate]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[MultipointCoordinate | Sequence[float]]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[MultipointCoordinate | Sequence[float]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
def __init__(
    self,
    coordinates: Sequence[MultipointCoordinate | Sequence[float]]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Multipolygon

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
class Multipolygon(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["MultiPolygon"] = "MultiPolygon"
    coordinates: list[list[MultipolygonCoordinate]]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[
            Sequence[
                MultipolygonCoordinate | Sequence[MultipolygonCoordinateItem | Sequence[float]]
            ]
        ]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[Sequence[MultipolygonCoordinate | Sequence[MultipolygonCoordinateItem | Sequence[float]]]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
def __init__(
    self,
    coordinates: Sequence[
        Sequence[
            MultipolygonCoordinate | Sequence[MultipolygonCoordinateItem | Sequence[float]]
        ]
    ]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Point

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
class Point(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["Point"] = "Point"
    coordinates: Annotated[list[float], Field(min_length=2)]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[float] | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[float] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
def __init__(
    self,
    coordinates: Sequence[float] | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)

Polygon

Bases: BaseModel

Source code in src/cql2json_pydantic/models.py
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
class Polygon(BaseModel):
    model_config = ConfigDict(
        extra="allow",
        populate_by_name=True,
    )
    type: Literal["Polygon"] = "Polygon"
    coordinates: list[PolygonCoordinate]
    bbox: Annotated[list[float] | None, Field(min_length=4)] = None

    def __init__(
        self,
        coordinates: Sequence[PolygonCoordinate | Sequence[PolygonCoordinateItem | Sequence[float]]]
        | PydanticUndefinedType = PydanticUndefined,
        **data: object,
    ) -> None:
        """Build a geometry from positional or keyword coordinates.

        Args:
            coordinates: Geometry members in GeoJSON order, as lists or tuples.
            **data: Additional GeoJSON fields, validated by the generated model.

        Raises:
            pydantic.ValidationError: If the geometry violates the schema constraints.
        """
        if coordinates is not PydanticUndefined:
            data["coordinates"] = coordinates
        super().__init__(**data)

__init__(coordinates=PydanticUndefined, **data)

Build a geometry from positional or keyword coordinates.

Parameters:
  • coordinates (Sequence[PolygonCoordinate | Sequence[PolygonCoordinateItem | Sequence[float]]] | PydanticUndefinedType, default: PydanticUndefined ) –

    Geometry members in GeoJSON order, as lists or tuples.

  • **data (object, default: {} ) –

    Additional GeoJSON fields, validated by the generated model.

Raises:
  • ValidationError –

    If the geometry violates the schema constraints.

Source code in src/cql2json_pydantic/models.py
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
def __init__(
    self,
    coordinates: Sequence[PolygonCoordinate | Sequence[PolygonCoordinateItem | Sequence[float]]]
    | PydanticUndefinedType = PydanticUndefined,
    **data: object,
) -> None:
    """Build a geometry from positional or keyword coordinates.

    Args:
        coordinates: Geometry members in GeoJSON order, as lists or tuples.
        **data: Additional GeoJSON fields, validated by the generated model.

    Raises:
        pydantic.ValidationError: If the geometry violates the schema constraints.
    """
    if coordinates is not PydanticUndefined:
        data["coordinates"] = coordinates
    super().__init__(**data)