You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by nk...@apache.org on 2016/02/05 18:03:31 UTC

[87/87] [abbrv] lucene-solr git commit: LUCENE-6997: refactors lucene-spatial module to a new lucene-spatial-extras module, and refactors sandbox GeoPointField and queries to lucene-spatial module

LUCENE-6997: refactors lucene-spatial module to a new lucene-spatial-extras module, and refactors sandbox GeoPointField and queries to lucene-spatial module


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/50a2f754
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/50a2f754
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/50a2f754

Branch: refs/heads/lucene-6997
Commit: 50a2f7549eb72be3a29cb2e391a9b4db63ee2e33
Parents: 629767b
Author: nknize <nk...@apache.org>
Authored: Wed Feb 3 23:35:18 2016 -0600
Committer: nknize <nk...@apache.org>
Committed: Thu Feb 4 15:17:27 2016 -0600

----------------------------------------------------------------------
 dev-tools/idea/.idea/ant.xml                    |     1 +
 dev-tools/idea/.idea/modules.xml                |     1 +
 dev-tools/idea/.idea/workspace.xml              |    41 +-
 .../idea/lucene/benchmark/src/benchmark.iml     |     2 +-
 dev-tools/idea/lucene/sandbox/sandbox.iml       |     1 +
 .../lucene/spatial-extras/spatial-extras.iml    |    32 +
 dev-tools/idea/lucene/spatial/spatial.iml       |    18 +-
 dev-tools/idea/solr/core/src/java/solr-core.iml |     2 +-
 .../idea/solr/core/src/solr-core-tests.iml      |     2 +-
 dev-tools/maven/lucene/pom.xml.template         |     1 +
 .../lucene/spatial-extras/pom.xml.template      |    62 +
 dev-tools/maven/lucene/spatial/pom.xml.template |    10 +-
 dev-tools/scripts/smokeTestRelease.py           |     2 +-
 lucene/benchmark/build.xml                      |     8 +-
 lucene/build.xml                                |     3 +-
 .../java/org/apache/lucene/util/SloppyMath.java |     6 +-
 lucene/module-build.xml                         |    26 +
 lucene/sandbox/build.xml                        |    20 +
 .../apache/lucene/document/GeoPointField.java   |   131 -
 .../org/apache/lucene/document/LatLonPoint.java |     2 +-
 .../apache/lucene/search/GeoBoundingBox.java    |    46 -
 .../lucene/search/GeoPointDistanceQuery.java    |   170 -
 .../search/GeoPointDistanceQueryImpl.java       |   131 -
 .../search/GeoPointDistanceRangeQuery.java      |   102 -
 .../lucene/search/GeoPointInBBoxQuery.java      |   152 -
 .../lucene/search/GeoPointInBBoxQueryImpl.java  |   160 -
 .../lucene/search/GeoPointInPolygonQuery.java   |   194 -
 .../apache/lucene/search/GeoPointTermQuery.java |    70 -
 .../GeoPointTermQueryConstantScoreWrapper.java  |   129 -
 .../apache/lucene/search/GeoPointTermsEnum.java |   249 -
 .../lucene/search/PointInPolygonQuery.java      |     4 +-
 .../apache/lucene/search/PointInRectQuery.java  |     2 +-
 .../apache/lucene/util/GeoDistanceUtils.java    |   217 -
 .../org/apache/lucene/util/GeoHashUtils.java    |   273 -
 .../apache/lucene/util/GeoProjectionUtils.java  |   437 -
 .../java/org/apache/lucene/util/GeoRect.java    |    66 -
 .../apache/lucene/util/GeoRelationUtils.java    |   497 -
 .../java/org/apache/lucene/util/GeoUtils.java   |   237 -
 .../java/org/apache/lucene/util/package.html    |    28 -
 .../apache/lucene/search/TestGeoPointQuery.java |   386 -
 .../lucene/search/TestLatLonPointQueries.java   |    12 +-
 .../lucene/util/BaseGeoPointTestCase.java       |   764 -
 .../org/apache/lucene/util/TestGeoUtils.java    |   545 -
 lucene/spatial-extras/build.xml                 |    57 +
 lucene/spatial-extras/ivy.xml                   |    36 +
 .../apache/lucene/spatial/SpatialStrategy.java  |   149 +
 .../bbox/BBoxOverlapRatioValueSource.java       |   251 +
 .../spatial/bbox/BBoxSimilarityValueSource.java |   117 +
 .../lucene/spatial/bbox/BBoxStrategy.java       |   588 +
 .../lucene/spatial/bbox/BBoxValueSource.java    |   115 +
 .../lucene/spatial/bbox/package-info.java       |    22 +
 .../composite/CompositeSpatialStrategy.java     |   144 +
 .../spatial/composite/CompositeVerifyQuery.java |   121 +
 .../composite/IntersectsRPTVerifyQuery.java     |   235 +
 .../lucene/spatial/composite/package-info.java  |    18 +
 .../spatial/prefix/AbstractPrefixTreeQuery.java |   133 +
 .../prefix/AbstractVisitingPrefixTreeQuery.java |   380 +
 .../prefix/BytesRefIteratorTokenStream.java     |    72 +
 .../spatial/prefix/CellToBytesRefIterator.java  |    49 +
 .../spatial/prefix/ContainsPrefixTreeQuery.java |   362 +
 .../spatial/prefix/HeatmapFacetCounter.java     |   310 +
 .../prefix/IntersectsPrefixTreeQuery.java       |    95 +
 .../prefix/NumberRangePrefixTreeStrategy.java   |   199 +
 .../PointPrefixTreeFieldCacheProvider.java      |    48 +
 .../spatial/prefix/PrefixTreeFacetCounter.java  |   201 +
 .../spatial/prefix/PrefixTreeStrategy.java      |   208 +
 .../prefix/RecursivePrefixTreeStrategy.java     |   192 +
 .../prefix/TermQueryPrefixTreeStrategy.java     |   111 +
 .../spatial/prefix/WithinPrefixTreeQuery.java   |   233 +
 .../lucene/spatial/prefix/package-info.java     |    20 +
 .../apache/lucene/spatial/prefix/tree/Cell.java |   109 +
 .../spatial/prefix/tree/CellIterator.java       |    76 +
 .../prefix/tree/DateRangePrefixTree.java        |   444 +
 .../spatial/prefix/tree/FilterCellIterator.java |    61 +
 .../spatial/prefix/tree/GeohashPrefixTree.java  |   162 +
 .../lucene/spatial/prefix/tree/LegacyCell.java  |   242 +
 .../spatial/prefix/tree/LegacyPrefixTree.java   |    84 +
 .../prefix/tree/NumberRangePrefixTree.java      |   989 +
 .../prefix/tree/PackedQuadPrefixTree.java       |   459 +
 .../spatial/prefix/tree/QuadPrefixTree.java     |   308 +
 .../prefix/tree/SingletonCellIterator.java      |    36 +
 .../spatial/prefix/tree/SpatialPrefixTree.java  |   117 +
 .../prefix/tree/SpatialPrefixTreeFactory.java   |    99 +
 .../spatial/prefix/tree/TreeCellIterator.java   |    87 +
 .../spatial/prefix/tree/package-info.java       |    29 +
 .../lucene/spatial/query/SpatialArgs.java       |   148 +
 .../lucene/spatial/query/SpatialArgsParser.java |   146 +
 .../lucene/spatial/query/SpatialOperation.java  |   179 +
 .../query/UnsupportedSpatialOperation.java      |    28 +
 .../lucene/spatial/query/package-info.java      |    20 +
 .../serialized/SerializedDVStrategy.java        |   278 +
 .../lucene/spatial/serialized/package-info.java |    20 +
 .../lucene/spatial/spatial4j/package-info.java  |    18 +
 .../spatial/util/CachingDoubleValueSource.java  |    93 +
 .../util/DistanceToShapeValueSource.java        |   122 +
 .../spatial/util/ShapeAreaValueSource.java      |   116 +
 .../lucene/spatial/util/ShapeFieldCache.java    |    54 +
 .../ShapeFieldCacheDistanceValueSource.java     |   112 +
 .../spatial/util/ShapeFieldCacheProvider.java   |    87 +
 .../spatial/util/ShapePredicateValueSource.java |   113 +
 .../lucene/spatial/util/package-info.java       |    21 +
 .../spatial/vector/DistanceValueSource.java     |   120 +
 .../spatial/vector/PointVectorStrategy.java     |   178 +
 .../lucene/spatial/vector/package-info.java     |    20 +
 lucene/spatial-extras/src/java/overview.html    |    67 +
 .../src/test-files/cities-Intersects-BBox.txt   |     3 +
 .../src/test-files/data/LUCENE-4464.txt         |     3 +
 .../src/test-files/data/countries-bbox.txt      |   249 +
 .../src/test-files/data/countries-poly.txt      |   249 +
 .../src/test-files/data/geonames-IE.txt         | 22929 +++++++++++++++++
 .../src/test-files/data/simple-bbox.txt         |     4 +
 .../src/test-files/data/states-bbox.txt         |    52 +
 .../src/test-files/data/states-poly.txt         |    52 +
 .../src/test-files/data/world-cities-points.txt |  2680 ++
 .../src/test-files/simple-Queries-BBox.txt      |     9 +
 .../src/test-files/states-Intersects-BBox.txt   |     3 +
 .../src/test-files/states-IsWithin-BBox.txt     |     4 +
 .../lucene/spatial/DistanceStrategyTest.java    |   135 +
 .../apache/lucene/spatial/PortedSolr3Test.java  |   167 +
 .../lucene/spatial/QueryEqualsHashCodeTest.java |   119 +
 .../apache/lucene/spatial/SpatialArgsTest.java  |    50 +
 .../apache/lucene/spatial/SpatialExample.java   |   200 +
 .../lucene/spatial/SpatialMatchConcern.java     |    31 +
 .../apache/lucene/spatial/SpatialTestCase.java  |   280 +
 .../apache/lucene/spatial/SpatialTestData.java  |    71 +
 .../apache/lucene/spatial/SpatialTestQuery.java |    96 +
 .../apache/lucene/spatial/StrategyTestCase.java |   252 +
 .../lucene/spatial/TestTestFramework.java       |    68 +
 .../lucene/spatial/bbox/TestBBoxStrategy.java   |   301 +
 .../composite/CompositeStrategyTest.java        |   142 +
 .../prefix/CellToBytesRefIterator50.java        |    44 +
 .../spatial/prefix/DateNRStrategyTest.java      |   143 +
 .../spatial/prefix/HeatmapFacetCounterTest.java |   252 +
 .../lucene/spatial/prefix/JtsPolygonTest.java   |   117 +
 .../spatial/prefix/NumberRangeFacetsTest.java   |   275 +
 .../RandomSpatialOpFuzzyPrefixTree50Test.java   |    31 +
 .../RandomSpatialOpFuzzyPrefixTreeTest.java     |   533 +
 .../prefix/RandomSpatialOpStrategyTestCase.java |   141 +
 .../prefix/TestRecursivePrefixTreeStrategy.java |   122 +
 .../prefix/TestTermQueryPrefixGridStrategy.java |    63 +
 .../prefix/tree/DateRangePrefixTreeTest.java    |   175 +
 .../prefix/tree/SpatialPrefixTreeTest.java      |   114 +
 .../spatial/query/SpatialArgsParserTest.java    |    81 +
 .../serialized/SerializedStrategyTest.java      |    66 +
 .../lucene/spatial/spatial4j/Geo3dRptTest.java  |   227 +
 .../Geo3dShapeRectRelationTestCase.java         |   264 +
 .../Geo3dShapeSphereModelRectRelationTest.java  |    72 +
 .../Geo3dShapeWGS84ModelRectRelationTest.java   |    94 +
 .../spatial4j/RandomizedShapeTestCase.java      |   288 +
 .../spatial/spatial4j/geo3d/GeoPointTest.java   |    80 +
 .../spatial/vector/TestPointVectorStrategy.java |    63 +
 lucene/spatial/build.xml                        |    62 +-
 lucene/spatial/ivy.xml                          |    21 +-
 .../apache/lucene/spatial/SpatialStrategy.java  |   149 -
 .../bbox/BBoxOverlapRatioValueSource.java       |   251 -
 .../spatial/bbox/BBoxSimilarityValueSource.java |   117 -
 .../lucene/spatial/bbox/BBoxStrategy.java       |   591 -
 .../lucene/spatial/bbox/BBoxValueSource.java    |   115 -
 .../lucene/spatial/bbox/package-info.java       |    22 -
 .../composite/CompositeSpatialStrategy.java     |   144 -
 .../spatial/composite/CompositeVerifyQuery.java |   121 -
 .../composite/IntersectsRPTVerifyQuery.java     |   235 -
 .../lucene/spatial/composite/package-info.java  |    18 -
 .../lucene/spatial/document/GeoPointField.java  |   139 +
 .../lucene/spatial/document/package-info.java   |    21 +
 .../org/apache/lucene/spatial/package-info.java |     7 +-
 .../spatial/prefix/AbstractPrefixTreeQuery.java |   133 -
 .../prefix/AbstractVisitingPrefixTreeQuery.java |   380 -
 .../prefix/BytesRefIteratorTokenStream.java     |    72 -
 .../spatial/prefix/CellToBytesRefIterator.java  |    49 -
 .../spatial/prefix/ContainsPrefixTreeQuery.java |   362 -
 .../spatial/prefix/HeatmapFacetCounter.java     |   310 -
 .../prefix/IntersectsPrefixTreeQuery.java       |    95 -
 .../prefix/NumberRangePrefixTreeStrategy.java   |   199 -
 .../PointPrefixTreeFieldCacheProvider.java      |    48 -
 .../spatial/prefix/PrefixTreeFacetCounter.java  |   201 -
 .../spatial/prefix/PrefixTreeStrategy.java      |   208 -
 .../prefix/RecursivePrefixTreeStrategy.java     |   196 -
 .../prefix/TermQueryPrefixTreeStrategy.java     |   111 -
 .../spatial/prefix/WithinPrefixTreeQuery.java   |   233 -
 .../apache/lucene/spatial/prefix/tree/Cell.java |   109 -
 .../spatial/prefix/tree/CellIterator.java       |    76 -
 .../prefix/tree/DateRangePrefixTree.java        |   444 -
 .../spatial/prefix/tree/FilterCellIterator.java |    61 -
 .../spatial/prefix/tree/GeohashPrefixTree.java  |   162 -
 .../lucene/spatial/prefix/tree/LegacyCell.java  |   242 -
 .../spatial/prefix/tree/LegacyPrefixTree.java   |    84 -
 .../prefix/tree/NumberRangePrefixTree.java      |   989 -
 .../prefix/tree/PackedQuadPrefixTree.java       |   459 -
 .../spatial/prefix/tree/QuadPrefixTree.java     |   308 -
 .../prefix/tree/SingletonCellIterator.java      |    36 -
 .../spatial/prefix/tree/SpatialPrefixTree.java  |   117 -
 .../prefix/tree/SpatialPrefixTreeFactory.java   |    99 -
 .../spatial/prefix/tree/TreeCellIterator.java   |    87 -
 .../spatial/prefix/tree/package-info.java       |    29 -
 .../lucene/spatial/query/SpatialArgs.java       |   148 -
 .../lucene/spatial/query/SpatialArgsParser.java |   146 -
 .../lucene/spatial/query/SpatialOperation.java  |   179 -
 .../query/UnsupportedSpatialOperation.java      |    28 -
 .../lucene/spatial/query/package-info.java      |    20 -
 .../spatial/search/GeoPointDistanceQuery.java   |   182 +
 .../search/GeoPointDistanceQueryImpl.java       |   130 +
 .../search/GeoPointDistanceRangeQuery.java      |   111 +
 .../spatial/search/GeoPointInBBoxQuery.java     |   171 +
 .../spatial/search/GeoPointInBBoxQueryImpl.java |   160 +
 .../spatial/search/GeoPointInPolygonQuery.java  |   197 +
 .../spatial/search/GeoPointTermQuery.java       |   115 +
 .../GeoPointTermQueryConstantScoreWrapper.java  |   139 +
 .../spatial/search/GeoPointTermsEnum.java       |   249 +
 .../lucene/spatial/search/package-info.java     |    21 +
 .../serialized/SerializedDVStrategy.java        |   278 -
 .../lucene/spatial/serialized/package-info.java |    20 -
 .../lucene/spatial/spatial4j/package-info.java  |    18 -
 .../spatial/util/CachingDoubleValueSource.java  |    93 -
 .../util/DistanceToShapeValueSource.java        |   122 -
 .../lucene/spatial/util/GeoBoundingBox.java     |    73 +
 .../lucene/spatial/util/GeoDistanceUtils.java   |   221 +
 .../lucene/spatial/util/GeoHashUtils.java       |   283 +
 .../lucene/spatial/util/GeoProjectionUtils.java |   465 +
 .../lucene/spatial/util/GeoRelationUtils.java   |   524 +
 .../apache/lucene/spatial/util/GeoUtils.java    |   247 +
 .../spatial/util/ShapeAreaValueSource.java      |   116 -
 .../lucene/spatial/util/ShapeFieldCache.java    |    54 -
 .../ShapeFieldCacheDistanceValueSource.java     |   112 -
 .../spatial/util/ShapeFieldCacheProvider.java   |    87 -
 .../spatial/util/ShapePredicateValueSource.java |   113 -
 .../lucene/spatial/util/package-info.java       |     7 +-
 .../spatial/vector/DistanceValueSource.java     |   120 -
 .../spatial/vector/PointVectorStrategy.java     |   182 -
 .../lucene/spatial/vector/package-info.java     |    20 -
 lucene/spatial/src/java/overview.html           |    63 +-
 .../src/test-files/cities-Intersects-BBox.txt   |     3 -
 .../spatial/src/test-files/data/LUCENE-4464.txt |     3 -
 .../src/test-files/data/countries-bbox.txt      |   249 -
 .../src/test-files/data/countries-poly.txt      |   249 -
 .../spatial/src/test-files/data/geonames-IE.txt | 22929 -----------------
 .../spatial/src/test-files/data/simple-bbox.txt |     5 -
 .../spatial/src/test-files/data/states-bbox.txt |    52 -
 .../spatial/src/test-files/data/states-poly.txt |    52 -
 .../src/test-files/data/world-cities-points.txt |  2680 --
 .../src/test-files/simple-Queries-BBox.txt      |     9 -
 .../src/test-files/states-Intersects-BBox.txt   |     3 -
 .../src/test-files/states-IsWithin-BBox.txt     |     4 -
 .../lucene/spatial/DistanceStrategyTest.java    |   135 -
 .../apache/lucene/spatial/PortedSolr3Test.java  |   167 -
 .../lucene/spatial/QueryEqualsHashCodeTest.java |   119 -
 .../apache/lucene/spatial/SpatialArgsTest.java  |    50 -
 .../apache/lucene/spatial/SpatialExample.java   |   200 -
 .../lucene/spatial/SpatialMatchConcern.java     |    31 -
 .../apache/lucene/spatial/SpatialTestCase.java  |   281 -
 .../apache/lucene/spatial/SpatialTestData.java  |    71 -
 .../apache/lucene/spatial/SpatialTestQuery.java |    96 -
 .../apache/lucene/spatial/StrategyTestCase.java |   252 -
 .../lucene/spatial/TestTestFramework.java       |    68 -
 .../lucene/spatial/bbox/TestBBoxStrategy.java   |   301 -
 .../composite/CompositeStrategyTest.java        |   142 -
 .../prefix/CellToBytesRefIterator50.java        |    44 -
 .../spatial/prefix/DateNRStrategyTest.java      |   143 -
 .../spatial/prefix/HeatmapFacetCounterTest.java |   252 -
 .../lucene/spatial/prefix/JtsPolygonTest.java   |   117 -
 .../spatial/prefix/NumberRangeFacetsTest.java   |   275 -
 .../RandomSpatialOpFuzzyPrefixTree50Test.java   |    31 -
 .../RandomSpatialOpFuzzyPrefixTreeTest.java     |   533 -
 .../prefix/RandomSpatialOpStrategyTestCase.java |   141 -
 .../prefix/TestRecursivePrefixTreeStrategy.java |   122 -
 .../prefix/TestTermQueryPrefixGridStrategy.java |    63 -
 .../prefix/tree/DateRangePrefixTreeTest.java    |   175 -
 .../prefix/tree/SpatialPrefixTreeTest.java      |   114 -
 .../spatial/query/SpatialArgsParserTest.java    |    81 -
 .../spatial/search/TestGeoPointQuery.java       |   399 +
 .../serialized/SerializedStrategyTest.java      |    66 -
 .../lucene/spatial/spatial4j/Geo3dRptTest.java  |   227 -
 .../Geo3dShapeRectRelationTestCase.java         |   264 -
 .../Geo3dShapeSphereModelRectRelationTest.java  |    72 -
 .../Geo3dShapeWGS84ModelRectRelationTest.java   |    95 -
 .../spatial4j/RandomizedShapeTestCase.java      |   289 -
 .../spatial/spatial4j/geo3d/GeoPointTest.java   |    82 -
 .../spatial/util/BaseGeoPointTestCase.java      |   774 +
 .../lucene/spatial/util/TestGeoUtils.java       |   551 +
 .../spatial/vector/TestPointVectorStrategy.java |    63 -
 solr/common-build.xml                           |     8 +-
 281 files changed, 46517 insertions(+), 46085 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/.idea/ant.xml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/.idea/ant.xml b/dev-tools/idea/.idea/ant.xml
