Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #159 from dr-jts/oram-9.x
[GEOT-3101] Oracle SDO fixes to read measured geometries
- Loading branch information
Showing
3 changed files
with
389 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
modules/plugin/jdbc/jdbc-oracle/src/test/java/org/geotools/data/oracle/sdo/MDSYS.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.geotools.data.oracle.sdo; | ||
|
||
/** | ||
* Mimics Oracle MDSYS functions for building geometries. Useful for creating test objects. | ||
* | ||
* @author Martin Davis | ||
* | ||
*/ | ||
public class MDSYS { | ||
|
||
protected static final int NULL = -1; | ||
|
||
public static SDO_GEOMETRY SDO_GEOMETRY(int gType, int srid, int ptType, int[] elemInfo, | ||
double[] ordinates) { | ||
return new SDO_GEOMETRY(gType, srid, elemInfo, ordinates); | ||
} | ||
|
||
public static SDO_GEOMETRY SDO_GEOMETRY(int gType, int srid, double[] ptType, int null1, | ||
int null2) { | ||
return new SDO_GEOMETRY(gType, srid, ptType); | ||
} | ||
|
||
public static double[] SDO_POINT_TYPE(double x, double y, double z) { | ||
if (z == NULL) | ||
z = Double.NaN; | ||
return new double[] { x, y, z }; | ||
} | ||
|
||
public static int[] SDO_ELEM_INFO_ARRAY(int... i) { | ||
return i; | ||
} | ||
|
||
public static double[] SDO_ORDINATE_ARRAY(double... d) { | ||
return d; | ||
} | ||
|
||
public static class SDO_GEOMETRY { | ||
|
||
int gType; | ||
|
||
int srid; | ||
|
||
double[] ptType; | ||
|
||
int[] elemInfo; | ||
|
||
double[] ordinates; | ||
|
||
public SDO_GEOMETRY(int gType, int srid, int[] elemInfo, double[] ordinates) { | ||
this.gType = gType; | ||
this.srid = srid; | ||
this.elemInfo = elemInfo; | ||
this.ordinates = ordinates; | ||
} | ||
|
||
public SDO_GEOMETRY(int gType, int srid, double[] ptType) { | ||
this.gType = gType; | ||
this.srid = srid; | ||
this.ptType = ptType; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.