Skip to content

Commit

Permalink
GIS #462: defined Geometry in Mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
danylokravchenko committed Dec 12, 2023
1 parent e981474 commit c45b7be
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ public static PolyBoolean docGeoWithin( PolyValue input, PolyValue geometry ) {
if ( inputGeom == null || geom == null ) {
return PolyBoolean.FALSE;
}
boolean res = inputGeom.within( geom );
return PolyBoolean.of( inputGeom.within( geom ) );
}

Expand Down
7 changes: 5 additions & 2 deletions core/src/main/java/org/polypheny/db/util/BsonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,7 @@ public static Comparable<?> getMongoComparable( PolyType finalType, RexLiteral e
case VARCHAR:
return el.getValue();
case GEOMETRY:
return el.getValue().toString();
case FILE:
case IMAGE:
case VIDEO:
Expand Down Expand Up @@ -538,6 +539,7 @@ public static Class<?> getClassFromType( PolyType type ) {
case VARCHAR:
case BINARY:
case VARBINARY:
case GEOMETRY:
return String.class;
case FILE:
case IMAGE:
Expand Down Expand Up @@ -593,8 +595,8 @@ public static Document asDocument( BsonDocument bson ) {


/**
* Method to retrieve the type numbers according to the MongoDB specifications
* https://docs.mongodb.com/manual/reference/operator/query/type/
* Method to retrieve the type numbers according to the
* <a href="https://docs.mongodb.com/manual/reference/operator/query/type/">MongoDB specifications</a>
*
* @param type PolyType which is matched
* @return the corresponding type number for MongoDB
Expand Down Expand Up @@ -624,6 +626,7 @@ public static int getTypeNumber( PolyType type ) {
case VARCHAR:
case BINARY:
case VARBINARY:
case GEOMETRY:
return 2;
default:
throw new IllegalStateException( "Unexpected value: " + type );
Expand Down
2 changes: 1 addition & 1 deletion dbms/src/main/java/org/polypheny/db/PolyphenyDb.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public class PolyphenyDb {
public boolean daemonMode = false;

@Option(name = { "-defaultStore" }, description = "Type of default storeId")
public String defaultStoreName = "hsqldb";
public String defaultStoreName = "mongodb";

@Option(name = { "-defaultSource" }, description = "Type of default source")
public String defaultSourceName = "csv";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void readGeo() throws SQLException {
// --------------- Test spatial functions without the actual persisted data ----------------------

@Test
public void GeomFromText() throws SQLException {
public void geomFromText() throws SQLException {
try ( TestHelper.JdbcConnection polyphenyDbConnection = new TestHelper.JdbcConnection( true ) ) {
Connection connection = polyphenyDbConnection.getConnection();
try ( Statement statement = connection.createStatement() ) {
Expand Down

0 comments on commit c45b7be

Please sign in to comment.