index 2cd14fd..8d454ad 100644
--- a/dev-tools/idea/.idea/ant.xml
+++ b/dev-tools/idea/.idea/ant.xml
@@ -31,6 +31,7 @@
     <buildFile url="file://$PROJECT_DIR$/lucene/replicator/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/lucene/sandbox/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/lucene/spatial/build.xml" />
+    <buildFile url="file://$PROJECT_DIR$/lucene/spatial-extras/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/lucene/suggest/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/lucene/test-framework/build.xml" />
     <buildFile url="file://$PROJECT_DIR$/lucene/tools/build.xml" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/.idea/modules.xml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/.idea/modules.xml b/dev-tools/idea/.idea/modules.xml
index 4497f18..75da2f5 100644
--- a/dev-tools/idea/.idea/modules.xml
+++ b/dev-tools/idea/.idea/modules.xml
@@ -36,6 +36,7 @@
       <module group="Lucene/Other" filepath="$PROJECT_DIR$/lucene/replicator/replicator.iml" />
       <module group="Lucene/Other" filepath="$PROJECT_DIR$/lucene/sandbox/sandbox.iml" />
       <module group="Lucene/Other" filepath="$PROJECT_DIR$/lucene/spatial/spatial.iml" />
+      <module group="Lucene/Other" filepath="$PROJECT_DIR$/lucene/spatial-extras/spatial-extras.iml" />
       <module group="Lucene/Other" filepath="$PROJECT_DIR$/lucene/spatial3d/spatial3d.iml" />
       <module group="Lucene/Other" filepath="$PROJECT_DIR$/lucene/suggest/suggest.iml" />
       <module group="Lucene/Other" filepath="$PROJECT_DIR$/lucene/tools/tools.iml" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/.idea/workspace.xml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/.idea/workspace.xml b/dev-tools/idea/.idea/workspace.xml
