v1.1: GeoJSON Polygon coordinates are one level too shallow, so no Curb Zone, Area or Space geometry validates
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 85/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- json, yaml
- Área
- api
Línea de trabajo
Empieza con Shared Data Models/geoJSON_polygon.yaml y Shared Data Models/geoJSON_linestring.yaml, y luego inspecciona cómo curb_zone.yaml los combina con oneOf. Valida los ejemplos de LineString y Polygon del issue frente al esquema de geometría de Curb Zone usando JSON Schema 2020-12. Se considera terminado cuando ambos ejemplos se validan y el esquema de polígono compartido exige coordenadas a nivel de anillo y fija el tipo de geometría.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
Shared Data Models/geoJSON_polygon.yaml types coordinates with $ref: ./coordinates.yaml, which is an array of [lon, lat] positions. That is LineString depth. In GeoJSON (RFC 7946 §3.1.6) a Polygon's coordinates are an array of linear rings, each ring an array of positions, so there is one more level of nesting.
This has two effects:
- A valid GeoJSON Polygon fails. Curb Area (
curb_area.yaml), Curb Space (curb_space.yaml) and Curb Objectobject_shapeall usegeoJSON_polygon.yaml, so none of them accept a real polygon. - A valid GeoJSON LineString also fails for Curb Zones.
curb_zone.yamldefinesgeometryasoneOf: [geoJSON_polygon, geoJSON_linestring]. Neither schema constrainstype, and both now accept an array of positions, so a LineString matches both branches andoneOfrejects it. Meanwhile a correct Polygon matches neither.
So today there is no geometry a Curb Zone can carry that validates, even though the spec says "A two-dimensional polygon is preferred, but a LineString is acceptable."
Reproduction
Validating the Curb Zone geometry schema from APIs/Curbs API.yaml (JSON Schema 2020-12, Python jsonschema 4.x):
| Geometry | Current schema | With proposed change |
|---|---|---|
Valid LineString {"type":"LineString","coordinates":[[-104.9536,39.7225],[-104.9535,39.7225]]} |
fails ("valid under each of" both oneOf branches) | passes |
Valid Polygon {"type":"Polygon","coordinates":[[[-104.9536,39.7225],[-104.9535,39.7225],[-104.9535,39.7226],[-104.9536,39.7225]]]} |
fails | passes |
I hit this while creating a CDS 1.1 feed for sample curb zones in Denver. The feed passes once the change below is applied, and fails only on these geometry errors without it.
Proposed change
Shared Data Models/geoJSON_polygon.yaml, give coordinates the ring level and pin type:
title: GeoJSON Polygon
x-stoplight:
id: qbu8vzmedfno6
type: object
description: The spatial extent of this curb feature and is represented as a GeoJSON geometry of type "Polygon" as defined in RFC 7946 3.1.6.
properties:
type:
type: string
x-stoplight:
id: o1fhr414qhn9t
description: A GeoJSON type.
enum:
- Polygon
example: Polygon
coordinates:
type: array
x-stoplight:
id: 9qlsbndcs89pk
description: An array of linear rings. The first ring is the exterior boundary and any others are holes. Each ring is a closed array of at least four positions, and each position is [longitude, latitude].
minItems: 1
items:
type: array
minItems: 4
items:
type: array
minItems: 2
maxItems: 2
items:
type: number
required:
- type
- coordinates
Shared Data Models/geoJSON_linestring.yaml, pin type so the Curb Zone oneOf can tell the two apart:
type:
type: string
description: A GeoJSON type.
enum:
- LineString
example: LineString
- Lenguaje dominante
- JavaScript
- Estrellas
- 7
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de openmobilityfoundation/cds-openapi
-
TODO: Update the text table for event_purpose.yamlQuizá libre de nuevo @michael-danko-passport la tomó hace 1155 días y no hay ningún pull request abierto. Abierto
openmobilityfoundation/cds-openapi#7 · 1 comentario · 1 asignado ·
-
Implement 501 status codeAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
openmobilityfoundation/cds-openapi#2 · 1 comentario ·
-
documentation
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
openmobilityfoundation/cds-openapi#5 · 4 comentarios ·
Todos los issues de openmobilityfoundation/cds-openapi
Issues similares
-
from-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
andromarces/agent-loops#1928 ·
Los mantenedores suelen responder en 1 día
-
enhancement help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
laaielichter/AgentHaven#79 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/playwright#44109 ·
Los mantenedores suelen responder en 1 día
-
Intl spec updatesAbiertoContent:JS goal: up-to-date needs BCD update
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día