[Rename] refactor libs/geo. (#258)

Refactor the `libs/geo` module to rename the package name from `org.elasticsearch.geometry` to `org.opensearch.geometry` as part of the rename to OpenSearch work.

Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
Rabi Panda 2021-03-11 12:26:54 -08:00 committed by Nick Knize
parent eae9b0531b
commit 9eb511dda2
100 changed files with 417 additions and 416 deletions

View File

@ -17,12 +17,12 @@
* under the License.
*/
apply plugin: 'elasticsearch.build'
apply plugin: 'elasticsearch.publish'
apply plugin: 'opensearch.build'
apply plugin: 'opensearch.publish'
dependencies {
testImplementation(project(":test:framework")) {
exclude group: 'org.elasticsearch', module: 'elasticsearch-geo'
exclude group: 'org.opensearch', module: 'opensearch-geo'
}
}

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.WellKnownText;
/**
* Circle geometry (not part of WKT standard, but used in elasticsearch) defined by lat/lon coordinates of the center in degrees
* Circle geometry (not part of WKT standard, but used in opensearch) defined by lat/lon coordinates of the center in degrees
* and optional altitude in meters.
*/
public class Circle implements Geometry {

View File

@ -17,10 +17,10 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
/**
* Base class for all Geometry objects supported by elasticsearch
* Base class for all Geometry objects supported by opensearch
*/
public interface Geometry {

View File

@ -16,9 +16,9 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.WellKnownText;
import java.util.Collections;
import java.util.Iterator;

View File

@ -17,9 +17,9 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.WellKnownText;
/**
* Support class for creating Geometry Visitors.

View File

@ -17,9 +17,9 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.WellKnownText;
import java.util.Arrays;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import java.util.Arrays;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import java.util.List;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import java.util.List;

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import java.util.List;

View File

@ -17,9 +17,9 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.WellKnownText;
/**
* Represents a Point on the earth's surface in decimal degrees and optional altitude in meters.

View File

@ -17,7 +17,7 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import java.util.Collections;
import java.util.List;

View File

@ -17,9 +17,9 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.WellKnownText;
/**
* Represents a lat/lon rectangle in decimal degrees and optional altitude in meters.

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import java.util.Locale;
/**
* Shape types supported by elasticsearch
* Shape types supported by opensearch
*/
public enum ShapeType {
POINT,

View File

@ -21,4 +21,4 @@
/**
* Common Geometry classes
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;

View File

@ -16,7 +16,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.geometry.utils;
package org.opensearch.geometry.utils;
/**
* Utilities for common Bit twiddling methods. Borrowed heavily from Lucene (org.apache.lucene.util.BitUtil).

View File

@ -17,20 +17,20 @@
* under the License.
*/
package org.elasticsearch.geometry.utils;
package org.opensearch.geometry.utils;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
/**
* Validator that checks that lats are between -90 and +90 and lons are between -180 and +180 and altitude is present only if

View File

@ -16,10 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.geometry.utils;
package org.opensearch.geometry.utils;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Rectangle;
import java.util.ArrayList;
import java.util.Collection;

View File

@ -17,9 +17,9 @@
* under the License.
*/
package org.elasticsearch.geometry.utils;
package org.opensearch.geometry.utils;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
/**
* Generic geometry validator that can be used by the parser to verify the validity of the parsed geometry

View File

@ -17,20 +17,20 @@
* under the License.
*/
package org.elasticsearch.geometry.utils;
package org.opensearch.geometry.utils;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
/**
* Validator that only checks that altitude only shows up if ignoreZValue is set to true.

View File

@ -17,20 +17,20 @@
* under the License.
*/
package org.elasticsearch.geometry.utils;
package org.opensearch.geometry.utils;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import java.io.IOException;
import java.io.StreamTokenizer;

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.OpenSearchException;
import org.elasticsearch.Version;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.WellKnownText;
import org.elasticsearch.test.AbstractWireTestCase;
import java.io.IOException;
@ -63,7 +63,7 @@ abstract class BaseGeometryTestCase<T extends Geometry> extends AbstractWireTest
private Object verify(Geometry geometry, String expectedClass) {
assertFalse("Visitor should be called only once", called.getAndSet(true));
assertSame(geom, geometry);
assertEquals(geometry.getClass().getName(), "org.elasticsearch.geometry." + expectedClass);
assertEquals(geometry.getClass().getName(), "org.opensearch.geometry." + expectedClass);
return "result";
}

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,11 +17,11 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.utils.WellKnownText;
import org.elasticsearch.test.ESTestCase;
public class GeometryValidatorTests extends ESTestCase {

View File

@ -17,13 +17,13 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import org.elasticsearch.test.ESTestCase;
public class LinearRingTests extends ESTestCase {

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,13 +17,13 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,12 +17,12 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -17,13 +17,13 @@
* under the License.
*/
package org.elasticsearch.geometry;
package org.opensearch.geometry;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -16,11 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.geometry.utils;
package org.opensearch.geometry.utils;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.test.ESTestCase;
import org.opensearch.geometry.utils.Geohash;
/**
* Tests for {@link Geohash}

View File

@ -26,11 +26,11 @@ import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.Rectangle;
import org.elasticsearch.geometry.ShapeType;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.Rectangle;
import org.opensearch.geometry.ShapeType;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -31,20 +31,20 @@ import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentSubParser;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.elasticsearch.geometry.ShapeType;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import org.opensearch.geometry.ShapeType;
import org.opensearch.geometry.utils.GeometryValidator;
import java.io.IOException;
import java.util.ArrayList;

View File

@ -22,7 +22,7 @@ package org.elasticsearch.common.geo;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import java.io.IOException;

View File

@ -19,8 +19,8 @@
package org.elasticsearch.common.geo;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.MultiLine;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.MultiLine;
import java.util.Arrays;
import java.util.List;

View File

@ -29,13 +29,13 @@ import org.elasticsearch.OpenSearchParseException;
import org.elasticsearch.common.geo.GeoUtils.EffectivePoint;
import org.elasticsearch.common.xcontent.ToXContentFragment;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Rectangle;
import org.elasticsearch.geometry.ShapeType;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.elasticsearch.geometry.utils.Geohash;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Rectangle;
import org.opensearch.geometry.ShapeType;
import org.opensearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.util.Arrays;

View File

@ -20,10 +20,10 @@
package org.elasticsearch.common.geo;
import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.locationtech.spatial4j.exception.InvalidShapeException;
import java.util.ArrayList;

View File

@ -18,11 +18,11 @@
*/
package org.elasticsearch.common.geo;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
/**

View File

@ -22,18 +22,18 @@ package org.elasticsearch.common.geo;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.DistanceUnit;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import java.io.IOException;
import java.util.ArrayList;

View File

@ -24,12 +24,12 @@ import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.support.MapXContentParser;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.utils.GeometryValidator;
import org.elasticsearch.geometry.utils.StandardValidator;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.utils.GeometryValidator;
import org.opensearch.geometry.utils.StandardValidator;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -22,8 +22,8 @@ package org.elasticsearch.common.geo;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.utils.WellKnownText;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.utils.WellKnownText;
import java.io.IOException;
import java.text.ParseException;

View File

@ -34,7 +34,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import java.io.IOException;
import java.util.Objects;
public class CircleBuilder extends ShapeBuilder<Circle, org.elasticsearch.geometry.Circle, CircleBuilder> {
public class CircleBuilder extends ShapeBuilder<Circle, org.opensearch.geometry.Circle, CircleBuilder> {
public static final ParseField FIELD_RADIUS = new ParseField("radius");
public static final GeoShapeType TYPE = GeoShapeType.CIRCLE;
@ -164,8 +164,8 @@ public class CircleBuilder extends ShapeBuilder<Circle, org.elasticsearch.geomet
}
@Override
public org.elasticsearch.geometry.Circle buildGeometry() {
return new org.elasticsearch.geometry.Circle(center.x, center.y, unit.toMeters(radius));
public org.opensearch.geometry.Circle buildGeometry() {
return new org.opensearch.geometry.Circle(center.x, center.y, unit.toMeters(radius));
}
@Override

View File

@ -32,7 +32,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import java.io.IOException;
import java.util.Objects;
public class EnvelopeBuilder extends ShapeBuilder<Rectangle, org.elasticsearch.geometry.Rectangle, EnvelopeBuilder> {
public class EnvelopeBuilder extends ShapeBuilder<Rectangle, org.opensearch.geometry.Rectangle, EnvelopeBuilder> {
public static final GeoShapeType TYPE = GeoShapeType.ENVELOPE;
@ -113,8 +113,8 @@ public class EnvelopeBuilder extends ShapeBuilder<Rectangle, org.elasticsearch.g
}
@Override
public org.elasticsearch.geometry.Rectangle buildGeometry() {
return new org.elasticsearch.geometry.Rectangle(topLeft.x, bottomRight.x, topLeft.y, bottomRight.y);
public org.opensearch.geometry.Rectangle buildGeometry() {
return new org.opensearch.geometry.Rectangle(topLeft.x, bottomRight.x, topLeft.y, bottomRight.y);
}
@Override

View File

@ -27,8 +27,8 @@ import org.elasticsearch.common.geo.parsers.ShapeParser;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.locationtech.spatial4j.shape.Shape;
import java.io.IOException;

View File

@ -23,7 +23,7 @@ import org.elasticsearch.common.geo.GeoShapeType;
import org.elasticsearch.common.geo.parsers.ShapeParser;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.geometry.Line;
import org.opensearch.geometry.Line;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
@ -35,7 +35,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class LineStringBuilder extends ShapeBuilder<JtsGeometry, org.elasticsearch.geometry.Geometry, LineStringBuilder> {
public class LineStringBuilder extends ShapeBuilder<JtsGeometry, org.opensearch.geometry.Geometry, LineStringBuilder> {
public static final GeoShapeType TYPE = GeoShapeType.LINESTRING;
/**
@ -121,7 +121,7 @@ public class LineStringBuilder extends ShapeBuilder<JtsGeometry, org.elasticsear
}
@Override
public org.elasticsearch.geometry.Geometry buildGeometry() {
public org.opensearch.geometry.Geometry buildGeometry() {
return new Line(coordinates.stream().mapToDouble(i->i.x).toArray(), coordinates.stream().mapToDouble(i->i.y).toArray()
);
}

View File

@ -25,8 +25,8 @@ import org.elasticsearch.common.geo.parsers.ShapeParser;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.MultiLine;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.MultiLine;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.LineString;
@ -38,7 +38,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Objects;
public class MultiLineStringBuilder extends ShapeBuilder<JtsGeometry, org.elasticsearch.geometry.Geometry, MultiLineStringBuilder> {
public class MultiLineStringBuilder extends ShapeBuilder<JtsGeometry, org.opensearch.geometry.Geometry, MultiLineStringBuilder> {
public static final GeoShapeType TYPE = GeoShapeType.MULTILINESTRING;
@ -151,7 +151,7 @@ public class MultiLineStringBuilder extends ShapeBuilder<JtsGeometry, org.elasti
}
@Override
public org.elasticsearch.geometry.Geometry buildGeometry() {
public org.opensearch.geometry.Geometry buildGeometry() {
if (lines.isEmpty()) {
return MultiLine.EMPTY;
}

View File

@ -24,7 +24,7 @@ import org.elasticsearch.common.geo.XShapeCollection;
import org.elasticsearch.common.geo.parsers.ShapeParser;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPoint;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.spatial4j.shape.Point;
@ -87,7 +87,7 @@ public class MultiPointBuilder extends ShapeBuilder<XShapeCollection<Point>, Mul
if (coordinates.isEmpty()) {
return MultiPoint.EMPTY;
}
return new MultiPoint(coordinates.stream().map(coord -> new org.elasticsearch.geometry.Point(coord.x, coord.y))
return new MultiPoint(coordinates.stream().map(coord -> new org.opensearch.geometry.Point(coord.x, coord.y))
.collect(Collectors.toList()));
}

View File

@ -26,8 +26,8 @@ import org.elasticsearch.common.geo.parsers.ShapeParser;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Polygon;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Polygon;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.spatial4j.shape.Shape;

View File

@ -28,7 +28,7 @@ import org.locationtech.spatial4j.shape.Point;
import java.io.IOException;
public class PointBuilder extends ShapeBuilder<Point, org.elasticsearch.geometry.Point, PointBuilder> {
public class PointBuilder extends ShapeBuilder<Point, org.opensearch.geometry.Point, PointBuilder> {
public static final GeoShapeType TYPE = GeoShapeType.POINT;
/**
@ -88,8 +88,8 @@ public class PointBuilder extends ShapeBuilder<Point, org.elasticsearch.geometry
}
@Override
public org.elasticsearch.geometry.Point buildGeometry() {
return new org.elasticsearch.geometry.Point(coordinates.get(0).x, coordinates.get(0).y);
public org.opensearch.geometry.Point buildGeometry() {
return new org.opensearch.geometry.Point(coordinates.get(0).x, coordinates.get(0).y);
}
@Override

View File

@ -53,7 +53,7 @@ import static org.apache.lucene.geo.GeoUtils.orient;
* Methods to wrap polygons at the dateline and building shapes from the data held by the
* builder.
*/
public class PolygonBuilder extends ShapeBuilder<JtsGeometry, org.elasticsearch.geometry.Geometry, PolygonBuilder> {
public class PolygonBuilder extends ShapeBuilder<JtsGeometry, org.opensearch.geometry.Geometry, PolygonBuilder> {
public static final GeoShapeType TYPE = GeoShapeType.POLYGON;
@ -231,7 +231,7 @@ public class PolygonBuilder extends ShapeBuilder<JtsGeometry, org.elasticsearch.
}
@Override
public org.elasticsearch.geometry.Geometry buildGeometry() {
public org.opensearch.geometry.Geometry buildGeometry() {
return toPolygonGeometry();
}
@ -280,16 +280,16 @@ public class PolygonBuilder extends ShapeBuilder<JtsGeometry, org.elasticsearch.
return factory.createPolygon(shell, holes);
}
public org.elasticsearch.geometry.Polygon toPolygonGeometry() {
final List<org.elasticsearch.geometry.LinearRing> holes = new ArrayList<>(this.holes.size());
public org.opensearch.geometry.Polygon toPolygonGeometry() {
final List<org.opensearch.geometry.LinearRing> holes = new ArrayList<>(this.holes.size());
for (int i = 0; i < this.holes.size(); ++i) {
holes.add(linearRing(this.holes.get(i).coordinates));
}
return new org.elasticsearch.geometry.Polygon(linearRing(this.shell.coordinates), holes);
return new org.opensearch.geometry.Polygon(linearRing(this.shell.coordinates), holes);
}
protected static org.elasticsearch.geometry.LinearRing linearRing(List<Coordinate> coordinates) {
return new org.elasticsearch.geometry.LinearRing(coordinates.stream().mapToDouble(i -> i.x).toArray(),
protected static org.opensearch.geometry.LinearRing linearRing(List<Coordinate> coordinates) {
return new org.opensearch.geometry.LinearRing(coordinates.stream().mapToDouble(i -> i.x).toArray(),
coordinates.stream().mapToDouble(i -> i.y).toArray()
);
}

View File

@ -52,7 +52,7 @@ import java.util.Objects;
/**
* Basic class for building GeoJSON shapes like Polygons, Linestrings, etc
*/
public abstract class ShapeBuilder<T extends Shape, G extends org.elasticsearch.geometry.Geometry,
public abstract class ShapeBuilder<T extends Shape, G extends org.opensearch.geometry.Geometry,
E extends ShapeBuilder<T, G, E>> implements NamedWriteable, ToXContentObject {
protected static final Logger LOGGER = LogManager.getLogger(ShapeBuilder.class);

View File

@ -26,7 +26,7 @@ import org.apache.lucene.util.BytesRefBuilder;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.geo.GeoUtils;
import org.elasticsearch.common.time.DateUtils;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.script.JodaCompatibleZonedDateTime;
import java.io.IOException;

View File

@ -29,8 +29,8 @@ import org.elasticsearch.common.geo.GeometryParser;
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.Point;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.Point;
import java.io.IOException;
import java.text.ParseException;

View File

@ -31,8 +31,8 @@ import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.geo.GeoUtils;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.unit.DistanceUnit;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.Point;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.Point;
import org.elasticsearch.index.fielddata.IndexFieldData;
import org.elasticsearch.index.fielddata.plain.AbstractLatLonPointIndexFieldData;
import org.elasticsearch.index.mapper.GeoPointFieldMapper.ParsedGeoPoint;

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.Explicit;
import org.elasticsearch.common.geo.GeometryParser;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.index.query.VectorGeoShapeQueryProcessor;

View File

@ -27,18 +27,18 @@ import org.elasticsearch.common.geo.GeoPolygonDecomposer;
import org.elasticsearch.common.geo.GeoShapeUtils;
import org.elasticsearch.common.geo.GeoShapeType;
import org.elasticsearch.common.geo.GeoUtils;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import java.util.ArrayList;
import java.util.Arrays;

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.common.xcontent.support.MapXContentParser;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import java.io.IOException;
import java.io.UncheckedIOException;

View File

@ -22,7 +22,7 @@ package org.elasticsearch.index.mapper;
import org.apache.lucene.search.Query;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.geo.SpatialStrategy;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import org.elasticsearch.index.query.QueryShardContext;
/**

View File

@ -47,7 +47,7 @@ import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import org.elasticsearch.index.query.LegacyGeoShapeQueryProcessor;
import org.elasticsearch.index.query.QueryShardContext;
import org.locationtech.spatial4j.shape.Shape;

View File

@ -42,7 +42,7 @@ import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import org.elasticsearch.index.mapper.MappedFieldType;
import java.io.IOException;

View File

@ -35,8 +35,8 @@ import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Rectangle;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.Rectangle;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.index.mapper.GeoPointFieldMapper.GeoPointFieldType;
import org.elasticsearch.index.mapper.MappedFieldType;

View File

@ -33,7 +33,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import org.elasticsearch.index.mapper.GeoShapeQueryable;
import org.elasticsearch.index.mapper.MappedFieldType;

View File

@ -40,18 +40,18 @@ import org.elasticsearch.common.geo.builders.PointBuilder;
import org.elasticsearch.common.geo.builders.PolygonBuilder;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
import org.elasticsearch.common.unit.DistanceUnit;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper;
import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper;
import org.locationtech.jts.geom.Coordinate;

View File

@ -24,7 +24,7 @@ import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
import org.elasticsearch.geometry.Geometry;
import org.opensearch.geometry.Geometry;
import org.elasticsearch.index.query.DistanceFeatureQueryBuilder.Origin;
import org.elasticsearch.index.query.MoreLikeThisQueryBuilder.Item;
import org.elasticsearch.index.query.functionscore.FunctionScoreQueryBuilder;
@ -84,7 +84,7 @@ public final class QueryBuilders {
public static MultiMatchQueryBuilder multiMatchQuery(Object text, String... fieldNames) {
return new MultiMatchQueryBuilder(text, fieldNames); // BOOLEAN is the default
}
/**
* Creates a text query with type "BOOL_PREFIX" for the provided field name and text.
*
@ -94,7 +94,7 @@ public final class QueryBuilders {
public static MatchBoolPrefixQueryBuilder matchBoolPrefixQuery(String name, Object text) {
return new MatchBoolPrefixQueryBuilder(name, text);
}
/**
* Creates a text query with type "PHRASE" for the provided field name and text.
*

View File

@ -29,18 +29,18 @@ import org.elasticsearch.common.geo.GeoPolygonDecomposer;
import org.elasticsearch.common.geo.GeoShapeType;
import org.elasticsearch.common.geo.GeoShapeUtils;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.elasticsearch.geometry.ShapeType;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import org.opensearch.geometry.ShapeType;
import org.elasticsearch.index.mapper.GeoPointFieldMapper;
import org.elasticsearch.index.mapper.MappedFieldType;
@ -113,7 +113,7 @@ public class VectorGeoPointShapeQueryProcessor {
}
@Override
public Query visit(org.elasticsearch.geometry.Line line) {
public Query visit(org.opensearch.geometry.Line line) {
throw new QueryShardException(context, "Field [" + fieldName + "] does not support "
+ GeoShapeType.LINESTRING + " queries");
}
@ -154,7 +154,7 @@ public class VectorGeoPointShapeQueryProcessor {
@Override
public Query visit(MultiPolygon multiPolygon) {
ArrayList<org.elasticsearch.geometry.Polygon> collector = new ArrayList<>();
ArrayList<org.opensearch.geometry.Polygon> collector = new ArrayList<>();
GeoPolygonDecomposer.decomposeMultiPolygon(multiPolygon, true, collector);
return visit(collector);
}
@ -168,7 +168,7 @@ public class VectorGeoPointShapeQueryProcessor {
@Override
public Query visit(Polygon polygon) {
ArrayList<org.elasticsearch.geometry.Polygon> collector = new ArrayList<>();
ArrayList<org.opensearch.geometry.Polygon> collector = new ArrayList<>();
GeoPolygonDecomposer.decomposePolygon(polygon, true, collector);
return visit(collector);
}

View File

@ -28,18 +28,18 @@ import org.elasticsearch.common.geo.GeoLineDecomposer;
import org.elasticsearch.common.geo.GeoPolygonDecomposer;
import org.elasticsearch.common.geo.GeoShapeUtils;
import org.elasticsearch.common.geo.ShapeRelation;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import java.util.ArrayList;
import java.util.List;
@ -99,9 +99,9 @@ public class VectorGeoShapeQueryProcessor {
}
@Override
public Void visit(org.elasticsearch.geometry.Line line) {
public Void visit(org.opensearch.geometry.Line line) {
if (line.isEmpty() == false) {
List<org.elasticsearch.geometry.Line> collector = new ArrayList<>();
List<org.opensearch.geometry.Line> collector = new ArrayList<>();
GeoLineDecomposer.decomposeLine(line, collector);
collectLines(collector);
}
@ -115,7 +115,7 @@ public class VectorGeoShapeQueryProcessor {
@Override
public Void visit(MultiLine multiLine) {
List<org.elasticsearch.geometry.Line> collector = new ArrayList<>();
List<org.opensearch.geometry.Line> collector = new ArrayList<>();
GeoLineDecomposer.decomposeMultiLine(multiLine, collector);
collectLines(collector);
return null;
@ -132,7 +132,7 @@ public class VectorGeoShapeQueryProcessor {
@Override
public Void visit(MultiPolygon multiPolygon) {
if (multiPolygon.isEmpty() == false) {
List<org.elasticsearch.geometry.Polygon> collector = new ArrayList<>();
List<org.opensearch.geometry.Polygon> collector = new ArrayList<>();
GeoPolygonDecomposer.decomposeMultiPolygon(multiPolygon, true, collector);
collectPolygons(collector);
}
@ -149,9 +149,9 @@ public class VectorGeoShapeQueryProcessor {
}
@Override
public Void visit(org.elasticsearch.geometry.Polygon polygon) {
public Void visit(org.opensearch.geometry.Polygon polygon) {
if (polygon.isEmpty() == false) {
List<org.elasticsearch.geometry.Polygon> collector = new ArrayList<>();
List<org.opensearch.geometry.Polygon> collector = new ArrayList<>();
GeoPolygonDecomposer.decomposePolygon(polygon, true, collector);
collectPolygons(collector);
}
@ -166,13 +166,13 @@ public class VectorGeoShapeQueryProcessor {
return null;
}
private void collectLines(List<org.elasticsearch.geometry.Line> geometryLines) {
private void collectLines(List<org.opensearch.geometry.Line> geometryLines) {
for (Line line: geometryLines) {
geometries.add(GeoShapeUtils.toLuceneLine(line));
}
}
private void collectPolygons(List<org.elasticsearch.geometry.Polygon> geometryPolygons) {
private void collectPolygons(List<org.opensearch.geometry.Polygon> geometryPolygons) {
for (Polygon polygon : geometryPolygons) {
geometries.add(GeoShapeUtils.toLucenePolygon(polygon));
}

View File

@ -32,7 +32,7 @@ import org.elasticsearch.common.network.NetworkAddress;
import org.elasticsearch.common.time.DateFormatter;
import org.elasticsearch.common.time.DateMathParser;
import org.elasticsearch.common.time.DateUtils;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.index.mapper.DateFieldMapper;
import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils;

View File

@ -20,7 +20,7 @@
package org.elasticsearch.search.aggregations.bucket.geogrid;
import org.elasticsearch.common.geo.GeoBoundingBox;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.search.aggregations.Aggregator;
import org.elasticsearch.search.aggregations.AggregatorFactories;

View File

@ -26,7 +26,7 @@ import org.elasticsearch.common.util.ESSloppyMath;
import org.elasticsearch.common.xcontent.ObjectParser.ValueType;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Rectangle;
import java.io.IOException;
import java.util.Locale;

View File

@ -20,7 +20,7 @@ package org.elasticsearch.search.aggregations.bucket.geogrid;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.search.aggregations.InternalAggregations;
import java.io.IOException;

View File

@ -49,8 +49,8 @@ import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import static org.elasticsearch.geometry.utils.Geohash.addNeighbors;
import static org.elasticsearch.geometry.utils.Geohash.stringEncode;
import static org.opensearch.geometry.utils.Geohash.addNeighbors;
import static org.opensearch.geometry.utils.Geohash.stringEncode;
/**
* A {@link ContextMapping} that uses a geo location/area as a

View File

@ -21,7 +21,7 @@ package org.elasticsearch.common.geo;
import org.elasticsearch.common.geo.parsers.ShapeParser;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.utils.GeographyValidator;
import org.elasticsearch.index.mapper.GeoShapeIndexer;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.hamcrest.ElasticsearchGeoAssertions;
@ -66,14 +66,14 @@ abstract class BaseGeoParsingTestCase extends ESTestCase {
ElasticsearchGeoAssertions.assertEquals(expected, ShapeParser.parse(parser).buildS4J());
} else {
GeometryParser geometryParser = new GeometryParser(true, true, true);
org.elasticsearch.geometry.Geometry shape = geometryParser.parse(parser);
org.opensearch.geometry.Geometry shape = geometryParser.parse(parser);
shape = new GeoShapeIndexer(true, "name").prepareForIndexing(shape);
ElasticsearchGeoAssertions.assertEquals(expected, shape);
}
}
}
protected void assertGeometryEquals(org.elasticsearch.geometry.Geometry expected, XContentBuilder geoJson) throws IOException {
protected void assertGeometryEquals(org.opensearch.geometry.Geometry expected, XContentBuilder geoJson) throws IOException {
try (XContentParser parser = createParser(geoJson)) {
parser.nextToken();
assertEquals(expected, new GeoJson(true, false, new GeographyValidator(false)).fromXContent(parser));

View File

@ -25,7 +25,7 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.test.ESTestCase;
import java.io.IOException;

View File

@ -25,18 +25,18 @@ import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParseException;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import org.opensearch.geometry.utils.GeographyValidator;
import java.io.IOException;
import java.text.ParseException;

View File

@ -30,8 +30,8 @@ import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.utils.GeographyValidator;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.utils.GeographyValidator;
import org.elasticsearch.test.AbstractXContentTestCase;
import org.elasticsearch.test.ESTestCase;

View File

@ -30,11 +30,11 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.elasticsearch.index.mapper.ContentPath;
import org.elasticsearch.index.mapper.GeoShapeIndexer;
import org.elasticsearch.index.mapper.LegacyGeoShapeFieldMapper;
@ -79,7 +79,7 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
.endObject();
Point expected = GEOMETRY_FACTORY.createPoint(new Coordinate(100.0, 0.0));
assertGeometryEquals(new JtsPoint(expected, SPATIAL_CONTEXT), pointGeoJson, true);
assertGeometryEquals(new org.elasticsearch.geometry.Point(100d, 0d), pointGeoJson, false);
assertGeometryEquals(new org.opensearch.geometry.Point(100d, 0d), pointGeoJson, false);
}
@Override
@ -195,7 +195,7 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
.endObject();
Rectangle expected = SPATIAL_CONTEXT.makeRectangle(-50, 50, -30, 30);
assertGeometryEquals(expected, multilinesGeoJson, true);
assertGeometryEquals(new org.elasticsearch.geometry.Rectangle(-50, 50, 30, -30),
assertGeometryEquals(new org.opensearch.geometry.Rectangle(-50, 50, 30, -30),
multilinesGeoJson, false);
// test #2: envelope that spans dateline
@ -208,7 +208,7 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
expected = SPATIAL_CONTEXT.makeRectangle(50, -50, -30, 30);
assertGeometryEquals(expected, multilinesGeoJson, true);
assertGeometryEquals(new org.elasticsearch.geometry.Rectangle(50, -50, 30, -30),
assertGeometryEquals(new org.opensearch.geometry.Rectangle(50, -50, 30, -30),
multilinesGeoJson, false);
// test #3: "envelope" (actually a triangle) with invalid number of coordinates (TopRight, BottomLeft, BottomRight)
@ -264,8 +264,8 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, null);
assertGeometryEquals(jtsGeom(expected), polygonGeoJson, true);
org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon(
new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.Polygon p = new org.opensearch.geometry.Polygon(
new org.opensearch.geometry.LinearRing(
new double[] {100d, 101d, 101d, 100d, 100d}, new double[] {0d, 0d, 1d, 1d, 0d}
));
assertGeometryEquals(p, polygonGeoJson, false);
@ -311,7 +311,7 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
ElasticsearchGeoAssertions.assertEquals(jtsGeom(expected), ShapeParser.parse(parser, mapperBuilder).buildS4J());
}
org.elasticsearch.geometry.Polygon p = new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.Polygon p = new org.opensearch.geometry.Polygon(new org.opensearch.geometry.LinearRing(
Arrays.stream(coordinates).mapToDouble(i->i.x).toArray(), Arrays.stream(coordinates).mapToDouble(i->i.y).toArray()
));
assertGeometryEquals(p, polygonGeoJson, false);
@ -863,11 +863,11 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, holes);
assertGeometryEquals(jtsGeom(expected), polygonGeoJson, true);
org.elasticsearch.geometry.LinearRing hole =
new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.LinearRing hole =
new org.opensearch.geometry.LinearRing(
new double[] {100.8d, 100.8d, 100.2d, 100.2d, 100.8d}, new double[] {0.8d, 0.2d, 0.2d, 0.8d, 0.8d});
org.elasticsearch.geometry.Polygon p =
new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.Polygon p =
new org.opensearch.geometry.Polygon(new org.opensearch.geometry.LinearRing(
new double[] {100d, 101d, 101d, 100d, 100d}, new double[] {0d, 0d, 1d, 1d, 0d}), Collections.singletonList(hole));
assertGeometryEquals(p, polygonGeoJson, false);
}
@ -911,8 +911,8 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
assertGeometryEquals(expected, multiPointGeoJson, true);
assertGeometryEquals(new MultiPoint(Arrays.asList(
new org.elasticsearch.geometry.Point(100, 0),
new org.elasticsearch.geometry.Point(101, 1))), multiPointGeoJson, false);
new org.opensearch.geometry.Point(100, 0),
new org.opensearch.geometry.Point(101, 1))), multiPointGeoJson, false);
}
@Override
@ -983,13 +983,13 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
assertGeometryEquals(expected, multiPolygonGeoJson, true);
org.elasticsearch.geometry.LinearRing hole = new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.LinearRing hole = new org.opensearch.geometry.LinearRing(
new double[] {100.8d, 100.8d, 100.2d, 100.2d, 100.8d}, new double[] {0.8d, 0.2d, 0.2d, 0.8d, 0.8d});
org.elasticsearch.geometry.MultiPolygon polygons = new org.elasticsearch.geometry.MultiPolygon(Arrays.asList(
new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.MultiPolygon polygons = new org.opensearch.geometry.MultiPolygon(Arrays.asList(
new org.opensearch.geometry.Polygon(new org.opensearch.geometry.LinearRing(
new double[] {103d, 103d, 102d, 102d, 103d}, new double[] {2d, 3d, 3d, 2d, 2d})),
new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing(
new org.opensearch.geometry.Polygon(new org.opensearch.geometry.LinearRing(
new double[] {101d, 101d, 100d, 100d, 101d}, new double[] {0d, 1d, 1d, 0d, 0d}), Collections.singletonList(hole))));
assertGeometryEquals(polygons, multiPolygonGeoJson, false);
@ -1041,12 +1041,12 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
assertGeometryEquals(jtsGeom(withHoles), multiPolygonGeoJson, true);
org.elasticsearch.geometry.LinearRing luceneHole =
new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.LinearRing luceneHole =
new org.opensearch.geometry.LinearRing(
new double[] {100.8d, 100.8d, 100.2d, 100.2d, 100.8d}, new double[] {0.8d, 0.2d, 0.2d, 0.8d, 0.8d});
org.elasticsearch.geometry.Polygon lucenePolygons = (new org.elasticsearch.geometry.Polygon(
new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.Polygon lucenePolygons = (new org.opensearch.geometry.Polygon(
new org.opensearch.geometry.LinearRing(
new double[] {100d, 101d, 101d, 100d, 100d}, new double[] {0d, 0d, 1d, 1d, 0d}), Collections.singletonList(luceneHole)));
assertGeometryEquals(lucenePolygons, multiPolygonGeoJson, false);
}
@ -1125,13 +1125,13 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
GeometryCollection<Geometry> geometryExpected = new GeometryCollection<> (Arrays.asList(
new Line(new double[] {100d, 101d}, new double[] {0d, 1d}),
new org.elasticsearch.geometry.Point(102d, 2d),
new org.elasticsearch.geometry.MultiPolygon(Arrays.asList(
new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing(
new org.opensearch.geometry.Point(102d, 2d),
new org.opensearch.geometry.MultiPolygon(Arrays.asList(
new org.opensearch.geometry.Polygon(new org.opensearch.geometry.LinearRing(
new double[] {180d, 180d, 176d, 172d, 176d, 180d},
new double[] {-12.142857142857142d, 12.142857142857142d, 15d, 0d, -15d, -12.142857142857142d}
)),
new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing(
new org.opensearch.geometry.Polygon(new org.opensearch.geometry.LinearRing(
new double[] {-180d, -180d, -177d, -177d, -180d},
new double[] {12.142857142857142d, -12.142857142857142d, -10d, 10d, 12.142857142857142d}
))
@ -1159,7 +1159,7 @@ public class GeoJsonShapeParserTests extends BaseGeoParsingTestCase {
Point expected = GEOMETRY_FACTORY.createPoint(new Coordinate(100.0, 0.0));
assertGeometryEquals(new JtsPoint(expected, SPATIAL_CONTEXT), pointGeoJson, true);
org.elasticsearch.geometry.Point expectedPt = new org.elasticsearch.geometry.Point(100, 0);
org.opensearch.geometry.Point expectedPt = new org.opensearch.geometry.Point(100, 0);
assertGeometryEquals(expectedPt, pointGeoJson, false);
}

View File

@ -40,11 +40,11 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.elasticsearch.index.mapper.ContentPath;
import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
import org.elasticsearch.index.mapper.GeoShapeIndexer;
@ -110,7 +110,7 @@ public class GeoWKTShapeParserTests extends BaseGeoParsingTestCase {
Coordinate c = new Coordinate(p.lon(), p.lat());
Point expected = GEOMETRY_FACTORY.createPoint(c);
assertExpected(new JtsPoint(expected, SPATIAL_CONTEXT), new PointBuilder().coordinate(c), true);
assertExpected(new org.elasticsearch.geometry.Point(p.lon(), p.lat()), new PointBuilder().coordinate(c), false);
assertExpected(new org.opensearch.geometry.Point(p.lon(), p.lat()), new PointBuilder().coordinate(c), false);
assertMalformed(new PointBuilder().coordinate(c));
}
@ -122,10 +122,10 @@ public class GeoWKTShapeParserTests extends BaseGeoParsingTestCase {
coordinates.add(new Coordinate(GeoTestUtil.nextLongitude(), GeoTestUtil.nextLatitude()));
}
List<org.elasticsearch.geometry.Point> points = new ArrayList<>(numPoints);
List<org.opensearch.geometry.Point> points = new ArrayList<>(numPoints);
for (int i = 0; i < numPoints; ++i) {
Coordinate c = coordinates.get(i);
points.add(new org.elasticsearch.geometry.Point(c.x, c.y));
points.add(new org.opensearch.geometry.Point(c.x, c.y));
}
Geometry expectedGeom;
@ -275,11 +275,11 @@ public class GeoWKTShapeParserTests extends BaseGeoParsingTestCase {
Polygon expected = GEOMETRY_FACTORY.createPolygon(shell, holes);
assertExpected(jtsGeom(expected), polygonWithHole, true);
org.elasticsearch.geometry.LinearRing hole =
new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.LinearRing hole =
new org.opensearch.geometry.LinearRing(
new double[] {100.2d, 100.8d, 100.8d, 100.2d, 100.2d}, new double[] {0.8d, 0.8d, 0.2d, 0.2d, 0.8d});
org.elasticsearch.geometry.Polygon p =
new org.elasticsearch.geometry.Polygon(new org.elasticsearch.geometry.LinearRing(
org.opensearch.geometry.Polygon p =
new org.opensearch.geometry.Polygon(new org.opensearch.geometry.LinearRing(
new double[] {101d, 101d, 100d, 100d, 101d}, new double[] {0d, 1d, 1d, 0d, 0d}), Collections.singletonList(hole));
assertExpected(p, polygonWithHole, false);
assertMalformed(polygonWithHole);
@ -448,7 +448,7 @@ public class GeoWKTShapeParserTests extends BaseGeoParsingTestCase {
Rectangle expected = SPATIAL_CONTEXT.makeRectangle(r.minLon, r.maxLon, r.minLat, r.maxLat);
assertExpected(expected, builder, true);
assertExpected(new org.elasticsearch.geometry.Rectangle(r.minLon, r.maxLon, r.maxLat, r.minLat), builder, false);
assertExpected(new org.opensearch.geometry.Rectangle(r.minLon, r.maxLon, r.maxLat, r.minLat), builder, false);
assertMalformed(builder);
}

View File

@ -24,9 +24,9 @@ import org.elasticsearch.common.io.stream.BytesStreamOutput;
import org.elasticsearch.common.io.stream.NamedWriteableAwareStreamInput;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.ShapeType;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.ShapeType;
import org.elasticsearch.test.ESTestCase;
import static org.elasticsearch.geo.GeometryTestUtils.randomGeometry;

View File

@ -35,17 +35,17 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.index.mapper.GeoShapeIndexer;
import org.elasticsearch.test.ESTestCase;
import org.locationtech.spatial4j.exception.InvalidShapeException;

View File

@ -26,12 +26,12 @@ import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParseException;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.elasticsearch.test.ESTestCase;
import java.util.Arrays;

View File

@ -27,7 +27,7 @@ import org.elasticsearch.common.geo.builders.MultiLineStringBuilder;
import org.elasticsearch.common.geo.builders.PointBuilder;
import org.elasticsearch.common.geo.builders.PolygonBuilder;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
import org.elasticsearch.geometry.LinearRing;
import org.opensearch.geometry.LinearRing;
import org.elasticsearch.index.mapper.GeoShapeIndexer;
import org.elasticsearch.test.ESTestCase;
import org.locationtech.jts.geom.Coordinate;
@ -55,7 +55,7 @@ public class ShapeBuilderTests extends ESTestCase {
Point point = pb.buildS4J();
assertEquals(-100D, point.getX(), 0.0d);
assertEquals(45D, point.getY(), 0.0d);
org.elasticsearch.geometry.Point geoPoint = pb.buildGeometry();
org.opensearch.geometry.Point geoPoint = pb.buildGeometry();
assertEquals(-100D, geoPoint.getX(), 0.0d);
assertEquals(45D, geoPoint.getY(), 0.0d);
}
@ -68,7 +68,7 @@ public class ShapeBuilderTests extends ESTestCase {
assertEquals(45D, rectangle.getMaxX(), 0.0d);
assertEquals(30D, rectangle.getMaxY(), 0.0d);
org.elasticsearch.geometry.Rectangle luceneRectangle = eb.buildGeometry();
org.opensearch.geometry.Rectangle luceneRectangle = eb.buildGeometry();
assertEquals(-45D, luceneRectangle.getMinX(), 0.0d);
assertEquals(-30D, luceneRectangle.getMinY(), 0.0d);
assertEquals(45D, luceneRectangle.getMaxX(), 0.0d);

View File

@ -24,7 +24,7 @@ import org.elasticsearch.Version;
import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.geo.builders.PointBuilder;
import org.elasticsearch.geometry.Point;
import org.opensearch.geometry.Point;
import org.elasticsearch.index.analysis.AnalyzerScope;
import org.elasticsearch.index.analysis.IndexAnalyzers;
import org.elasticsearch.index.analysis.NamedAnalyzer;

View File

@ -28,7 +28,7 @@ import org.hamcrest.CoreMatchers;
import java.io.IOException;
import java.util.Set;
import static org.elasticsearch.geometry.utils.Geohash.stringEncode;
import static org.opensearch.geometry.utils.Geohash.stringEncode;
import static org.hamcrest.Matchers.arrayWithSize;
import static org.hamcrest.Matchers.both;
import static org.hamcrest.Matchers.containsString;

View File

@ -33,7 +33,7 @@ import org.elasticsearch.common.geo.SpatialStrategy;
import org.elasticsearch.common.geo.builders.ShapeBuilder;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.geometry.Point;
import org.opensearch.geometry.Point;
import org.elasticsearch.index.query.QueryShardContext;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;

View File

@ -32,7 +32,7 @@ import org.elasticsearch.test.geo.RandomGeoGenerator;
import java.io.IOException;
import java.util.function.DoubleSupplier;
import static org.elasticsearch.geometry.utils.Geohash.stringEncode;
import static org.opensearch.geometry.utils.Geohash.stringEncode;
import static org.elasticsearch.test.EqualsHashCodeTestUtils.checkEqualsAndHashCode;
import static org.hamcrest.Matchers.is;

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.geo.GeoUtils;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.XContentParser.Token;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.test.ESTestCase;
import org.locationtech.spatial4j.context.SpatialContext;
import org.locationtech.spatial4j.distance.DistanceUtils;

View File

@ -19,7 +19,7 @@
package org.elasticsearch.search.aggregations.bucket.geogrid;
import static org.elasticsearch.geometry.utils.Geohash.stringEncode;
import static org.opensearch.geometry.utils.Geohash.stringEncode;
public class GeoHashGridAggregatorTests extends GeoGridAggregatorTestCase<InternalGeoHashGridBucket> {

View File

@ -28,7 +28,7 @@ import org.elasticsearch.common.xcontent.XContentParseException;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.test.ESTestCase;
public class GeoHashGridParserTests extends ESTestCase {

View File

@ -18,7 +18,7 @@
*/
package org.elasticsearch.search.aggregations.bucket.geogrid;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.search.aggregations.InternalAggregations;
import java.util.List;

View File

@ -23,7 +23,7 @@ import org.elasticsearch.common.xcontent.XContentParseException;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.common.xcontent.json.JsonXContent;
import org.elasticsearch.geo.GeometryTestUtils;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.test.ESTestCase;
import static org.hamcrest.Matchers.containsString;

View File

@ -20,7 +20,7 @@
package org.elasticsearch.search.aggregations.bucket.geogrid;
import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.test.ESTestCase;
import static org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils.MAX_ZOOM;

View File

@ -33,7 +33,7 @@ import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.geometry.utils.Geohash;
import org.opensearch.geometry.utils.Geohash;
import org.elasticsearch.search.SearchHit;
import org.elasticsearch.search.sort.SortBuilders;
import org.elasticsearch.search.sort.SortOrder;

View File

@ -31,12 +31,12 @@ import org.elasticsearch.common.geo.builders.MultiPointBuilder;
import org.elasticsearch.common.geo.builders.PointBuilder;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.index.query.GeoShapeQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;

View File

@ -32,8 +32,8 @@ import org.elasticsearch.common.geo.builders.PolygonBuilder;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentType;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.index.query.GeoShapeQueryBuilder;
import org.elasticsearch.index.query.QueryBuilders;
import org.elasticsearch.plugins.Plugin;

View File

@ -40,7 +40,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.elasticsearch.geometry.utils.Geohash.addNeighborsAtLevel;
import static org.opensearch.geometry.utils.Geohash.addNeighborsAtLevel;
import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.search.suggest.completion.CategoryContextMappingTests.assertContextSuggestFields;
import static org.hamcrest.Matchers.equalTo;

View File

@ -24,8 +24,8 @@ import org.elasticsearch.common.geo.GeoPoint;
import org.elasticsearch.common.geo.parsers.ShapeParser;
import org.elasticsearch.common.unit.DistanceUnit;
import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.MultiLine;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.MultiLine;
import org.hamcrest.Matcher;
import org.junit.Assert;
import org.locationtech.jts.geom.Coordinate;
@ -224,7 +224,7 @@ public class ElasticsearchGeoAssertions {
Assert.assertEquals(s1, s2);
} else if (s1 instanceof Object[] && s2 instanceof Object[]) {
Assert.assertArrayEquals((Object[]) s1, (Object[]) s2);
} else if (s1 instanceof org.elasticsearch.geometry.Geometry && s2 instanceof org.elasticsearch.geometry.Geometry) {
} else if (s1 instanceof org.opensearch.geometry.Geometry && s2 instanceof org.opensearch.geometry.Geometry) {
Assert.assertEquals(s1, s2);
} else {
//We want to know the type of the shape because we test shape equality in a special way...
@ -246,7 +246,7 @@ public class ElasticsearchGeoAssertions {
unwrapJTS(shape) instanceof MultiPolygon);
} else {
assertTrue("expected Polygon[] but found " + shape.getClass().getName(),
shape instanceof org.elasticsearch.geometry.MultiPolygon);
shape instanceof org.opensearch.geometry.MultiPolygon);
}
}
@ -256,7 +256,7 @@ public class ElasticsearchGeoAssertions {
+ unwrapJTS(shape).getClass().getName(), unwrapJTS(shape) instanceof Polygon);
} else {
assertTrue("expected Polygon but found " + shape.getClass().getName(),
shape instanceof org.elasticsearch.geometry.Polygon);
shape instanceof org.opensearch.geometry.Polygon);
}
}

View File

@ -20,18 +20,18 @@
package org.elasticsearch.geo;
import org.apache.lucene.geo.GeoTestUtil;
import org.elasticsearch.geometry.Circle;
import org.elasticsearch.geometry.Geometry;
import org.elasticsearch.geometry.GeometryCollection;
import org.elasticsearch.geometry.GeometryVisitor;
import org.elasticsearch.geometry.Line;
import org.elasticsearch.geometry.LinearRing;
import org.elasticsearch.geometry.MultiLine;
import org.elasticsearch.geometry.MultiPoint;
import org.elasticsearch.geometry.MultiPolygon;
import org.elasticsearch.geometry.Point;
import org.elasticsearch.geometry.Polygon;
import org.elasticsearch.geometry.Rectangle;
import org.opensearch.geometry.Circle;
import org.opensearch.geometry.Geometry;
import org.opensearch.geometry.GeometryCollection;
import org.opensearch.geometry.GeometryVisitor;
import org.opensearch.geometry.Line;
import org.opensearch.geometry.LinearRing;
import org.opensearch.geometry.MultiLine;
import org.opensearch.geometry.MultiPoint;
import org.opensearch.geometry.MultiPolygon;
import org.opensearch.geometry.Point;
import org.opensearch.geometry.Polygon;
import org.opensearch.geometry.Rectangle;
import org.elasticsearch.test.ESTestCase;
import java.util.ArrayList;