index 423350b..a7c68de 100644
--- a/dev-tools/idea/.idea/workspace.xml
+++ b/dev-tools/idea/.idea/workspace.xml
@@ -204,6 +204,14 @@
       <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
       <patterns><pattern testClass=".*\.Test[^.]*|.*\.[^.]*Test" /></patterns>
     </configuration>
+    <configuration default="false" name="Module spatial-extras" type="JUnit" factoryName="JUnit">
+      <module name="spatial-extras" />
+      <option name="TEST_OBJECT" value="pattern" />
+      <option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$/idea-build/lucene/spatial-extras" />
+      <option name="VM_PARAMETERS" value="-ea -DtempDir=temp" />
+      <option name="TEST_SEARCH_SCOPE"><value defaultName="singleModule" /></option>
+      <patterns><pattern testClass=".*\.Test[^.]*|.*\.[^.]*Test" /></patterns>
+    </configuration>
     <configuration default="false" name="Module spatial3d" type="JUnit" factoryName="JUnit">
       <module name="spatial3d" />
       <option name="TEST_OBJECT" value="pattern" />
@@ -333,7 +341,7 @@
       <patterns><pattern testClass=".*\.Test[^.]*|.*\.[^.]*Test" /></patterns>
     </configuration>
  
-    <list size="40">
+    <list size="41">
       <item index="0" class="java.lang.String" itemvalue="JUnit.Lucene core" />
       <item index="1" class="java.lang.String" itemvalue="JUnit.Module analyzers-common" />
       <item index="2" class="java.lang.String" itemvalue="JUnit.Module analyzers-icu" />
@@ -359,21 +367,22 @@
       <item index="22" class="java.lang.String" itemvalue="JUnit.Module replicator" />
       <item index="23" class="java.lang.String" itemvalue="JUnit.Module sandbox" />
       <item index="24" class="java.lang.String" itemvalue="JUnit.Module spatial" />
-      <item index="25" class="java.lang.String" itemvalue="JUnit.Module spatial3d" />
-      <item index="26" class="java.lang.String" itemvalue="JUnit.Module suggest" />
-      <item index="27" class="java.lang.String" itemvalue="JUnit.Solr core" />
-      <item index="28" class="java.lang.String" itemvalue="JUnit.Solr analysis-extras contrib" />
-      <item index="29" class="java.lang.String" itemvalue="JUnit.Solr clustering contrib" />
-      <item index="30" class="java.lang.String" itemvalue="JUnit.Solr dataimporthandler contrib" />
-      <item index="31" class="java.lang.String" itemvalue="JUnit.Solr dataimporthandler-extras contrib" />
-      <item index="32" class="java.lang.String" itemvalue="JUnit.Solr extraction contrib" />
-      <item index="33" class="java.lang.String" itemvalue="JUnit.Solr map-reduce contrib" />
-      <item index="34" class="java.lang.String" itemvalue="JUnit.Solr morphlines-cell contrib" />
-      <item index="35" class="java.lang.String" itemvalue="JUnit.Solr morphlines-core contrib" />
-      <item index="36" class="java.lang.String" itemvalue="JUnit.Solr langid contrib" />
-      <item index="37" class="java.lang.String" itemvalue="JUnit.Solr uima contrib" />
-      <item index="38" class="java.lang.String" itemvalue="JUnit.Solr velocity contrib" />
-      <item index="39" class="java.lang.String" itemvalue="JUnit.Solrj" />
+      <item index="25" class="java.lang.String" itemvalue="JUnit.Module spatial-extras" />
+      <item index="26" class="java.lang.String" itemvalue="JUnit.Module spatial3d" />
+      <item index="27" class="java.lang.String" itemvalue="JUnit.Module suggest" />
+      <item index="28" class="java.lang.String" itemvalue="JUnit.Solr core" />
+      <item index="29" class="java.lang.String" itemvalue="JUnit.Solr analysis-extras contrib" />
+      <item index="30" class="java.lang.String" itemvalue="JUnit.Solr clustering contrib" />
+      <item index="31" class="java.lang.String" itemvalue="JUnit.Solr dataimporthandler contrib" />
+      <item index="32" class="java.lang.String" itemvalue="JUnit.Solr dataimporthandler-extras contrib" />
+      <item index="33" class="java.lang.String" itemvalue="JUnit.Solr extraction contrib" />
+      <item index="34" class="java.lang.String" itemvalue="JUnit.Solr map-reduce contrib" />
+      <item index="35" class="java.lang.String" itemvalue="JUnit.Solr morphlines-cell contrib" />
+      <item index="36" class="java.lang.String" itemvalue="JUnit.Solr morphlines-core contrib" />
+      <item index="37" class="java.lang.String" itemvalue="JUnit.Solr langid contrib" />
+      <item index="38" class="java.lang.String" itemvalue="JUnit.Solr uima contrib" />
+      <item index="39" class="java.lang.String" itemvalue="JUnit.Solr velocity contrib" />
+      <item index="40" class="java.lang.String" itemvalue="JUnit.Solrj" />
     </list>
   </component>
 </project>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/lucene/benchmark/src/benchmark.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/lucene/benchmark/src/benchmark.iml b/dev-tools/idea/lucene/benchmark/src/benchmark.iml
index cecd54f..509d5ec 100644
--- a/dev-tools/idea/lucene/benchmark/src/benchmark.iml
+++ b/dev-tools/idea/lucene/benchmark/src/benchmark.iml
@@ -24,7 +24,7 @@
     <orderEntry type="library" scope="TEST" name="JUnit" level="project" />
     <orderEntry type="module" scope="TEST" module-name="lucene-test-framework" />
     <orderEntry type="module" scope="TEST" module-name="benchmark-conf" />
-    <orderEntry type="module" module-name="spatial" />
+    <orderEntry type="module" module-name="spatial-extras" />
     <orderEntry type="module" module-name="facet" />
     <orderEntry type="module" module-name="highlighter" />
     <orderEntry type="module" module-name="icu" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/lucene/sandbox/sandbox.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/lucene/sandbox/sandbox.iml b/dev-tools/idea/lucene/sandbox/sandbox.iml
