-
Notifications
You must be signed in to change notification settings - Fork 181
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
DDF-4652 Add coordinate order handling to HandlebarsWfsFeatureTransfo… #4654
DDF-4652 Add coordinate order handling to HandlebarsWfsFeatureTransfo… #4654
Conversation
@@ -309,7 +308,6 @@ private void readGmlData( | |||
} | |||
} finally { | |||
eventWriter.close(); | |||
IOUtils.closeQuietly(stringWriter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because closing a StringWriter
has no effect.
@@ -230,7 +230,6 @@ private String getNamespaceAlias(String namespace, Map<String, String> namespace | |||
private String getIdAttributeValue( | |||
StartElement startElement, Map<String, String> namespaces, String namespaceAlias) { | |||
String id = null; | |||
startElement.getAttributeByName(new QName(namespaces.get(namespaceAlias), "id")).getValue(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed because the getValue()
call can cause a NullPointerException
when the element has no gml:id
attribute. And this statement appears to serve no purpose.
...a/org/codice/ddf/spatial/ogc/wfs/transformer/handlebars/HandlebarsWfsFeatureTransformer.java
Show resolved
Hide resolved
@jrnorth this one could use a rebase |
…rmer Previously, HandlebarsWfsFeatureTransformer would always reverse the coordinate order of every spatial feature when transforming them to WKT strings even if the coordinates were already in lon/lat order. This commit adds the ability to configure each HandlebarsWfsFeatureTransformer's feature coordinate order, that is, the coordinate order of its corresponding feature's spatial properties. The coordinate order will only be reversed if the feature coordinate order is lat/lon, since DDF expects WKT strings to be in lon/lat order.
6cb3336
to
22359fc
Compare
build now |
Internal build has been scheduled, your results will be available at build completion. |
Refer to this link for build results (access rights to CI server needed): Build result: ABORTED[...truncated 5.04 MB...][WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 167 iota=552[WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 341 iota=552[INFO] [INFO] ------------------------------------------------------------------------[INFO] Building DDF :: Distribution :: Docker :: DDF 2.15.0-SNAPSHOT[INFO] ------------------------------------------------------------------------������[INFO] [INFO] --- fmt-maven-plugin:2.3.0:check (default) @ ddf ---[warn] Source directory '/jenkins/workspace/DDF-Jobs/pr/Linux/distribution/docker/ddf/src/main/java' does not exist, ignoring.[warn] Test source directory '/jenkins/workspace/DDF-Jobs/pr/Linux/distribution/docker/ddf/src/test/java' does not exist, ignoring.[INFO] Processed 0 files (0 non-complying). [] [WARNING] Failed to notify spy hudson.maven.Maven3Builder$JenkinsEventSpy: java.util.concurrent.ExecutionException: Invalid object ID 341 iota=552[INFO] [INFO] --- maven-checkstyle-plugin:3.0.0:check (checkstyle-check) @ ddf ---Set build name.channel stoppedNew build name is 'PR 4654'Taking single-use slave mesos-jenkins-95edcf1fad034e0bb26f4db04d68eaa9-linux-large offline.Build was abortedArchiving artifactsAdding one-line test results to commit status...Setting status of 22359fc to FAILURE with url https://jenkins.codice.org/job/DDF-Jobs/job/pr/job/Linux/6646/ and message: 'JOB FAILURE: https://jenkins.codice.org/job/DDF-Jobs/job/pr/job/Linux/6646/ 24 tests run, 0 skipped, 0 failed.'Using context: Internal CI Pipeline❌ JOB FAILURE |
build now |
Internal build has been scheduled, your results will be available at build completion. |
verified coordinate order functionality in |
Refer to this link for build results (access rights to CI server needed): |
What does this PR do?
Previously, HandlebarsWfsFeatureTransformer would always reverse the coordinate order of every spatial feature when transforming them to WKT strings even if the coordinates were already in lon/lat order.
This commit adds the ability to configure each HandlebarsWfsFeatureTransformer's feature coordinate order, that is, the coordinate order of its corresponding feature's spatial properties. The coordinate order will only be reversed if the feature coordinate order is lat/lon, since DDF expects WKT strings to be in lon/lat order.
Who is reviewing it?
@dcruver
@leo-sakh
@samuelechu
@brianfelix
Select relevant component teams:
@codice/io
Ask 2 committers to review/merge the PR and tag them here.
@bdeining
@troymohl
How should this be tested?
WFS Feature to Metacard Templated Mapping
.a. For
Feature Type
, enter{http://stategeothermaldata.org/uri-gin/aasg/xmlschema/welllog/0.8}WellLog
b. Set the
Coordinate Order
toLat/Lon
.c. Add the following to
Attribute Mappings
:{"attributeName":"location","featureName":"Shape","template":"{{Shape}}"}
and{"attributeName":"title","featureName":"DisplayName","template":"{{DisplayName}}"}
d. Click
Save changes
.a. Disable the CN check and allow redirects. Leave everything else as-is.
ext.WellLog.LatDegree
> 0.WFS Feature to Metacard Templated Mapping
in the Admin UI, change the coordinate order toLon/Lat
and save the changes.Lat/Lon
, rerun the query, and verify the results appear in California again.Any background context you want to provide?
What are the relevant tickets?
Fixes: #4652
Checklist:
Notes on Review Process
Please see Notes on Review Process for further guidance on requirements for merging and abbreviated reviews.
Review Comment Legend: