Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
1,049 additions
and
132 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
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
39 changes: 39 additions & 0 deletions
39
src/main/java/com/orientechnologies/lucene/OLuceneSpatialManager.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,39 @@ | ||
/* | ||
* | ||
* * Copyright 2014 Orient Technologies. | ||
* * | ||
* * Licensed 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 com.orientechnologies.lucene; | ||
|
||
import com.orientechnologies.lucene.shape.OShapeBuilder; | ||
import com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx; | ||
|
||
/** | ||
* Created by Enrico Risa on 06/08/15. | ||
*/ | ||
public class OLuceneSpatialManager { | ||
|
||
|
||
private OShapeBuilder shapeFactory; | ||
|
||
public OLuceneSpatialManager(OShapeBuilder oShapeBuilder) { | ||
shapeFactory = oShapeBuilder; | ||
} | ||
|
||
public void init(ODatabaseDocumentTx db) { | ||
shapeFactory.initClazz(db); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/orientechnologies/lucene/exception/OSpatialException.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,25 @@ | ||
/* | ||
* | ||
* * Copyright 2014 Orient Technologies. | ||
* * | ||
* * Licensed 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 com.orientechnologies.lucene.exception; | ||
|
||
/** | ||
* Created by Enrico Risa on 06/08/15. | ||
*/ | ||
public class OSpatialException extends Exception { | ||
} |
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
69 changes: 0 additions & 69 deletions
69
src/main/java/com/orientechnologies/lucene/functions/OLuceneNearFunction.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
src/main/java/com/orientechnologies/lucene/functions/spatial/OToWktFunction.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,50 @@ | ||
/* | ||
* | ||
* * Copyright 2014 Orient Technologies. | ||
* * | ||
* * Licensed 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 com.orientechnologies.lucene.functions.spatial; | ||
|
||
import com.orientechnologies.lucene.shape.OShapeFactoryImpl; | ||
import com.orientechnologies.orient.core.command.OCommandContext; | ||
import com.orientechnologies.orient.core.db.record.OIdentifiable; | ||
import com.orientechnologies.orient.core.record.impl.ODocument; | ||
import com.orientechnologies.orient.core.sql.functions.OSQLFunctionAbstract; | ||
|
||
/** | ||
* Created by Enrico Risa on 06/08/15. | ||
*/ | ||
public class OToWktFunction extends OSQLFunctionAbstract { | ||
|
||
public static final String NAME = "towkt"; | ||
|
||
OShapeFactoryImpl factory = new OShapeFactoryImpl(); | ||
|
||
public OToWktFunction() { | ||
super(NAME, 1, 1); | ||
} | ||
|
||
@Override | ||
public Object execute(Object iThis, OIdentifiable iCurrentRecord, Object iCurrentResult, Object[] iParams, | ||
OCommandContext iContext) { | ||
return factory.asText((ODocument) iParams[0]); | ||
} | ||
|
||
@Override | ||
public String getSyntax() { | ||
return "toWKT(<doc>)"; | ||
} | ||
} |
Oops, something went wrong.