DHI / DHI/mikecore-python

DfsuBuilder writes a metre quantity for X/Y static items even in geographic projections (disabled block at DfsuBuilder.py:524)

Abierto
#47 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
5
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

`mikecore/DfsuBuilder.py:521-528` sets the quantity used for the `X-coord` and `Y-coord` static items, with the geographic case commented out:

```python
xyQuantity = eumQuantity(eumItem.eumIGeographicalCoordinate, eumUnit.eumUmeter)

# TODO: reenable:
#if (MapProjection.IsValid(self.__dfsProjection.WKTString)):
# if (MapProjection.IsGeographical(self.__dfsProjection.WKTString)):
# xyQuantity = eumQuantity(eumItem.eumILatLong, eumUnit.eumUdegree)
```

As it stands, every dfsu written by `DfsuBuilder` gets `eumIGeographicalCoordinate` in metre for its X/Y static items — including files whose projection is geographic. For a `LONG/LAT` file the coordinates in those items are degrees, so the recorded unit is wrong: the disabled block is exactly what would have set `eumILatLong`/`eumUdegree` instead.

Reproduction: build a dfsu with `SetProjection` given the `LONG/LAT` WKT, write it, then read back the `X-coord` static item and inspect its quantity — it reports metre.

`Projections.py` already exposes the projection-inspection needed to re-enable this, so the question is whether the block was disabled for a reason (a dependency that was not ported, or a deliberate compatibility choice) or simply left behind. Not fixed here — writing a different quantity into files changes output, and that decision should be explicit.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza en mikecore/DfsuBuilder.py:521-528 e inspecciona los helpers de proyección ya expuestos en Projections.py. Reproduce el caso LONG/LAT descrito en el issue y determina después si el bloque deshabilitado de cantidades geográficas era intencionado o quedó pendiente. Se considera terminado cuando la decisión de compatibilidad es explícita y el comportamiento de la quantity de X/Y static-item se ha verificado conforme a esa decisión.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
backend
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Activo
Claridad
Bastante claro
Aptitud para principiantes
48/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.