index 05caa9f..3a7e18b 100644
--- a/dev-tools/idea/lucene/sandbox/sandbox.iml
+++ b/dev-tools/idea/lucene/sandbox/sandbox.iml
@@ -24,6 +24,7 @@
     <orderEntry type="module" scope="TEST" module-name="lucene-test-framework" />
     <orderEntry type="module" scope="TEST" module-name="codecs" />
     <orderEntry type="module" module-name="lucene-core" />
+    <orderEntry type="module" module-name="spatial" />
   </component>
 </module>
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/lucene/spatial-extras/spatial-extras.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/lucene/spatial-extras/spatial-extras.iml b/dev-tools/idea/lucene/spatial-extras/spatial-extras.iml
new file mode 100644
index 0000000..17776fd
--- /dev/null
+++ b/dev-tools/idea/lucene/spatial-extras/spatial-extras.iml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="false">
+    <output url="file://$MODULE_DIR$/../../idea-build/lucene/spatial-extras/classes/java" />
+    <output-test url="file://$MODULE_DIR$/../../idea-build/lucene/spatial-extras/classes/test" />
+    <exclude-output />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
+      <sourceFolder url="file://$MODULE_DIR$/src/test-files" type="java-test-resource" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library" exported="">
+      <library>
+        <CLASSES>
+          <root url="file://$MODULE_DIR$/lib" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+        <jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
+      </library>
+    </orderEntry>
+    <orderEntry type="library" scope="TEST" name="JUnit" level="project" />
+    <orderEntry type="module" scope="TEST" module-name="lucene-test-framework" />
+    <orderEntry type="module" module-name="lucene-core" />
+    <orderEntry type="module" module-name="queries" />
+    <orderEntry type="module" module-name="misc" />
+    <orderEntry type="module" module-name="spatial3d" />
+    <orderEntry type="module" module-name="analysis-common" scope="TEST"/>
+  </component>
+</module>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/lucene/spatial/spatial.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/lucene/spatial/spatial.iml b/dev-tools/idea/lucene/spatial/spatial.iml
index f7cc723..239c278 100644
--- a/dev-tools/idea/lucene/spatial/spatial.iml
+++ b/dev-tools/idea/lucene/spatial/spatial.iml
@@ -7,27 +7,11 @@
     <content url="file://$MODULE_DIR$">
       <sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
       <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
-      <sourceFolder url="file://$MODULE_DIR$/src/test-files" type="java-test-resource" />
     </content>
     <orderEntry type="inheritedJdk" />
     <orderEntry type="sourceFolder" forTests="false" />
-    <orderEntry type="module-library" exported="">
-      <library>
-        <CLASSES>
-          <root url="file://$MODULE_DIR$/lib" />
-        </CLASSES>
-        <JAVADOC />
-        <SOURCES />
-        <jarDirectory url="file://$MODULE_DIR$/lib" recursive="false" />
-      </library>
-    </orderEntry>
     <orderEntry type="library" scope="TEST" name="JUnit" level="project" />
-    <orderEntry type="module" scope="TEST" module-name="lucene-test-framework" />
     <orderEntry type="module" module-name="lucene-core" />
-    <orderEntry type="module" module-name="queries" />
-    <orderEntry type="module" module-name="misc" />
-    <orderEntry type="module" module-name="spatial3d" />
-    <orderEntry type="module" module-name="analysis-common" scope="TEST"/>
+    <orderEntry type="module" module-name="lucene-test-framework" />
   </component>
 </module>
-

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/solr/core/src/java/solr-core.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/core/src/java/solr-core.iml b/dev-tools/idea/solr/core/src/java/solr-core.iml
index 9ec3eb6..eded4a8 100644
--- a/dev-tools/idea/solr/core/src/java/solr-core.iml
+++ b/dev-tools/idea/solr/core/src/java/solr-core.iml
@@ -13,7 +13,7 @@
     <orderEntry type="library" name="Solr example library" level="project" />
     <orderEntry type="module" module-name="solrj" />
     <orderEntry type="module" module-name="kuromoji" />
-    <orderEntry type="module" module-name="spatial" />
+    <orderEntry type="module" module-name="spatial-extras" />
     <orderEntry type="module" module-name="grouping" />
     <orderEntry type="module" module-name="highlighter" />
     <orderEntry type="module" module-name="icu" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/idea/solr/core/src/solr-core-tests.iml
----------------------------------------------------------------------
diff --git a/dev-tools/idea/solr/core/src/solr-core-tests.iml b/dev-tools/idea/solr/core/src/solr-core-tests.iml
index eb27c57..c9f722a 100644
--- a/dev-tools/idea/solr/core/src/solr-core-tests.iml
+++ b/dev-tools/idea/solr/core/src/solr-core-tests.iml
@@ -25,7 +25,7 @@
     <orderEntry type="module" scope="TEST" module-name="queryparser" />
     <orderEntry type="module" scope="TEST" module-name="queries" />
     <orderEntry type="module" scope="TEST" module-name="suggest" />
-    <orderEntry type="module" scope="TEST" module-name="spatial" />
+    <orderEntry type="module" scope="TEST" module-name="spatial-extras" />
     <orderEntry type="module" scope="TEST" module-name="misc" />
     <orderEntry type="module" scope="TEST" module-name="join" />
     <orderEntry type="module" scope="TEST" module-name="expressions" />

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/maven/lucene/pom.xml.template
----------------------------------------------------------------------
diff --git a/dev-tools/maven/lucene/pom.xml.template b/dev-tools/maven/lucene/pom.xml.template
index f49a60e..536290b 100644
--- a/dev-tools/maven/lucene/pom.xml.template
+++ b/dev-tools/maven/lucene/pom.xml.template
@@ -60,6 +60,7 @@
     <module>replicator</module>
     <module>sandbox</module>
     <module>spatial</module>
+    <module>spatial-extras</module>
     <module>spatial3d</module>
     <module>suggest</module>
   </modules>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/maven/lucene/spatial-extras/pom.xml.template
----------------------------------------------------------------------
diff --git a/dev-tools/maven/lucene/spatial-extras/pom.xml.template b/dev-tools/maven/lucene/spatial-extras/pom.xml.template
new file mode 100644
index 0000000..dc2cb09
--- /dev/null
+++ b/dev-tools/maven/lucene/spatial-extras/pom.xml.template
@@ -0,0 +1,62 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <!--
+    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.
+  -->
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.apache.lucene</groupId>
+    <artifactId>lucene-parent</artifactId>
+    <version>@version@</version>
+    <relativePath>../pom.xml</relativePath>
+  </parent>
+  <groupId>org.apache.lucene</groupId>
+  <artifactId>lucene-spatial-extras</artifactId>
+  <packaging>jar</packaging>
+  <name>Lucene Spatial Extras</name>
+  <description>
+    Advanced Spatial Shape Strategies for Apache Lucene
+  </description>
+  <properties>
+    <module-directory>lucene/spatial-extras</module-directory>
+    <relative-top-level>../../..</relative-top-level>
+    <module-path>${relative-top-level}/${module-directory}</module-path>
+  </properties>
+  <dependencies>
+    <dependency>
+      <!-- lucene-test-framework dependency must be declared before lucene-core -->
+      <groupId>org.apache.lucene</groupId>
+      <artifactId>lucene-test-framework</artifactId>
+      <scope>test</scope>
+    </dependency>
+@lucene-spatial-extras.internal.dependencies@
+@lucene-spatial-extras.external.dependencies@
+@lucene-spatial-extras.internal.test.dependencies@
+@lucene-spatial-extras.external.test.dependencies@
+  </dependencies>
+  <build>
+    <sourceDirectory>${module-path}/src/java</sourceDirectory>
+    <testSourceDirectory>${module-path}/src/test</testSourceDirectory>
+    <testResources>
+      <testResource>
+        <directory>${module-path}/src/test-files</directory>
+      </testResource>
+    </testResources>
+  </build>
+</project>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/maven/lucene/spatial/pom.xml.template
----------------------------------------------------------------------
diff --git a/dev-tools/maven/lucene/spatial/pom.xml.template b/dev-tools/maven/lucene/spatial/pom.xml.template
index 0b1e96a..11a7865 100644
--- a/dev-tools/maven/lucene/spatial/pom.xml.template
+++ b/dev-tools/maven/lucene/spatial/pom.xml.template
@@ -9,9 +9,9 @@
     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
@@ -30,8 +30,8 @@
   <artifactId>lucene-spatial</artifactId>
   <packaging>jar</packaging>
   <name>Lucene Spatial</name>
-  <description>    
-  	Spatial Strategies for Apache Lucene
+  <description>
+    Geospatial Indexing and Query for Apache Lucene
   </description>
   <properties>
     <module-directory>lucene/spatial</module-directory>
@@ -39,7 +39,7 @@
     <module-path>${relative-top-level}/${module-directory}</module-path>
   </properties>
   <dependencies>
-    <dependency> 
+    <dependency>
       <!-- lucene-test-framework dependency must be declared before lucene-core -->
       <groupId>org.apache.lucene</groupId>
       <artifactId>lucene-test-framework</artifactId>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/dev-tools/scripts/smokeTestRelease.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/smokeTestRelease.py b/dev-tools/scripts/smokeTestRelease.py
