Skip to content

Commit

Permalink
Implement Support for GIS Queries (#467)
Browse files Browse the repository at this point in the history
Co-authored-by: datomo <david.lengweiler@unibas.ch>
  • Loading branch information
danylokravchenko and datomo authored Aug 19, 2024
1 parent 8a861c8 commit 0c29181
Show file tree
Hide file tree
Showing 79 changed files with 5,377 additions and 953 deletions.
7 changes: 7 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,14 @@ dependencies {

api group: "io.activej", name: "activej-serializer", version: activej_serializer_version

// GIS
api group: "org.locationtech.jts", name: "jts-core", version: jts_version // Eclipse Public License 2.0 && Eclipse Distribution License 1.0 (BSD-3 Clause)
api group: "org.locationtech.jts.io", name: "jts-io-common", version: jts_version // Eclipse Public License 2.0 && Eclipse Distribution License 1.0 (BSD-3 Clause)
api group: "org.locationtech.proj4j", name: "proj4j", version: proj4j_version // Apache 2.0
api group: "org.locationtech.proj4j", name: "proj4j-epsg", version: proj4j_version // Apache 2.0

// --- Test Compile ---
testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter', version: junit_jupiter_version
testRuntimeOnly(group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junit_jupiter_version)
testImplementation group: "org.hamcrest", name: "hamcrest-core", version: hamcrest_core_version // BSD 3-clause
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2019-2021 The Polypheny Project
* Copyright 2019-2024 The Polypheny Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,6 +18,7 @@

import static org.polypheny.db.algebra.constant.FunctionCategory.Property.DISTANCE_FUNCTION;
import static org.polypheny.db.algebra.constant.FunctionCategory.Property.FUNCTION;
import static org.polypheny.db.algebra.constant.FunctionCategory.Property.GEO_FUNCTION;
import static org.polypheny.db.algebra.constant.FunctionCategory.Property.MULTIMEDIA_FUNCTION;
import static org.polypheny.db.algebra.constant.FunctionCategory.Property.SPECIFIC;
import static org.polypheny.db.algebra.constant.FunctionCategory.Property.TABLE_FUNCTION;
Expand All @@ -44,7 +45,8 @@ public enum FunctionCategory {
USER_DEFINED_TABLE_SPECIFIC_FUNCTION( "TABLE_UDF_SPECIFIC", "User-defined table function with SPECIFIC name", USER_DEFINED, TABLE_FUNCTION, SPECIFIC ),
MATCH_RECOGNIZE( "MATCH_RECOGNIZE", "MATCH_RECOGNIZE function", TABLE_FUNCTION ),
DISTANCE( "DISTANCE", "distance function", DISTANCE_FUNCTION ),
MULTIMEDIA( "MULTIMEDIA", "Multimedia function", MULTIMEDIA_FUNCTION );
MULTIMEDIA( "MULTIMEDIA", "Multimedia function", MULTIMEDIA_FUNCTION ),
GEOMETRY( "GEOMETRY", "Geo function", GEO_FUNCTION );

private final EnumSet<Property> properties;

Expand All @@ -71,6 +73,11 @@ public boolean isMultimedia() {
}


public boolean isGeo() {
return properties.contains( GEO_FUNCTION );
}


public boolean isTableFunction() {
return properties.contains( TABLE_FUNCTION );
}
Expand All @@ -97,7 +104,7 @@ public boolean isUserDefinedNotSpecificFunction() {
* Property of a SqlFunctionCategory.
*/
enum Property {
USER_DEFINED, TABLE_FUNCTION, SPECIFIC, FUNCTION, DISTANCE_FUNCTION, MULTIMEDIA_FUNCTION
USER_DEFINED, TABLE_FUNCTION, SPECIFIC, FUNCTION, DISTANCE_FUNCTION, MULTIMEDIA_FUNCTION, GEO_FUNCTION
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ public enum Kind {
*/
DISTANCE,

/**
* GEO functions.
*/
GEO,

/**
* POSITION Function
*/
Expand Down Expand Up @@ -1233,7 +1238,6 @@ public enum Kind {

/**
* DDL statement not handled above.
*
*/
OTHER_DDL,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file incorporates code covered by the following terms:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.polypheny.db.algebra.enumerable;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ private EnumerableRules() {

public static final EnumerableScanRule ENUMERABLE_TABLE_SCAN_RULE = new EnumerableScanRule( AlgFactories.LOGICAL_BUILDER );

public static final EnumerableTableFunctionScanRule ENUMERABLE_TABLE_FUNCTION_SCAN_RULE = new EnumerableTableFunctionScanRule( AlgFactories.LOGICAL_BUILDER );

public static final EnumerableTransformerRule ENUMERABLE_TRANSFORMER_RULE = new EnumerableTransformerRule();

public static final EnumerableLpgMatchRule ENUMERABLE_GRAPH_MATCH_RULE = new EnumerableLpgMatchRule( AlgFactories.LOGICAL_BUILDER );
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,3 @@ public Expression comparer() {
*/
public abstract Expression field( Expression expression, int field, Type fromType, Type fieldType );
}

Loading

0 comments on commit 0c29181

Please sign in to comment.