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

[feature] NeTEx France - Add AccessibilityAssessment on Quays #563

Merged
merged 3 commits into from
Mar 5, 2020

Conversation

ArnaudOggy
Copy link
Contributor

@ArnaudOggy ArnaudOggy commented Mar 3, 2020

some unit tests to do

woshilapin
woshilapin previously approved these changes Mar 4, 2020
@@ -312,6 +321,61 @@ impl<'a> StopExporter<'a> {
Ok(Some(centroid))
}

fn generate_quay_accessibility(&self, equipment_id: Option<&str>) -> Option<Element> {

This comment was marked as outdated.

This comment was marked as outdated.

})
}

fn generate_mobility_impaired_access(&self, equipment: &Equipment) -> Element {

This comment was marked as outdated.

This comment was marked as outdated.

.build()
}

fn generate_accessibility_limitations(&self, eq: &Equipment) -> Element {

This comment was marked as outdated.

This comment was marked as outdated.

) {
(Available, Available, Available) => "true",
(NotAvailable, NotAvailable, NotAvailable) => "false",
(Available, _, _) | (_, Available, _) | (_, _, Available) => "partial",

This comment was marked as outdated.

@@ -160,7 +161,7 @@ As stated in `NF_Profil NeTEx éléments communs(F) - v2.1.pdf` in chapter 5.10:
- `true` if all `AccessibilityLimitation` are set to `true`
- `false` if all `AccessibilityLimitation` are set to `false`
- `partial` if some `AccessibilityLimitation` are set to `true`
- `unknow` in other cases
- `unknown` in other cases

This comment was marked as outdated.

This comment was marked as outdated.

@@ -0,0 +1,3 @@
equipment_id,wheelchair_boarding
0,1

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@mergify mergify bot dismissed woshilapin’s stale review March 4, 2020 09:28

Pull request has been modified.

woshilapin
woshilapin previously approved these changes Mar 4, 2020
@mergify mergify bot dismissed woshilapin’s stale review March 4, 2020 15:27

Pull request has been modified.

Comment on lines 453 to 463
let writer = ElementWriter::new(element, false);
let mut buffer = Vec::<u8>::new();
writer.write(&mut buffer).unwrap();
String::from_utf8(buffer)
.unwrap()
.replace(
r#"<?xml version="1.0" encoding="UTF-8"?><MobilityImpairedAccess>"#,
"",
)
.replace(r#"</MobilityImpairedAccess>"#, "")
.to_owned()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you serialize the Element here? You can replace this whole function by the following code

element
    .nodes()
    .next()
    .unwrap()
    .as_text()
    .unwrap()
    .to_string()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit updated 23653f7

@ArnaudOggy ArnaudOggy force-pushed the quay_accessibility branch from 9f269c6 to 23653f7 Compare March 4, 2020 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants