|
6 | 6 |
|
7 | 7 | import org.junit.Test; |
8 | 8 |
|
| 9 | +import mil.nga.crs.bound.BoundCoordinateReferenceSystem; |
| 10 | +import mil.nga.crs.derived.DerivedCoordinateReferenceSystem; |
| 11 | +import mil.nga.crs.engineering.EngineeringCoordinateReferenceSystem; |
| 12 | +import mil.nga.crs.geo.GeoCoordinateReferenceSystem; |
| 13 | +import mil.nga.crs.metadata.CoordinateMetadata; |
| 14 | +import mil.nga.crs.operation.ConcatenatedOperation; |
| 15 | +import mil.nga.crs.operation.CoordinateOperation; |
| 16 | +import mil.nga.crs.operation.Operation; |
| 17 | +import mil.nga.crs.operation.PointMotionOperation; |
| 18 | +import mil.nga.crs.parametric.ParametricCoordinateReferenceSystem; |
| 19 | +import mil.nga.crs.projected.ProjectedCoordinateReferenceSystem; |
| 20 | +import mil.nga.crs.temporal.TemporalCoordinateReferenceSystem; |
| 21 | +import mil.nga.crs.vertical.VerticalCoordinateReferenceSystem; |
9 | 22 | import mil.nga.crs.wkt.CRSReader; |
10 | 23 | import mil.nga.crs.wkt.CRSWriter; |
11 | 24 |
|
@@ -61,7 +74,89 @@ private String testCRS(String wkt) throws IOException { |
61 | 74 | CategoryType category = crs.getCategoryType(); |
62 | 75 |
|
63 | 76 | String text = CRSWriter.write(crs); |
64 | | - String prettyText = CRSWriter.write(crs); |
| 77 | + String prettyText = CRSWriter.writePretty(crs); |
| 78 | + |
| 79 | + switch (category) { |
| 80 | + |
| 81 | + case CRS: |
| 82 | + |
| 83 | + CoordinateReferenceSystem coordRefSys = (CoordinateReferenceSystem) crs; |
| 84 | + |
| 85 | + switch (type) { |
| 86 | + case BOUND: |
| 87 | + BoundCoordinateReferenceSystem bound = (BoundCoordinateReferenceSystem) coordRefSys; |
| 88 | + // ... |
| 89 | + break; |
| 90 | + case COMPOUND: |
| 91 | + CompoundCoordinateReferenceSystem compound = (CompoundCoordinateReferenceSystem) coordRefSys; |
| 92 | + // ... |
| 93 | + break; |
| 94 | + case DERIVED: |
| 95 | + DerivedCoordinateReferenceSystem derived = (DerivedCoordinateReferenceSystem) coordRefSys; |
| 96 | + // ... |
| 97 | + break; |
| 98 | + case ENGINEERING: |
| 99 | + EngineeringCoordinateReferenceSystem engineering = (EngineeringCoordinateReferenceSystem) coordRefSys; |
| 100 | + // ... |
| 101 | + break; |
| 102 | + case GEODETIC: |
| 103 | + case GEOGRAPHIC: |
| 104 | + GeoCoordinateReferenceSystem geo = (GeoCoordinateReferenceSystem) coordRefSys; |
| 105 | + // ... |
| 106 | + break; |
| 107 | + case PARAMETRIC: |
| 108 | + ParametricCoordinateReferenceSystem parametric = (ParametricCoordinateReferenceSystem) coordRefSys; |
| 109 | + // ... |
| 110 | + break; |
| 111 | + case PROJECTED: |
| 112 | + ProjectedCoordinateReferenceSystem projected = (ProjectedCoordinateReferenceSystem) coordRefSys; |
| 113 | + // ... |
| 114 | + break; |
| 115 | + case TEMPORAL: |
| 116 | + TemporalCoordinateReferenceSystem temporal = (TemporalCoordinateReferenceSystem) coordRefSys; |
| 117 | + // ... |
| 118 | + break; |
| 119 | + case VERTICAL: |
| 120 | + VerticalCoordinateReferenceSystem vertical = (VerticalCoordinateReferenceSystem) coordRefSys; |
| 121 | + // ... |
| 122 | + break; |
| 123 | + default: |
| 124 | + } |
| 125 | + |
| 126 | + // ... |
| 127 | + break; |
| 128 | + |
| 129 | + case METADATA: |
| 130 | + |
| 131 | + CoordinateMetadata metadata = (CoordinateMetadata) crs; |
| 132 | + |
| 133 | + // ... |
| 134 | + break; |
| 135 | + |
| 136 | + case OPERATION: |
| 137 | + |
| 138 | + Operation operation = (Operation) crs; |
| 139 | + |
| 140 | + switch (type) { |
| 141 | + case CONCATENATED_OPERATION: |
| 142 | + ConcatenatedOperation concatenatedOperation = (ConcatenatedOperation) operation; |
| 143 | + // ... |
| 144 | + break; |
| 145 | + case COORDINATE_OPERATION: |
| 146 | + CoordinateOperation coordinateOperation = (CoordinateOperation) operation; |
| 147 | + // ... |
| 148 | + break; |
| 149 | + case POINT_MOTION_OPERATION: |
| 150 | + PointMotionOperation pointMotionOperation = (PointMotionOperation) operation; |
| 151 | + // ... |
| 152 | + break; |
| 153 | + default: |
| 154 | + } |
| 155 | + |
| 156 | + // ... |
| 157 | + break; |
| 158 | + |
| 159 | + } |
65 | 160 |
|
66 | 161 | return text; |
67 | 162 | } |
|
0 commit comments