Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update netex java model 1.15 #136

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.entur</groupId>
<artifactId>netex-parser-java</artifactId>
<version>2.2.1-SNAPSHOT</version>
<version>2.3.0-SNAPSHOT</version>

<name>netex-java-parser</name>
<description>Library for parsing NeTEx files and looking up entities in an index.</description>
Expand Down Expand Up @@ -52,7 +52,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jdk.version>1.8</jdk.version>

<netex-java-model.version>1.0.14</netex-java-model.version>
<netex-java-model.version>1.0.15</netex-java-model.version>
<guava.version>32.0.0-jre</guava.version>

<nexus-staging-maven-plugin.version>1.6.12</nexus-staging-maven-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ private void parseStopAssignments(StopAssignmentsInFrame_RelStructure stopAssign
passengerStopAssignmentByStopPointRef.put(stopPointRef, assignment);

if (assignment.getQuayRef() != null) {
String quayRef = assignment.getQuayRef().getRef();
String quayRef = assignment.getQuayRef().getValue().getRef();
quayIdByStopPointRef.put(stopPointRef, quayRef);
}

if (assignment.getStopPlaceRef() != null) {
String stopPlaceRef = assignment.getStopPlaceRef().getRef();
String stopPlaceRef = assignment.getStopPlaceRef().getValue().getRef();
stopPlaceIdByStopPointRef.put(stopPointRef, stopPlaceRef);
}
}
Expand Down
16 changes: 9 additions & 7 deletions src/main/java/org/entur/netex/loader/parser/SiteFrameParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.rutebanken.netex.model.Quay;
import org.rutebanken.netex.model.Quays_RelStructure;
import org.rutebanken.netex.model.Site_VersionFrameStructure;
import org.rutebanken.netex.model.Site_VersionStructure;
import org.rutebanken.netex.model.StopPlace;
import org.rutebanken.netex.model.TariffZone;
import org.rutebanken.netex.model.TopographicPlace;
Expand Down Expand Up @@ -51,7 +52,7 @@ class SiteFrameParser extends NetexParser<Site_VersionFrameStructure> {
@Override
public void parse(Site_VersionFrameStructure frame) {
if (frame.getStopPlaces() != null) {
parseStopPlaces(frame.getStopPlaces().getStopPlace());
parseStopPlaces(frame.getStopPlaces().getStopPlace_());
}

if (frame.getGroupsOfStopPlaces() != null) {
Expand Down Expand Up @@ -118,8 +119,9 @@ private void parseGroupsOfStopPlaces(Collection<GroupOfStopPlaces> groupsOfStopP
groupsOfStopPlaces.addAll(groupsOfStopPlacesList);
}

private void parseStopPlaces(Collection<StopPlace> stopPlaceList) {
for (StopPlace stopPlace : stopPlaceList) {
private void parseStopPlaces(List<JAXBElement<? extends Site_VersionStructure>> stopPlaceList) {
for (JAXBElement<? extends Site_VersionStructure> jaxbStopPlace : stopPlaceList) {
StopPlace stopPlace = (StopPlace) jaxbStopPlace.getValue();
stopPlaces.add(stopPlace);
if (!isMultiModalStopPlace(stopPlace)) {
parseQuays(stopPlace.getQuays(), stopPlace.getId());
Expand Down Expand Up @@ -158,17 +160,17 @@ private void parseParkings(Collection<Parking> parkingList) {
private void parseQuays(Quays_RelStructure quayRefOrQuay, String stopPlaceId) {
if (quayRefOrQuay == null) return;

for (Object quayObject : quayRefOrQuay.getQuayRefOrQuay()) {
if (quayObject instanceof Quay) {
Quay quay = (Quay) quayObject;
for (JAXBElement<?> jaxbQuay : quayRefOrQuay.getQuayRefOrQuay()) {
if (jaxbQuay.getValue() instanceof Quay) {
Quay quay = (Quay) jaxbQuay.getValue();
String quayId = quay.getId();
quays.put(quayId, quay);
if (!stopPlaceIdByQuayId.containsKey(quayId)) {
stopPlaceIdByQuayId.put(quayId, stopPlaceId);
} else if (!stopPlaceIdByQuayId.get(quayId).equals(stopPlaceId)) {
// the Quay has been moved to another StopPlace. The latest version of the Quay is used for updating the Map (quay id --> stop place id)
Quay latestVersion = NetexVersionHelper.latestVersionedElementIn(quays.get(quayId));
if (quayObject.equals(latestVersion)) {
if (jaxbQuay.getValue().equals(latestVersion)) {
stopPlaceIdByQuayId.put(quayId, stopPlaceId);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void parse(Timetable_VersionFrameStructure frame) {

// Keep list sorted alphabetically
informOnElementIntentionallySkipped(LOG, frame.getBookingTimes());
informOnElementIntentionallySkipped(LOG, frame.getVehicleTypeRef());
informOnElementIntentionallySkipped(LOG, frame.getCoupledJourneys());
informOnElementIntentionallySkipped(LOG, frame.getDefaultInterchanges());
informOnElementIntentionallySkipped(LOG, frame.getFlexibleServiceProperties());
Expand Down