index cd7b334..a4029ae 100644
--- a/dev-tools/scripts/smokeTestRelease.py
+++ b/dev-tools/scripts/smokeTestRelease.py
@@ -640,7 +640,7 @@ def verifyUnpacked(java, project, artifact, unpackPath, svnRevision, version, te
 
   if project == 'lucene':
     # TODO: clean this up to not be a list of modules that we must maintain
-    extras = ('analysis', 'backward-codecs', 'benchmark', 'classification', 'codecs', 'core', 'demo', 'docs', 'expressions', 'facet', 'grouping', 'highlighter', 'join', 'memory', 'misc', 'queries', 'queryparser', 'replicator', 'sandbox', 'spatial', 'spatial3d', 'suggest', 'test-framework', 'licenses')
+    extras = ('analysis', 'backward-codecs', 'benchmark', 'classification', 'codecs', 'core', 'demo', 'docs', 'expressions', 'facet', 'grouping', 'highlighter', 'join', 'memory', 'misc', 'queries', 'queryparser', 'replicator', 'sandbox', 'spatial', 'spatial-extras', 'spatial3d', 'suggest', 'test-framework', 'licenses')
     if isSrc:
       extras += ('build.xml', 'common-build.xml', 'module-build.xml', 'ivy-settings.xml', 'ivy-versions.properties', 'ivy-ignore-conflicts.properties', 'version.properties', 'tools', 'site')
   else:

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/benchmark/build.xml
----------------------------------------------------------------------
diff --git a/lucene/benchmark/build.xml b/lucene/benchmark/build.xml
index cd47287..c73bfe4 100644
--- a/lucene/benchmark/build.xml
+++ b/lucene/benchmark/build.xml
@@ -171,7 +171,7 @@
       <pathelement path="${analyzers-common.jar}"/>
       <pathelement path="${queryparser.jar}"/>
       <pathelement path="${facet.jar}"/>
-      <pathelement path="${spatial.jar}"/>
+      <pathelement path="${spatial-extras.jar}"/>
       <pathelement path="${queries.jar}"/>
       <pathelement path="${codecs.jar}"/>
       <pathelement path="${join.jar}"/>
@@ -185,7 +185,7 @@
     </path>
 
     <target name="javadocs" depends="javadocs-memory,javadocs-highlighter,javadocs-analyzers-common,
-      javadocs-queryparser,javadocs-facet,javadocs-spatial,compile-core,check-javadocs-uptodate" 
+      javadocs-queryparser,javadocs-facet,javadocs-spatial-extras,compile-core,check-javadocs-uptodate"
             unless="javadocs-uptodate-${name}">
     <invoke-module-javadoc>
       <links>
@@ -194,7 +194,7 @@
         <link href="../analyzers-common"/>
         <link href="../queryparser"/>
         <link href="../facet"/>
-        <link href="../spatial"/>
+        <link href="../spatial-extras"/>
       </links>
     </invoke-module-javadoc>
     </target>
@@ -277,7 +277,7 @@
       <echo>Benchmark output in JIRA table format is in file: ${shingle.jira.output.file}</echo>
     </target>
 
-    <target name="init" depends="module-build.init,jar-memory,jar-highlighter,jar-analyzers-common,jar-queryparser,jar-facet,jar-spatial,jar-codecs,jar-join"/>
+    <target name="init" depends="module-build.init,jar-memory,jar-highlighter,jar-analyzers-common,jar-queryparser,jar-facet,jar-spatial,jar-spatial-extras,jar-codecs,jar-join"/>
   
     <target name="compile-test" depends="copy-alg-files-for-testing,module-build.compile-test"/>
     <target name="copy-alg-files-for-testing" description="copy .alg files as resources for testing">

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/build.xml
----------------------------------------------------------------------
diff --git a/lucene/build.xml b/lucene/build.xml
index 9bd4492..117059e 100644
--- a/lucene/build.xml
+++ b/lucene/build.xml
@@ -179,7 +179,8 @@
     <!-- queries: problems -->
     <!-- queryparser: problems -->
     <!-- sandbox: problems -->
-    <!-- spatial: problems -->
+    <check-missing-javadocs dir="build/docs/spatial" level="method"/>
+    <!-- spatial-extras: problems -->
     <check-missing-javadocs dir="build/docs/suggest" level="method"/>
     <!-- test-framework: problems -->
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/core/src/java/org/apache/lucene/util/SloppyMath.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/SloppyMath.java b/lucene/core/src/java/org/apache/lucene/util/SloppyMath.java
index 9a05704..8da8276 100644
--- a/lucene/core/src/java/org/apache/lucene/util/SloppyMath.java
+++ b/lucene/core/src/java/org/apache/lucene/util/SloppyMath.java
@@ -180,15 +180,15 @@ public class SloppyMath {
   }
 
   // haversin
-  static final double TO_RADIANS = Math.PI / 180D;
-  static final double TO_DEGREES = 180D / Math.PI;
+  public static final double TO_RADIANS = Math.PI / 180D;
+  public static final double TO_DEGREES = 180D / Math.PI;
   
   // cos/asin
   private static final double ONE_DIV_F2 = 1/2.0;
   private static final double ONE_DIV_F3 = 1/6.0;
   private static final double ONE_DIV_F4 = 1/24.0;
 
-  static final double PIO2 = Math.PI / 2D;
+  public static final double PIO2 = Math.PI / 2D;
   private static final double PIO2_HI = Double.longBitsToDouble(0x3FF921FB54400000L); // 1.57079632673412561417e+00 first 33 bits of pi/2
   private static final double PIO2_LO = Double.longBitsToDouble(0x3DD0B4611A626331L); // 6.07710050650619224932e-11 pi/2 - PIO2_HI
   private static final double TWOPI_HI = 4*PIO2_HI;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/module-build.xml
----------------------------------------------------------------------
diff --git a/lucene/module-build.xml b/lucene/module-build.xml
index 0263101..4a57aa7 100644
--- a/lucene/module-build.xml
+++ b/lucene/module-build.xml
@@ -640,6 +640,32 @@
     <property name="spatial-javadocs.uptodate" value="true"/>
   </target>
 
+  <target name="spatial-compile-test" depends="init" if="module.has.tests">
+    <ant dir="${common.dir}/spatial" target="compile-test" inheritAll="false"/>
+  </target>
+
+  <property name="spatial-extras.jar" value="${common.dir}/build/spatial-extras/lucene-spatial-extras-${version}.jar"/>
+  <target name="check-spatial-extras-uptodate" unless="spatial-extras.uptodate">
+    <module-uptodate name="spatial-extras" jarfile="${spatial-extras.jar}" property="spatial-extras.uptodate"/>
+  </target>
+  <target name="jar-spatial-extras" unless="spatial-extras.uptodate" depends="check-spatial-extras-uptodate">
+    <ant dir="${common.dir}/spatial-extras" target="jar-core" inheritAll="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+    </ant>
+    <property name="spatial-extras.uptodate" value="true"/>
+  </target>
+
+  <property name="spatial-extras-javadoc.jar" value="${common.dir}/build/spatial-extras/lucene-spatial-extras-${version}-javadoc.jar"/>
+  <target name="check-spatial-extras-javadocs-uptodate" unless="spatial-extras-javadocs.uptodate">
+    <module-uptodate name="spatial-extras" jarfile="${spatial-extras-javadoc.jar}" property="spatial-extras-javadocs.uptodate"/>
+  </target>
+  <target name="javadocs-spatial-extras" unless="spatial-extras-javadocs.uptodate" depends="check-spatial-extras-javadocs-uptodate">
+    <ant dir="${common.dir}/spatial-extras" target="javadocs" inheritAll="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+    </ant>
+    <property name="spatial-extras-javadocs.uptodate" value="true"/>
+  </target>
+
   <property name="suggest.jar" value="${common.dir}/build/suggest/lucene-suggest-${version}.jar"/>
   <target name="check-suggest-uptodate" unless="suggest.uptodate">
     <module-uptodate name="suggest" jarfile="${suggest.jar}" property="suggest.uptodate"/>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/build.xml
----------------------------------------------------------------------
diff --git a/lucene/sandbox/build.xml b/lucene/sandbox/build.xml
index 93bc275..c9d2275 100644
--- a/lucene/sandbox/build.xml
+++ b/lucene/sandbox/build.xml
@@ -23,4 +23,24 @@
 
   <import file="../module-build.xml"/>
 
+  <path id="classpath">
+    <path refid="base.classpath"/>
+    <pathelement path="${spatial.jar}"/>
+  </path>
+  <target name="compile-core" depends="jar-spatial,common.compile-core" />
+
+  <path id="test.classpath">
+    <pathelement location="${build.dir}/classes/java"/>
+    <pathelement location="${build.dir}/classes/test"/>
+    <pathelement location="${common.dir}/build/spatial/classes/test"/>
+    <path refid="test.base.classpath"/>
+    <pathelement path="${spatial.jar}"/>
+    <path refid="junit-path"/>
+  </path>
+
+  <path id="junit.classpath">
+    <path refid="test.classpath"/>
+    <pathelement path="${java.class.path}"/>
+  </path>
+  <target name="compile-test" depends="jar-spatial,spatial-compile-test,common.compile-test" />
 </project>

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/document/GeoPointField.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/GeoPointField.java b/lucene/sandbox/src/java/org/apache/lucene/document/GeoPointField.java
deleted file mode 100644
index ad1483d..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/document/GeoPointField.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.apache.lucene.document;
-
-import org.apache.lucene.index.DocValuesType;
-import org.apache.lucene.index.IndexOptions;
-import org.apache.lucene.util.GeoUtils;
-
-/**
- * <p>
- * Field that indexes <code>latitude</code> <code>longitude</code> decimal-degree values
- * for efficient encoding, sorting, and querying. This Geo capability is intended
- * to provide a basic and efficient out of the box field type for indexing and
- * querying 2 dimensional points in WGS-84 decimal degrees. An example usage is as follows:
- *
- * <pre class="prettyprint">
- *  document.add(new GeoPointField(name, -96.33, 32.66, Field.Store.NO));
- * </pre>
- *
- * <p>To perform simple geospatial queries against a <code>GeoPointField</code>,
- * see {@link org.apache.lucene.search.GeoPointInBBoxQuery}, {@link org.apache.lucene.search.GeoPointInPolygonQuery},
- * or {@link org.apache.lucene.search.GeoPointDistanceQuery}
- *
- * NOTE: This indexes only high precision encoded terms which may result in visiting a high number
- * of terms for large queries. See LUCENE-6481 for a future improvement.
- *
- * @lucene.experimental
- */
-public final class GeoPointField extends Field {
-  public static final int PRECISION_STEP = 9;
-
-  /**
-   * Type for an GeoPointField that is not stored:
-   * normalization factors, frequencies, and positions are omitted.
-   */
-  public static final FieldType TYPE_NOT_STORED = new FieldType();
-  static {
-    TYPE_NOT_STORED.setTokenized(false);
-    TYPE_NOT_STORED.setOmitNorms(true);
-    TYPE_NOT_STORED.setIndexOptions(IndexOptions.DOCS);
-    TYPE_NOT_STORED.setDocValuesType(DocValuesType.SORTED_NUMERIC);
-    TYPE_NOT_STORED.setNumericType(FieldType.LegacyNumericType.LONG);
-    TYPE_NOT_STORED.setNumericPrecisionStep(PRECISION_STEP);
-    TYPE_NOT_STORED.freeze();
-  }
-
-  /**
-   * Type for a stored GeoPointField:
-   * normalization factors, frequencies, and positions are omitted.
-   */
-  public static final FieldType TYPE_STORED = new FieldType();
-  static {
-    TYPE_STORED.setTokenized(false);
-    TYPE_STORED.setOmitNorms(true);
-    TYPE_STORED.setIndexOptions(IndexOptions.DOCS);
-    TYPE_STORED.setDocValuesType(DocValuesType.SORTED_NUMERIC);
-    TYPE_STORED.setNumericType(FieldType.LegacyNumericType.LONG);
-    TYPE_STORED.setNumericPrecisionStep(PRECISION_STEP);
-    TYPE_STORED.setStored(true);
-    TYPE_STORED.freeze();
-  }
-
-  /** Creates a stored or un-stored GeoPointField with the provided value
-   *  and default <code>precisionStep</code> set to 64 to avoid wasteful
-   *  indexing of lower precision terms.
-   *  @param name field name
-   *  @param lon longitude double value [-180.0 : 180.0]
-   *  @param lat latitude double value [-90.0 : 90.0]
-   *  @param stored Store.YES if the content should also be stored
-   *  @throws IllegalArgumentException if the field name is null.
-   */
-  public GeoPointField(String name, double lon, double lat, Store stored) {
-    super(name, stored == Store.YES ? TYPE_STORED : TYPE_NOT_STORED);
-    fieldsData = GeoUtils.mortonHash(lon, lat);
-  }
-
-  /** Expert: allows you to customize the {@link
-   *  FieldType}.
-   *  @param name field name
-   *  @param lon longitude double value [-180.0 : 180.0]
-   *  @param lat latitude double value [-90.0 : 90.0]
-   *  @param type customized field type: must have {@link FieldType#numericType()}
-   *         of {@link org.apache.lucene.document.FieldType.LegacyNumericType#LONG}.
-   *  @throws IllegalArgumentException if the field name or type is null, or
-   *          if the field type does not have a LONG numericType()
-   */
-  public GeoPointField(String name, double lon, double lat, FieldType type) {
-    super(name, type);
-    if (type.numericType() != FieldType.LegacyNumericType.LONG) {
-      throw new IllegalArgumentException("type.numericType() must be LONG but got " + type.numericType());
-    }
-    if (type.docValuesType() != DocValuesType.SORTED_NUMERIC) {
-      throw new IllegalArgumentException("type.docValuesType() must be SORTED_NUMERIC but got " + type.docValuesType());
-    }
-    fieldsData = GeoUtils.mortonHash(lon, lat);
-  }
-
-  public double getLon() {
-    return GeoUtils.mortonUnhashLon((long) fieldsData);
-  }
-
-  public double getLat() {
-    return GeoUtils.mortonUnhashLat((long) fieldsData);
-  }
-
-  @Override
-  public String toString() {
-    if (fieldsData == null) {
-      return null;
-    }
-    StringBuilder sb = new StringBuilder();
-    sb.append(GeoUtils.mortonUnhashLon((long) fieldsData));
-    sb.append(',');
-    sb.append(GeoUtils.mortonUnhashLat((long) fieldsData));
-    return sb.toString();
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java b/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
index 71d9527..3be3d48 100644
--- a/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
+++ b/lucene/sandbox/src/java/org/apache/lucene/document/LatLonPoint.java
@@ -17,7 +17,7 @@
 package org.apache.lucene.document;
 
 import org.apache.lucene.util.BytesRef;
-import org.apache.lucene.util.GeoUtils;
+import org.apache.lucene.spatial.util.GeoUtils;
 import org.apache.lucene.util.NumericUtils;
 
 /** Add this to a document to index lat/lon point dimensionally */

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/search/GeoBoundingBox.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/GeoBoundingBox.java b/lucene/sandbox/src/java/org/apache/lucene/search/GeoBoundingBox.java
deleted file mode 100644
index c2c92ea..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/search/GeoBoundingBox.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.apache.lucene.search;
-
-import org.apache.lucene.util.GeoUtils;
-
-/** NOTE: package private; just used so {@link GeoPointInPolygonQuery} can communicate its bounding box to {@link GeoPointInBBoxQuery}. */
-class GeoBoundingBox {
-  public final double minLon;
-  public final double maxLon;
-  public final double minLat;
-  public final double maxLat;
-
-  public GeoBoundingBox(double minLon, double maxLon, double minLat, double maxLat) {
-    if (GeoUtils.isValidLon(minLon) == false) {
-      throw new IllegalArgumentException("invalid minLon " + minLon);
-    }
-    if (GeoUtils.isValidLon(maxLon) == false) {
-      throw new IllegalArgumentException("invalid maxLon " + minLon);
-    }
-    if (GeoUtils.isValidLat(minLat) == false) {
-      throw new IllegalArgumentException("invalid minLat " + minLat);
-    }
-    if (GeoUtils.isValidLat(maxLat) == false) {
-      throw new IllegalArgumentException("invalid maxLat " + minLat);
-    }
-    this.minLon = minLon;
-    this.maxLon = maxLon;
-    this.minLat = minLat;
-    this.maxLat = maxLat;
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQuery.java b/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQuery.java
deleted file mode 100644
index a77798b..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQuery.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * 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.apache.lucene.search;
-
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.util.GeoDistanceUtils;
-import org.apache.lucene.util.GeoRect;
-import org.apache.lucene.util.GeoUtils;
-
-/** Implements a simple point distance query on a GeoPoint field. This is based on
- * {@link org.apache.lucene.search.GeoPointInBBoxQuery} and is implemented using a two phase approach. First,
- * like {@code GeoPointInBBoxQueryImpl} candidate terms are queried using the numeric ranges based on
- * the morton codes of the min and max lat/lon pairs that intersect the boundary of the point-radius
- * circle. Terms
- * passing this initial filter are then passed to a secondary {@code postFilter} method that verifies whether the
- * decoded lat/lon point fall within the specified query distance (see {@link org.apache.lucene.util.SloppyMath#haversin}.
- * All morton value comparisons are subject to the same precision tolerance defined in
- * {@value org.apache.lucene.util.GeoUtils#TOLERANCE} and distance comparisons are subject to the accuracy of the
- * haversine formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159)
- *
- * <p>Note: This query currently uses haversine which is a sloppy distance calculation (see above reference). For large
- * queries one can expect upwards of 400m error. Vincenty shrinks this to ~40m error but pays a penalty for computing
- * using the spheroid
- *
- * @lucene.experimental */
-public class GeoPointDistanceQuery extends GeoPointInBBoxQuery {
-  protected final double centerLon;
-  protected final double centerLat;
-  protected final double radiusMeters;
-
-  /** NOTE: radius is in meters. */
-  public GeoPointDistanceQuery(final String field, final double centerLon, final double centerLat, final double radiusMeters) {
-    this(field, GeoUtils.circleToBBox(centerLon, centerLat, radiusMeters), centerLon, centerLat, radiusMeters);
-  }
-
-  private GeoPointDistanceQuery(final String field, GeoRect bbox, final double centerLon,
-                                final double centerLat, final double radiusMeters) {
-    super(field, bbox.minLon, bbox.minLat, bbox.maxLon, bbox.maxLat);
-    {
-      // check longitudinal overlap (limits radius)
-      final double maxRadius = GeoDistanceUtils.maxRadialDistanceMeters(centerLon, centerLat);
-      if (radiusMeters > maxRadius) {
-        throw new IllegalArgumentException("radiusMeters " + radiusMeters + " exceeds maxRadius [" + maxRadius
-            + "] at location [" + centerLon + " " + centerLat + "]");
-      }
-    }
-
-    if (GeoUtils.isValidLon(centerLon) == false) {
-      throw new IllegalArgumentException("invalid centerLon " + centerLon);
-    }
-
-    if (GeoUtils.isValidLat(centerLat) == false) {
-      throw new IllegalArgumentException("invalid centerLat " + centerLat);
-    }
-
-    if (radiusMeters <= 0.0) {
-      throw new IllegalArgumentException("invalid radiusMeters " + radiusMeters);
-    }
-
-    this.centerLon = centerLon;
-    this.centerLat = centerLat;
-    this.radiusMeters = radiusMeters;
-  }
-
-  @Override
-  public Query rewrite(IndexReader reader) {
-    // query crosses dateline; split into left and right queries
-    if (maxLon < minLon) {
-      BooleanQuery.Builder bqb = new BooleanQuery.Builder();
-
-      // unwrap the longitude iff outside the specified min/max lon range
-      double unwrappedLon = centerLon;
-      if (unwrappedLon > maxLon) {
-        // unwrap left
-        unwrappedLon += -360.0D;
-      }
-      GeoPointDistanceQueryImpl left = new GeoPointDistanceQueryImpl(field, this, unwrappedLon,
-          new GeoRect(GeoUtils.MIN_LON_INCL, maxLon, minLat, maxLat));
-      bqb.add(new BooleanClause(left, BooleanClause.Occur.SHOULD));
-
-      if (unwrappedLon < maxLon) {
-        // unwrap right
-        unwrappedLon += 360.0D;
-      }
-      GeoPointDistanceQueryImpl right = new GeoPointDistanceQueryImpl(field, this, unwrappedLon,
-          new GeoRect(minLon, GeoUtils.MAX_LON_INCL, minLat, maxLat));
-      bqb.add(new BooleanClause(right, BooleanClause.Occur.SHOULD));
-
-      return bqb.build();
-    }
-    return new GeoPointDistanceQueryImpl(field, this, centerLon,
-        new GeoRect(this.minLon, this.maxLon, this.minLat, this.maxLat));
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) return true;
-    if (!(o instanceof GeoPointDistanceQuery)) return false;
-    if (!super.equals(o)) return false;
-
-    GeoPointDistanceQuery that = (GeoPointDistanceQuery) o;
-
-    if (Double.compare(that.centerLat, centerLat) != 0) return false;
-    if (Double.compare(that.centerLon, centerLon) != 0) return false;
-    if (Double.compare(that.radiusMeters, radiusMeters) != 0) return false;
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int result = super.hashCode();
-    long temp;
-    temp = Double.doubleToLongBits(centerLon);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(centerLat);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(radiusMeters);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    return result;
-  }
-
-  @Override
-  public String toString(String field) {
-    final StringBuilder sb = new StringBuilder();
-    sb.append(getClass().getSimpleName());
-    sb.append(':');
-    if (!this.field.equals(field)) {
-      sb.append(" field=");
-      sb.append(this.field);
-      sb.append(':');
-    }
-    return sb.append( " Center: [")
-        .append(centerLon)
-        .append(',')
-        .append(centerLat)
-        .append(']')
-        .append(" Distance: ")
-        .append(radiusMeters)
-        .append(" meters")
-        .append("]")
-        .toString();
-  }
-
-  public double getCenterLon() {
-    return this.centerLon;
-  }
-
-  public double getCenterLat() {
-    return this.centerLat;
-  }
-
-  public double getRadiusMeters() {
-    return this.radiusMeters;
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQueryImpl.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQueryImpl.java b/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQueryImpl.java
deleted file mode 100644
index ef2155b..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceQueryImpl.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * 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.apache.lucene.search;
-
-import java.io.IOException;
-
-import org.apache.lucene.document.GeoPointField;
-import org.apache.lucene.index.Terms;
-import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.util.AttributeSource;
-import org.apache.lucene.util.GeoRect;
-import org.apache.lucene.util.GeoRelationUtils;
-import org.apache.lucene.util.GeoUtils;
-import org.apache.lucene.util.SloppyMath;
-
-/** Package private implementation for the public facing GeoPointDistanceQuery delegate class.
- *
- *    @lucene.experimental
- */
-final class GeoPointDistanceQueryImpl extends GeoPointInBBoxQueryImpl {
-  private final GeoPointDistanceQuery query;
-  private final double centerLon;
-
-  GeoPointDistanceQueryImpl(final String field, final GeoPointDistanceQuery q, final double centerLonUnwrapped,
-                            final GeoRect bbox) {
-    super(field, bbox.minLon, bbox.minLat, bbox.maxLon, bbox.maxLat);
-    query = q;
-    centerLon = centerLonUnwrapped;
-  }
-
-  @Override @SuppressWarnings("unchecked")
-  protected TermsEnum getTermsEnum(final Terms terms, AttributeSource atts) throws IOException {
-    return new GeoPointRadiusTermsEnum(terms.iterator(), this.minLon, this.minLat, this.maxLon, this.maxLat);
-  }
-
-  @Override
-  public void setRewriteMethod(RewriteMethod method) {
-    throw new UnsupportedOperationException("cannot change rewrite method");
-  }
-
-  private final class GeoPointRadiusTermsEnum extends GeoPointTermsEnum {
-    GeoPointRadiusTermsEnum(final TermsEnum tenum, final double minLon, final double minLat,
-                            final double maxLon, final double maxLat) {
-      super(tenum, minLon, minLat, maxLon, maxLat);
-    }
-
-    /**
-     * Computes the maximum shift for the given pointDistanceQuery. This prevents unnecessary depth traversal
-     * given the size of the distance query.
-     */
-    @Override
-    protected short computeMaxShift() {
-      final short shiftFactor;
-
-      if (query.radiusMeters > 1000000) {
-        shiftFactor = 5;
-      } else {
-        shiftFactor = 4;
-      }
-
-      return (short)(GeoPointField.PRECISION_STEP * shiftFactor);
-    }
-
-    @Override
-    protected boolean cellCrosses(final double minLon, final double minLat, final double maxLon, final double maxLat) {
-      return GeoRelationUtils.rectCrossesCircle(minLon, minLat, maxLon, maxLat,
-          centerLon, query.centerLat, query.radiusMeters, true);
-    }
-
-    @Override
-    protected boolean cellWithin(final double minLon, final double minLat, final double maxLon, final double maxLat) {
-      return GeoRelationUtils.rectWithinCircle(minLon, minLat, maxLon, maxLat,
-          centerLon, query.centerLat, query.radiusMeters, true);
-    }
-
-    @Override
-    protected boolean cellIntersectsShape(final double minLon, final double minLat, final double maxLon, final double maxLat) {
-      return (cellContains(minLon, minLat, maxLon, maxLat)
-          || cellWithin(minLon, minLat, maxLon, maxLat) || cellCrosses(minLon, minLat, maxLon, maxLat));
-    }
-
-    /**
-     * The two-phase query approach. The parent {@link org.apache.lucene.search.GeoPointTermsEnum} class matches
-     * encoded terms that fall within the minimum bounding box of the point-radius circle. Those documents that pass
-     * the initial bounding box filter are then post filter compared to the provided distance using the
-     * {@link org.apache.lucene.util.SloppyMath#haversin} method.
-     */
-    @Override
-    protected boolean postFilter(final double lon, final double lat) {
-      return (SloppyMath.haversin(query.centerLat, centerLon, lat, lon) * 1000.0 <= query.radiusMeters);
-    }
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) return true;
-    if (!(o instanceof GeoPointDistanceQueryImpl)) return false;
-    if (!super.equals(o)) return false;
-
-    GeoPointDistanceQueryImpl that = (GeoPointDistanceQueryImpl) o;
-
-    if (!query.equals(that.query)) return false;
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int result = super.hashCode();
-    result = 31 * result + query.hashCode();
-    return result;
-  }
-
-  public double getRadiusMeters() {
-    return query.getRadiusMeters();
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceRangeQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceRangeQuery.java b/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceRangeQuery.java
deleted file mode 100644
index 5324a6d..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointDistanceRangeQuery.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.apache.lucene.search;
-
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.util.GeoProjectionUtils;
-
-/** Implements a point distance range query on a GeoPoint field. This is based on
- * {@code org.apache.lucene.search.GeoPointDistanceQuery} and is implemented using a
- * {@code org.apache.lucene.search.BooleanClause.MUST_NOT} clause to exclude any points that fall within
- * minRadiusMeters from the provided point.
- *
- *    @lucene.experimental
- */
-public final class GeoPointDistanceRangeQuery extends GeoPointDistanceQuery {
-  protected final double minRadiusMeters;
-
-  public GeoPointDistanceRangeQuery(final String field, final double centerLon, final double centerLat,
-                                    final double minRadiusMeters, final double maxRadius) {
-    super(field, centerLon, centerLat, maxRadius);
-    this.minRadiusMeters = minRadiusMeters;
-  }
-
-  @Override
-  public Query rewrite(IndexReader reader) {
-    Query q = super.rewrite(reader);
-    if (minRadiusMeters == 0.0) {
-      return q;
-    }
-
-    // add an exclusion query
-    BooleanQuery.Builder bqb = new BooleanQuery.Builder();
-
-    // create a new exclusion query
-    GeoPointDistanceQuery exclude = new GeoPointDistanceQuery(field, centerLon, centerLat, minRadiusMeters);
-    // full map search
-//    if (radiusMeters >= GeoProjectionUtils.SEMIMINOR_AXIS) {
-//      bqb.add(new BooleanClause(new GeoPointInBBoxQuery(this.field, -180.0, -90.0, 180.0, 90.0), BooleanClause.Occur.MUST));
-//    } else {
-      bqb.add(new BooleanClause(q, BooleanClause.Occur.MUST));
-//    }
-    bqb.add(new BooleanClause(exclude, BooleanClause.Occur.MUST_NOT));
-
-    return bqb.build();
-  }
-
-  @Override
-  public String toString(String field) {
-    final StringBuilder sb = new StringBuilder();
-    sb.append(getClass().getSimpleName());
-    sb.append(':');
-    if (!this.field.equals(field)) {
-      sb.append(" field=");
-      sb.append(this.field);
-      sb.append(':');
-    }
-    return sb.append( " Center: [")
-        .append(centerLon)
-        .append(',')
-        .append(centerLat)
-        .append(']')
-        .append(" From Distance: ")
-        .append(minRadiusMeters)
-        .append(" m")
-        .append(" To Distance: ")
-        .append(radiusMeters)
-        .append(" m")
-        .append(" Lower Left: [")
-        .append(minLon)
-        .append(',')
-        .append(minLat)
-        .append(']')
-        .append(" Upper Right: [")
-        .append(maxLon)
-        .append(',')
-        .append(maxLat)
-        .append("]")
-        .toString();
-  }
-
-  public double getMinRadiusMeters() {
-    return this.minRadiusMeters;
-  }
-
-  public double getMaxRadiusMeters() {
-    return this.radiusMeters;
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQuery.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQuery.java b/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQuery.java
deleted file mode 100644
index 0926a4f..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQuery.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * 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.apache.lucene.search;
-
-import org.apache.lucene.index.IndexReader;
-import org.apache.lucene.util.GeoUtils;
-
-/** Implements a simple bounding box query on a GeoPoint field. This is inspired by
- * {@link LegacyNumericRangeQuery} and is implemented using a
- * two phase approach. First, candidate terms are queried using a numeric
- * range based on the morton codes of the min and max lat/lon pairs. Terms
- * passing this initial filter are passed to a final check that verifies whether
- * the decoded lat/lon falls within (or on the boundary) of the query bounding box.
- * The value comparisons are subject to a precision tolerance defined in
- * {@value org.apache.lucene.util.GeoUtils#TOLERANCE}
- *
- * NOTES:
- *    1.  All latitude/longitude values must be in decimal degrees.
- *    2.  Complex computational geometry (e.g., dateline wrapping) is not supported
- *    3.  For more advanced GeoSpatial indexing and query operations see spatial module
- *    4.  This is well suited for small rectangles, large bounding boxes may result
- *        in many terms, depending whether the bounding box falls on the boundary of
- *        many cells (degenerate case)
- *
- * @lucene.experimental
- */
-public class GeoPointInBBoxQuery extends Query {
-  protected final String field;
-  protected final double minLon;
-  protected final double minLat;
-  protected final double maxLon;
-  protected final double maxLat;
-
-  public GeoPointInBBoxQuery(final String field, final double minLon, final double minLat, final double maxLon, final double maxLat) {
-    this.field = field;
-    this.minLon = minLon;
-    this.minLat = minLat;
-    this.maxLon = maxLon;
-    this.maxLat = maxLat;
-  }
-
-  @Override
-  public Query rewrite(IndexReader reader) {
-    // short-circuit to match all if specifying the whole map
-    if (minLon == GeoUtils.MIN_LON_INCL && maxLon == GeoUtils.MAX_LON_INCL
-        && minLat == GeoUtils.MIN_LAT_INCL && maxLat == GeoUtils.MAX_LAT_INCL) {
-      // FieldValueQuery is valid since DocValues are *required* for GeoPointField
-      return new FieldValueQuery(field);
-    }
-
-    if (maxLon < minLon) {
-      BooleanQuery.Builder bqb = new BooleanQuery.Builder();
-
-      GeoPointInBBoxQueryImpl left = new GeoPointInBBoxQueryImpl(field, -180.0D, minLat, maxLon, maxLat);
-      bqb.add(new BooleanClause(left, BooleanClause.Occur.SHOULD));
-      GeoPointInBBoxQueryImpl right = new GeoPointInBBoxQueryImpl(field, minLon, minLat, 180.0D, maxLat);
-      bqb.add(new BooleanClause(right, BooleanClause.Occur.SHOULD));
-      return bqb.build();
-    }
-    return new GeoPointInBBoxQueryImpl(field, minLon, minLat, maxLon, maxLat);
-  }
-
-  @Override
-  public String toString(String field) {
-    final StringBuilder sb = new StringBuilder();
-    sb.append(getClass().getSimpleName());
-    sb.append(':');
-    if (!this.field.equals(field)) {
-      sb.append(" field=");
-      sb.append(this.field);
-      sb.append(':');
-    }
-    return sb.append(" Lower Left: [")
-        .append(minLon)
-        .append(',')
-        .append(minLat)
-        .append(']')
-        .append(" Upper Right: [")
-        .append(maxLon)
-        .append(',')
-        .append(maxLat)
-        .append("]")
-        .toString();
-  }
-
-  @Override
-  public boolean equals(Object o) {
-    if (this == o) return true;
-    if (!(o instanceof GeoPointInBBoxQuery)) return false;
-    if (!super.equals(o)) return false;
-
-    GeoPointInBBoxQuery that = (GeoPointInBBoxQuery) o;
-
-    if (Double.compare(that.maxLat, maxLat) != 0) return false;
-    if (Double.compare(that.maxLon, maxLon) != 0) return false;
-    if (Double.compare(that.minLat, minLat) != 0) return false;
-    if (Double.compare(that.minLon, minLon) != 0) return false;
-    if (!field.equals(that.field)) return false;
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int result = super.hashCode();
-    long temp;
-    result = 31 * result + field.hashCode();
-    temp = Double.doubleToLongBits(minLon);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(minLat);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(maxLon);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(maxLat);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    return result;
-  }
-
-  public final String getField() {
-    return this.field;
-  }
-
-  public final double getMinLon() {
-    return this.minLon;
-  }
-
-  public final double getMinLat() {
-    return this.minLat;
-  }
-
-  public final double getMaxLon() {
-    return this.maxLon;
-  }
-
-  public final double getMaxLat() {
-    return this.maxLat;
-  }
-}

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/50a2f754/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQueryImpl.java
----------------------------------------------------------------------
diff --git a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQueryImpl.java b/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQueryImpl.java
deleted file mode 100644
index b385a54..0000000
--- a/lucene/sandbox/src/java/org/apache/lucene/search/GeoPointInBBoxQueryImpl.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.apache.lucene.search;
-
-import java.io.IOException;
-
-import org.apache.lucene.document.GeoPointField;
-import org.apache.lucene.index.Terms;
-import org.apache.lucene.index.TermsEnum;
-import org.apache.lucene.util.AttributeSource;
-import org.apache.lucene.util.GeoRelationUtils;
-import org.apache.lucene.util.SloppyMath;
-
-/** Package private implementation for the public facing GeoPointInBBoxQuery delegate class.
- *
- *    @lucene.experimental
- */
-class GeoPointInBBoxQueryImpl extends GeoPointTermQuery {
-  /**
-   * Constructs a new GeoBBoxQuery that will match encoded GeoPoint terms that fall within or on the boundary
-   * of the bounding box defined by the input parameters
-   * @param field the field name
-   * @param minLon lower longitude (x) value of the bounding box
-   * @param minLat lower latitude (y) value of the bounding box
-   * @param maxLon upper longitude (x) value of the bounding box
-   * @param maxLat upper latitude (y) value of the bounding box
-   */
-  GeoPointInBBoxQueryImpl(final String field, final double minLon, final double minLat, final double maxLon, final double maxLat) {
-    super(field, minLon, minLat, maxLon, maxLat);
-  }
-
-  @Override @SuppressWarnings("unchecked")
-  protected TermsEnum getTermsEnum(final Terms terms, AttributeSource atts) throws IOException {
-    return new GeoPointInBBoxTermsEnum(terms.iterator(), minLon, minLat, maxLon, maxLat);
-  }
-
-  @Override
-  public void setRewriteMethod(RewriteMethod method) {
-    throw new UnsupportedOperationException("cannot change rewrite method");
-  }
-
-  protected class GeoPointInBBoxTermsEnum extends GeoPointTermsEnum {
-    protected GeoPointInBBoxTermsEnum(final TermsEnum tenum, final double minLon, final double minLat,
-                            final double maxLon, final double maxLat) {
-      super(tenum, minLon, minLat, maxLon, maxLat);
-    }
-
-    @Override
-    protected short computeMaxShift() {
-      final short shiftFactor;
-
-      // compute diagonal radius
-      double midLon = (minLon + maxLon) * 0.5;
-      double midLat = (minLat + maxLat) * 0.5;
-
-      if (SloppyMath.haversin(minLat, minLon, midLat, midLon)*1000 > 1000000) {
-        shiftFactor = 5;
-      } else {
-        shiftFactor = 4;
-      }
-
-      return (short)(GeoPointField.PRECISION_STEP * shiftFactor);
-    }
-
-    /**
-     * Determine whether the quad-cell crosses the shape
-     */
-    @Override
-    protected boolean cellCrosses(final double minLon, final double minLat, final double maxLon, final double maxLat) {
-      return GeoRelationUtils.rectCrosses(minLon, minLat, maxLon, maxLat, this.minLon, this.minLat, this.maxLon, this.maxLat);
-    }
-
-    /**
-     * Determine whether quad-cell is within the shape
-     */
-    @Override
-    protected boolean cellWithin(final double minLon, final double minLat, final double maxLon, final double maxLat) {
-      return GeoRelationUtils.rectWithin(minLon, minLat, maxLon, maxLat, this.minLon, this.minLat, this.maxLon, this.maxLat);
-    }
-
-    @Override
-    protected boolean cellIntersectsShape(final double minLon, final double minLat, final double maxLon, final double maxLat) {
-      return cellIntersectsMBR(minLon, minLat, maxLon, maxLat);
-    }
-
-    @Override
-    protected boolean postFilter(final double lon, final double lat) {
-      return GeoRelationUtils.pointInRectPrecise(lon, lat, minLon, minLat, maxLon, maxLat);
-    }
-  }
-
-  @Override
-  @SuppressWarnings({"unchecked","rawtypes"})
-  public boolean equals(Object o) {
-    if (this == o) return true;
-    if (o == null || getClass() != o.getClass()) return false;
-    if (!super.equals(o)) return false;
-
-    GeoPointInBBoxQueryImpl that = (GeoPointInBBoxQueryImpl) o;
-
-    if (Double.compare(that.maxLat, maxLat) != 0) return false;
-    if (Double.compare(that.maxLon, maxLon) != 0) return false;
-    if (Double.compare(that.minLat, minLat) != 0) return false;
-    if (Double.compare(that.minLon, minLon) != 0) return false;
-
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int result = super.hashCode();
-    long temp;
-    temp = Double.doubleToLongBits(minLon);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(minLat);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(maxLon);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    temp = Double.doubleToLongBits(maxLat);
-    result = 31 * result + (int) (temp ^ (temp >>> 32));
-    return result;
-  }
-
-  @Override
-  public String toString(String field) {
-    final StringBuilder sb = new StringBuilder();
-    sb.append(getClass().getSimpleName());
-    sb.append(':');
-    if (!getField().equals(field)) {
-      sb.append(" field=");
-      sb.append(getField());
-      sb.append(':');
-    }
-    return sb.append(" Lower Left: [")
-        .append(minLon)
-        .append(',')
-        .append(minLat)
-        .append(']')
-        .append(" Upper Right: [")
-        .append(maxLon)
-        .append(',')
-        .append(maxLat)
-        .append("]")
-        .toString();
-  }
-}