Skip to content

Commit

Permalink
cadc-dali: add MultiPolygonFormat to default FormatFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
pdowler committed May 8, 2024
1 parent a008f37 commit 54c7582
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cadc-dali/src/main/java/ca/nrc/cadc/dali/util/FormatFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public Format getFormat(VOTableField field) {
ret = new CircleFormat();
} else if ("polygon".equalsIgnoreCase(field.xtype)) {
ret = new PolygonFormat();
} else if ("multipolygon".equalsIgnoreCase(field.xtype)) {
ret = new MultiPolygonFormat();
} else if ("interval".equalsIgnoreCase(field.xtype)) {
ret = new DoubleIntervalFormat();
} else if (field.getArrayShape().length == 1) {
Expand All @@ -163,6 +165,8 @@ public Format getFormat(VOTableField field) {
ret = new CircleFormat();
} else if ("polygon".equalsIgnoreCase(field.xtype)) {
ret = new PolygonFormat();
} else if ("multipolygon".equalsIgnoreCase(field.xtype)) {
ret = new MultiPolygonFormat();
} else if ("interval".equalsIgnoreCase(field.xtype)) {
if (field.getArrayShape().length == 1 && field.getArrayShape()[0] == 2) {
ret = new DoubleIntervalFormat();
Expand All @@ -185,17 +189,17 @@ public Format getFormat(VOTableField field) {
if (isArray(field)) {
if ("timestamp".equalsIgnoreCase(field.xtype)) { // DALI-1.1
ret = new UTCTimestampFormat();
} else if (field.xtype != null && field.xtype.endsWith("shape")) { // DALI-1.2 prototype, ignore prefix
} else if (field.xtype != null && field.xtype.endsWith("shape")) { // DALI-1.2
ret = new ShapeFormat();
} else if ("adql:timestamp".equalsIgnoreCase(field.xtype)) {
ret = new UTCTimestampFormat();
} else if ("adql:point".equalsIgnoreCase(field.xtype)) {
ret = new STCPositionFormat();
} else if ("adql:region".equalsIgnoreCase(field.xtype)) {
ret = new STCRegionFormat();
} else if ("uuid".equalsIgnoreCase(field.xtype)) { // custom
} else if ("uuid".equalsIgnoreCase(field.xtype)) { // DALI-1.2
ret = new UUIDFormat();
} else if ("uri".equalsIgnoreCase(field.xtype)) { // custom
} else if ("uri".equalsIgnoreCase(field.xtype)) { // DALI-1.2
ret = new URIFormat();
}
}
Expand Down

0 comments on commit 54c7582

Please sign in to comment.