Skip to content

can't import both StopPlaces and Parkings referring to each other in one go #209

@esuomi

Description

@esuomi

This is kind of a logical trap which in its current form blocks importing both StopPlaces and Parkings in one go.

What happens is that since import reassigns NeTEx id:s for all entities, one cannot know beforehand what the id:s will be and thus there isn't a valid parentSiteRef for Parking at time of creation - unless by accident at which point the Parking gets added to wrong Site, as it's relatively easy to believe that the stable NeTEx id given to the ref is the same as earlier defined in the same file.

To make this work in expected manner, the import should probably allow referring to StopPlace's imported-id key value property in place of the parentSiteRef. This is probably OK, as the Site > ParentSiteRef documentation simply states

Value dependent on context.

Alternatively to get this working as expected we'd need to split the import to two separate files, but as it's about the same effort to

  1. Import StopPlaces
  2. Get generated NeTEx id:s for imported StopPlaces
  3. Remap parkings list with correct id references
    as to
  4. Import StopPlaces
  5. Use the UI to insert Parking information

the import for parkings is somewhat infeasible for us at the moment.

Relevant lookup logic here: ParkingVersionedSaverService.java#L104-L114

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions