You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2014/01/29 12:14:56 UTC

svn commit: r1562403 [2/7] - in /lucene/dev/branches/lucene5376: ./ dev-tools/ dev-tools/idea/lucene/suggest/ dev-tools/idea/solr/core/src/java/ lucene/ lucene/analysis/ lucene/analysis/common/ lucene/analysis/common/src/java/org/apache/lucene/analysis...

Modified: lucene/dev/branches/lucene5376/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java (original)
+++ lucene/dev/branches/lucene5376/lucene/highlighter/src/java/org/apache/lucene/search/postingshighlight/PostingsHighlighter.java Wed Jan 29 11:14:53 2014
@@ -30,6 +30,7 @@ import java.util.PriorityQueue;
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.index.AtomicReader;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.lucene.index.DocsAndPositionsEnum;
@@ -50,6 +51,7 @@ import org.apache.lucene.search.TopDocs;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.InPlaceMergeSorter;
 import org.apache.lucene.util.UnicodeUtil;
+import org.apache.lucene.util.automaton.CharacterRunAutomaton;
 
 /**
  * Simple highlighter that does not analyze fields nor use
@@ -64,6 +66,14 @@ import org.apache.lucene.util.UnicodeUti
  * into a {@link Passage}, and then scores each Passage using a separate {@link PassageScorer}. 
  * Passages are finally formatted into highlighted snippets with a {@link PassageFormatter}.
  * <p>
+ * You can customize the behavior by subclassing this highlighter, some important hooks:
+ * <ul>
+ *   <li>{@link #getBreakIterator(String)}: Customize how the text is divided into passages.
+ *   <li>{@link #getScorer(String)}: Customize how passages are ranked.
+ *   <li>{@link #getFormatter(String)}: Customize how snippets are formatted.
+ *   <li>{@link #getIndexAnalyzer(String)}: Enable highlighting of MultiTermQuerys such as {@code WildcardQuery}.
+ * </ul>
+ * <p>
  * <b>WARNING</b>: The code is very new and probably still has some exciting bugs!
  * <p>
  * Example usage:
@@ -335,9 +345,9 @@ public class PostingsHighlighter {
       throw new IllegalArgumentException("invalid number of maxPassagesIn");
     }
     final IndexReader reader = searcher.getIndexReader();
-    query = rewrite(query);
+    Query rewritten = rewrite(query);
     SortedSet<Term> queryTerms = new TreeSet<Term>();
-    query.extractTerms(queryTerms);
+    rewritten.extractTerms(queryTerms);
 
     IndexReaderContext readerContext = reader.getContext();
     List<AtomicReaderContext> leaves = readerContext.leaves();
@@ -389,7 +399,7 @@ public class PostingsHighlighter {
       for(Term term : fieldTerms) {
         terms[termUpto++] = term.bytes();
       }
-      Map<Integer,Object> fieldHighlights = highlightField(field, contents[i], getBreakIterator(field), terms, docids, leaves, numPassages);
+      Map<Integer,Object> fieldHighlights = highlightField(field, contents[i], getBreakIterator(field), terms, docids, leaves, numPassages, query);
         
       Object[] result = new Object[docids.length];
       for (int j = 0; j < docidsIn.length; j++) {
@@ -432,8 +442,18 @@ public class PostingsHighlighter {
   protected char getMultiValuedSeparator(String field) {
     return ' ';
   }
+  
+  /** 
+   * Returns the analyzer originally used to index the content for {@code field}.
+   * <p>
+   * This is used to highlight some MultiTermQueries.
+   * @return Analyzer or null (the default, meaning no special multi-term processing)
+   */
+  protected Analyzer getIndexAnalyzer(String field) {
+    return null;
+  }
     
-  private Map<Integer,Object> highlightField(String field, String contents[], BreakIterator bi, BytesRef terms[], int[] docids, List<AtomicReaderContext> leaves, int maxPassages) throws IOException {  
+  private Map<Integer,Object> highlightField(String field, String contents[], BreakIterator bi, BytesRef terms[], int[] docids, List<AtomicReaderContext> leaves, int maxPassages, Query query) throws IOException {  
     Map<Integer,Object> highlights = new HashMap<Integer,Object>();
     
     // reuse in the real sense... for docs in same segment we just advance our old enum
@@ -445,6 +465,21 @@ public class PostingsHighlighter {
     if (fieldFormatter == null) {
       throw new NullPointerException("PassageFormatter cannot be null");
     }
+    
+    // check if we should do any multitermprocessing
+    Analyzer analyzer = getIndexAnalyzer(field);
+    CharacterRunAutomaton automata[] = new CharacterRunAutomaton[0];
+    if (analyzer != null) {
+      automata = MultiTermHighlighting.extractAutomata(query, field);
+    }
+    
+    final BytesRef allTerms[];
+    if (automata.length > 0) {
+      allTerms = new BytesRef[terms.length + 1];
+      System.arraycopy(terms, 0, allTerms, 0, terms.length);
+    } else {
+      allTerms = terms;
+    }
 
     for (int i = 0; i < docids.length; i++) {
       String content = contents[i];
@@ -462,9 +497,14 @@ public class PostingsHighlighter {
       }
       if (leaf != lastLeaf) {
         termsEnum = t.iterator(null);
-        postings = new DocsAndPositionsEnum[terms.length];
+        postings = new DocsAndPositionsEnum[allTerms.length];
+      }
+      if (automata.length > 0) {
+        DocsAndPositionsEnum dp = MultiTermHighlighting.getDocsEnum(analyzer.tokenStream(field, content), automata);
+        dp.advance(doc - subContext.docBase);
+        postings[terms.length] = dp;
       }
-      Passage passages[] = highlightDoc(field, terms, content.length(), bi, doc - subContext.docBase, termsEnum, postings, maxPassages);
+      Passage passages[] = highlightDoc(field, allTerms, content.length(), bi, doc - subContext.docBase, termsEnum, postings, maxPassages);
       if (passages.length == 0) {
         passages = getEmptyHighlight(field, bi, maxPassages);
       }
@@ -593,7 +633,13 @@ public class PostingsHighlighter {
       int tf = 0;
       while (true) {
         tf++;
-        current.addMatch(start, end, terms[off.id]);
+        BytesRef term = terms[off.id];
+        if (term == null) {
+          // multitermquery match, pull from payload
+          term = off.dp.getPayload();
+          assert term != null;
+        }
+        current.addMatch(start, end, term);
         if (off.pos == dp.freq()) {
           break; // removed from pq
         } else {

Modified: lucene/dev/branches/lucene5376/lucene/ivy-versions.properties
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/ivy-versions.properties?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/ivy-versions.properties (original)
+++ lucene/dev/branches/lucene5376/lucene/ivy-versions.properties Wed Jan 29 11:14:53 2014
@@ -37,7 +37,7 @@ com.google.inject.guice.version = 3.0
 /com.googlecode.juniversalchardet/juniversalchardet = 1.0.3
 /com.googlecode.mp4parser/isoparser = 1.0-RC-1
 /com.ibm.icu/icu4j = 52.1
-/com.spatial4j/spatial4j = 0.3
+/com.spatial4j/spatial4j = 0.4
 
 com.sun.jersey.version = 1.8
 /com.sun.jersey.contribs/jersey-guice = ${com.sun.jersey.version}

Modified: lucene/dev/branches/lucene5376/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java (original)
+++ lucene/dev/branches/lucene5376/lucene/join/src/java/org/apache/lucene/search/join/ToParentBlockJoinQuery.java Wed Jan 29 11:14:53 2014
@@ -453,7 +453,7 @@ public class ToParentBlockJoinQuery exte
   public Query rewrite(IndexReader reader) throws IOException {
     final Query childRewrite = childQuery.rewrite(reader);
     if (childRewrite != childQuery) {
-      Query rewritten = new ToParentBlockJoinQuery(childQuery,
+      Query rewritten = new ToParentBlockJoinQuery(origChildQuery,
                                 childRewrite,
                                 parentsFilter,
                                 scoreMode);

Modified: lucene/dev/branches/lucene5376/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java (original)
+++ lucene/dev/branches/lucene5376/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java Wed Jan 29 11:14:53 2014
@@ -201,7 +201,7 @@ public class TestBlockJoin extends Lucen
     childDoc = s.doc(hits.scoreDocs[0].doc);
     //System.out.println("CHILD = " + childDoc + " docID=" + hits.scoreDocs[0].doc);
     assertEquals("java", childDoc.get("skill"));
-    assertEquals(2007, (childDoc.getField("year")).numericValue());
+    assertEquals(2007, childDoc.getField("year").numericValue());
     assertEquals("Lisa", getParentDoc(r, parentsFilter, hits.scoreDocs[0].doc).get("name"));
 
     // Test with filter on child docs:
@@ -213,6 +213,54 @@ public class TestBlockJoin extends Lucen
     dir.close();
   }
 
+  public void testBugCausedByRewritingTwice() throws IOException {
+    final Directory dir = newDirectory();
+    final RandomIndexWriter w = new RandomIndexWriter(random(), dir);
+
+    final List<Document> docs = new ArrayList<Document>();
+
+    for (int i=0;i<10;i++) {
+      docs.clear();
+      docs.add(makeJob("ruby", i));
+      docs.add(makeJob("java", 2007));
+      docs.add(makeResume("Frank", "United States"));
+      w.addDocuments(docs);
+    }
+
+    IndexReader r = w.getReader();
+    w.close();
+    IndexSearcher s = newSearcher(r);
+
+    MultiTermQuery qc = NumericRangeQuery.newIntRange("year", 2007, 2007, true, true);
+    // Hacky: this causes the query to need 2 rewrite
+    // iterations: 
+    qc.setRewriteMethod(MultiTermQuery.CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE);
+
+    Filter parentsFilter = new FixedBitSetCachingWrapperFilter(new QueryWrapperFilter(new TermQuery(new Term("docType", "resume"))));
+
+    int h1 = qc.hashCode();
+    Query qw1 = qc.rewrite(r);
+    int h2 = qw1.hashCode();
+    Query qw2 = qw1.rewrite(r);
+    int h3 = qw2.hashCode();
+
+    assertTrue(h1 != h2);
+    assertTrue(h2 != h3);
+    assertTrue(h3 != h1);
+
+    ToParentBlockJoinQuery qp = new ToParentBlockJoinQuery(qc, parentsFilter, ScoreMode.Max);
+    ToParentBlockJoinCollector c = new ToParentBlockJoinCollector(Sort.RELEVANCE, 10, true, true);
+
+    s.search(qp, c);
+    TopGroups<Integer> groups = c.getTopGroups(qp, Sort.INDEXORDER, 0, 10, 0, true);
+    for (GroupDocs<Integer> group : groups.groups) {
+      assertEquals(1, group.totalHits);
+    }
+
+    r.close();
+    dir.close();
+  }
+
   protected QueryWrapperFilter skill(String skill) {
     return new QueryWrapperFilter(new TermQuery(new Term("skill", skill)));
   }

Modified: lucene/dev/branches/lucene5376/lucene/licenses/spatial4j-NOTICE.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/licenses/spatial4j-NOTICE.txt?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/licenses/spatial4j-NOTICE.txt (original)
+++ lucene/dev/branches/lucene5376/lucene/licenses/spatial4j-NOTICE.txt Wed Jan 29 11:14:53 2014
@@ -1,5 +1,5 @@
-Apache Commons Lang
-Copyright 2001-2008 The Apache Software Foundation
+Spatial4j
+Copyright 2012-2014 The Apache Software Foundation
 
 This product includes software developed by
 The Apache Software Foundation (http://www.apache.org/).

Modified: lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java (original)
+++ lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNode.java Wed Jan 29 11:14:53 2014
@@ -91,4 +91,8 @@ public interface QueryNode {
    */
   public Map<String, Object> getTagMap();
 
+  /**
+   * Removes this query node from its parent.
+   */
+  public void removeFromParent();
 }

Modified: lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java (original)
+++ lucene/dev/branches/lucene5376/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/QueryNodeImpl.java Wed Jan 29 11:14:53 2014
@@ -19,6 +19,7 @@ package org.apache.lucene.queryparser.fl
 
 import java.util.ArrayList;
 import java.util.Hashtable;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -102,18 +103,19 @@ public abstract class QueryNodeImpl impl
 
     // reset parent value
     for (QueryNode child : children) {
-
-      ((QueryNodeImpl) child).setParent(null);
-
+      child.removeFromParent();
     }
-
+    
+    ArrayList<QueryNode> existingChildren = new ArrayList<QueryNode>(getChildren());
+    for (QueryNode existingChild : existingChildren) {
+      existingChild.removeFromParent();
+    }
+    
     // allocate new children list
     allocate();
-
+    
     // add new children and set parent
-    for (QueryNode child : children) {
-      add(child);
-    }
+    add(children);
   }
 
   @Override
@@ -154,7 +156,7 @@ public abstract class QueryNodeImpl impl
     if (isLeaf() || this.clauses == null) {
       return null;
     }
-    return this.clauses;
+    return new ArrayList<QueryNode>(this.clauses);
   }
 
   @Override
@@ -181,7 +183,10 @@ public abstract class QueryNodeImpl impl
   private QueryNode parent = null;
 
   private void setParent(QueryNode parent) {
-    this.parent = parent;
+    if (this.parent != parent) {
+      this.removeFromParent();
+      this.parent = parent;
+    }
   }
 
   @Override
@@ -241,5 +246,21 @@ public abstract class QueryNodeImpl impl
   public Map<String, Object> getTagMap() {
     return (Map<String, Object>) this.tags.clone();
   }
+  
+  @Override
+  public void removeFromParent() {
+    if (this.parent != null) {
+      List<QueryNode> parentChildren = this.parent.getChildren();
+      Iterator<QueryNode> it = parentChildren.iterator();
+      
+      while (it.hasNext()) {
+        if (it.next() == this) {
+          it.remove();
+        }
+      }
+      
+      this.parent = null;
+    }
+  }
 
 } // end class QueryNodeImpl

Modified: lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java (original)
+++ lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/flexible/core/nodes/TestQueryNode.java Wed Jan 29 11:14:53 2014
@@ -18,6 +18,7 @@ package org.apache.lucene.queryparser.fl
  */
 
 import java.util.Arrays;
+import java.util.Collections;
 
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -44,4 +45,23 @@ public class TestQueryNode extends Lucen
     
   }
   
+  /* LUCENE-5099 - QueryNodeProcessorImpl should set parent to null before returning on processing */
+  public void testRemoveFromParent() throws Exception {
+    BooleanQueryNode booleanNode = new BooleanQueryNode(Collections.<QueryNode>emptyList());
+    FieldQueryNode fieldNode = new FieldQueryNode("foo", "A", 0, 1);
+    assertNull(fieldNode.getParent());
+    
+    booleanNode.add(fieldNode);
+    assertNotNull(fieldNode.getParent());
+
+    fieldNode.removeFromParent();
+    assertNull(fieldNode.getParent());
+
+    booleanNode.add(fieldNode);
+    assertNotNull(fieldNode.getParent());
+    
+    booleanNode.set(Collections.<QueryNode>emptyList());
+    assertNull(fieldNode.getParent());
+  }
+  
 }

Modified: lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java (original)
+++ lucene/dev/branches/lucene5376/lucene/queryparser/src/test/org/apache/lucene/queryparser/util/QueryParserTestBase.java Wed Jan 29 11:14:53 2014
@@ -18,7 +18,6 @@ package org.apache.lucene.queryparser.ut
  */
 
 import java.io.IOException;
-import java.io.Reader;
 import java.text.DateFormat;
 import java.util.Calendar;
 import java.util.Date;
@@ -1066,6 +1065,7 @@ public abstract class QueryParserTestBas
     assertTrue(bq.getClauses()[1].getQuery() instanceof MatchAllDocsQuery);
   }
   
+  @SuppressWarnings("unused")
   private void assertHits(int expected, String query, IndexSearcher is) throws Exception {
     String oldDefaultField = getDefaultField();
     setDefaultField("date");

Modified: lucene/dev/branches/lucene5376/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialArgsParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialArgsParser.java?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialArgsParser.java (original)
+++ lucene/dev/branches/lucene5376/lucene/spatial/src/java/org/apache/lucene/spatial/query/SpatialArgsParser.java Wed Jan 29 11:14:53 2014
@@ -19,9 +19,9 @@ package org.apache.lucene.spatial.query;
 
 import com.spatial4j.core.context.SpatialContext;
 import com.spatial4j.core.exception.InvalidShapeException;
-import com.spatial4j.core.io.ShapeReadWriter;
 import com.spatial4j.core.shape.Shape;
 
+import java.text.ParseException;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
@@ -30,11 +30,11 @@ import java.util.StringTokenizer;
 /**
  * Parses a string that usually looks like "OPERATION(SHAPE)" into a {@link SpatialArgs}
  * object. The set of operations supported are defined in {@link SpatialOperation}, such
- * as "Intersects" being a common one. The shape portion is defined by {@link
- * ShapeReadWriter#readShape(String)}. There are some optional name-value pair parameters
- * that follow the closing parenthesis.  Example:
+ * as "Intersects" being a common one. The shape portion is defined by WKT {@link com.spatial4j.core.io.WktShapeParser},
+ * but it can be overridden/customized via {@link #parseShape(String, com.spatial4j.core.context.SpatialContext)}.
+ * There are some optional name-value pair parameters that follow the closing parenthesis.  Example:
  * <pre>
- *   Intersects(-10,20,-8,22) distErrPct=0.025
+ *   Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
  * </pre>
  * <p/>
  * In the future it would be good to support something at least semi-standardized like a
@@ -63,40 +63,40 @@ public class SpatialArgsParser {
   }
 
   /**
-   * Parses a string such as "Intersects(-10,20,-8,22) distErrPct=0.025".
+   * Parses a string such as "Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025".
    *
    * @param v   The string to parse. Mandatory.
    * @param ctx The spatial context. Mandatory.
    * @return Not null.
-   * @throws IllegalArgumentException If there is a problem parsing the string.
-   * @throws InvalidShapeException  Thrown from {@link ShapeReadWriter#readShape(String)}
+   * @throws IllegalArgumentException if the parameters don't make sense or an add-on parameter is unknown
+   * @throws ParseException If there is a problem parsing the string
+   * @throws InvalidShapeException When the coordinates are invalid for the shape
    */
-  public SpatialArgs parse(String v, SpatialContext ctx) throws IllegalArgumentException, InvalidShapeException {
+  public SpatialArgs parse(String v, SpatialContext ctx) throws ParseException, InvalidShapeException {
     int idx = v.indexOf('(');
     int edx = v.lastIndexOf(')');
 
     if (idx < 0 || idx > edx) {
-      throw new IllegalArgumentException("missing parens: " + v, null);
+      throw new ParseException("missing parens: " + v, -1);
     }
 
     SpatialOperation op = SpatialOperation.get(v.substring(0, idx).trim());
 
     String body = v.substring(idx + 1, edx).trim();
     if (body.length() < 1) {
-      throw new IllegalArgumentException("missing body : " + v, null);
+      throw new ParseException("missing body : " + v, idx + 1);
     }
 
-    Shape shape = ctx.readShape(body);
-    SpatialArgs args = new SpatialArgs(op, shape);
+    Shape shape = parseShape(body, ctx);
+    SpatialArgs args = newSpatialArgs(op, shape);
 
     if (v.length() > (edx + 1)) {
       body = v.substring(edx + 1).trim();
       if (body.length() > 0) {
         Map<String, String> aa = parseMap(body);
-        args.setDistErrPct(readDouble(aa.remove(DIST_ERR_PCT)));
-        args.setDistErr(readDouble(aa.remove(DIST_ERR)));
+        readNameValuePairs(args, aa);
         if (!aa.isEmpty()) {
-          throw new IllegalArgumentException("unused parameters: " + aa, null);
+          throw new IllegalArgumentException("unused parameters: " + aa);
         }
       }
     }
@@ -104,6 +104,20 @@ public class SpatialArgsParser {
     return args;
   }
 
+  protected SpatialArgs newSpatialArgs(SpatialOperation op, Shape shape) {
+    return new SpatialArgs(op, shape);
+  }
+
+  protected void readNameValuePairs(SpatialArgs args, Map<String, String> nameValPairs) {
+    args.setDistErrPct(readDouble(nameValPairs.remove(DIST_ERR_PCT)));
+    args.setDistErr(readDouble(nameValPairs.remove(DIST_ERR)));
+  }
+
+  protected Shape parseShape(String str, SpatialContext ctx) throws ParseException {
+    //return ctx.readShape(str);//still in Spatial4j 0.4 but will be deleted
+    return ctx.readShapeFromWkt(str);
+  }
+
   protected static Double readDouble(String v) {
     return v == null ? null : Double.valueOf(v);
   }

Modified: lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/cities-Intersects-BBox.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/cities-Intersects-BBox.txt?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/cities-Intersects-BBox.txt (original)
+++ lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/cities-Intersects-BBox.txt Wed Jan 29 11:14:53 2014
@@ -1,7 +1,3 @@
-[San Francisco] G5391959 @ Intersects(-122.524918 37.674973 -122.360123 37.817108)
-[Wellington] G2179537 @ Intersects(174.711456 -41.360779 174.854279 -41.213837)
-[Barcelona] G6544100 G3128760  @  Intersects(2.127228 41.333313 2.226105 41.408844)
-
-
-
-
+[San Francisco] G5391959 @ Intersects(ENVELOPE(-122.524918, -122.360123, 37.817108, 37.674973))
+[Wellington] G2179537 @ Intersects(ENVELOPE(174.711456, 174.854279, -41.213837, -41.360779))
+[Barcelona] G6544100 G3128760  @  Intersects(ENVELOPE(2.127228, 2.226105, 41.408844, 41.333313))
\ No newline at end of file

Modified: lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/countries-bbox.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/countries-bbox.txt?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/countries-bbox.txt (original)
+++ lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/countries-bbox.txt Wed Jan 29 11:14:53 2014
@@ -1,249 +1,249 @@
 #id	name	shape	
-FLK	Falkland Is.	-61.148055 -52.343055 -57.733200 -51.249455	
-GUF	French Guiana	-54.603782 2.113473 -51.648055 5.755418	
-GUY	Guyana	-61.389727 1.186873 -56.470636 8.535273	
-PCN	Pitcairn Is.	-130.105055 -25.082227 -128.286118 -24.325836	
-SGS	South Georgia & the South Sandwich Is.	-38.023755 -58.498609 -26.241391 -53.989727	
-SHN	St. Helena	-5.792782 -16.021946 -5.645282 -15.903755	
-SUR	Suriname	-58.071400 1.836245 -53.986118 6.001809	
-TTO	Trinidad & Tobago	-61.921600 10.040345 -60.520836 11.345554	
-VEN	Venezuela	-73.378064 0.649164 -59.803055 12.197500	
-ASM	American Samoa	-170.823227 -14.375555 -170.561873 -14.254309	
-COK	Cook Is.	-165.848345 -21.940836 -157.703764 -10.881318	
-PYF	French Polynesia	-151.497773 -17.870836 -138.809755 -8.778191	
-UMI	Jarvis I.	-160.045164 -0.398055 -160.009464 -0.374309	
-NIU	Niue	-169.952236 -19.145555 -169.781555 -18.963336	
-WSM	Samoa	-172.780027 -14.057500 -171.429200 -13.460555	
-TKL	Tokelau	-171.862718 -9.218891 -171.843764 -9.170627	
-TON	Tonga	-175.360000 -21.268064 -173.906827 -18.568055	
-WLF	Wallis & Futuna	-178.190273 -14.323891 -176.121936 -13.214864	
-ARG	Argentina	-73.582300 -55.051673 -53.650009 -21.780518	
-BOL	Bolivia	-69.656191 -22.901109 -57.521118 -9.679191	
-BRA	Brazil	-74.004591 -33.741118 -34.792918 5.272709	
-CHL	Chile	-109.446109 -55.902227 -66.420627 -17.505282	
-ECU	Ecuador	-91.663891 -5.000309 -75.216846 1.437782	
-PRY	Paraguay	-62.643773 -27.584727 -54.243900 -19.296809	
-PER	Peru	-81.355146 -18.348546 -68.673909 -0.036873	
-URY	Uruguay	-58.438609 -34.943818 -53.098300 -30.096673	
-UMI	Baker I.	-176.467655 0.215282 -176.455855 0.222573	
-CAN	Canada	-141.002991 41.675554 -52.617364 83.113873	
-GTM	Guatemala	-92.246782 13.745836 -88.214736 17.821109	
-UMI	Howland I.	-176.643082 0.790282 -176.631091 0.808609	
-UMI	Johnston Atoll	-169.538936 16.724164 -169.523927 16.730273	
-MEX	Mexico	-118.404164 14.550545 -86.738618 32.718454	
-UMI	Midway Is.	-177.395845 28.184154 -177.360545 28.221518	
-BRB	Barbados	-59.659446 13.050554 -59.427082 13.337082	
-DMA	Dominica	-61.491391 15.198054 -61.250700 15.631945	
-GRD	Grenada	-61.785182 11.996945 -61.596391 12.237154	
-GLP	Guadeloupe	-61.796109 15.870000 -61.187082 16.512918	
-MTQ	Martinique	-61.231536 14.402773 -60.816946 14.880136	
-LCA	St. Lucia	-61.079582 13.709445 -60.878064 14.109309	
-SPM	St. Pierre & Miquelon	-56.397782 46.747191 -56.145500 47.135827	
-VCT	St. Vincent & the Grenadines	-61.280146 13.130282 -61.120282 13.383191	
-ABW	Aruba	-70.059664 12.411109 -69.874864 12.627773	
-BMU	Bermuda	-64.823064 32.260554 -64.676809 32.379509	
-DOM	Dominican Republic	-72.003064 17.604164 -68.322927 19.930827	
-HTI	Haiti	-74.467791 18.022782 -71.629182 20.091454	
-JAM	Jamaica	-78.373900 17.697218 -76.221118 18.522500	
-ANT	Netherlands Antilles	-69.163618 12.020554 -68.192927 12.383891	
-BHS	The Bahamas	-78.978900 20.915273 -72.738891 26.929164	
-TCA	Turks & Caicos Is.	-72.031464 21.429918 -71.127573 21.957773	
-BLZ	Belize	-89.216400 15.889854 -87.779591 18.489900	
-CYM	Cayman Is.	-81.400836 19.265000 -81.093064 19.354164	
-COL	Colombia	-81.720146 -4.236873 -66.870455 12.590273	
-CRI	Costa Rica	-85.911391 8.025673 -82.561400 11.212845	
-CUB	Cuba	-84.952927 19.821945 -74.131255 23.194027	
-SLV	El Salvador	-90.108064 13.156391 -87.694673 14.431982	
-HND	Honduras	-89.350491 12.985173 -83.131855 16.435827	
-NIC	Nicaragua	-87.689827 10.709691 -83.131855 15.022218	
-PAN	Panama	-83.030291 7.206109 -77.198336 9.620136	
-AIA	Anguilla	-63.167782 18.164445 -62.972709 18.272982	
-ATG	Antigua & Barbuda	-61.891109 16.989718 -61.666946 17.724300	
-VGB	British Virgin Is.	-64.698482 18.383891 -64.324527 18.504854	
-MSR	Montserrat	-62.236946 16.671391 -62.138891 16.812354	
-PRI	Puerto Rico	-67.266400 17.922218 -65.301118 18.519445	
-KNA	St. Kitts & Nevis	-62.862782 17.208882 -62.622509 17.410136	
-VIR	Virgin Is.	-65.023509 17.676664 -64.562573 18.387673	
-FRO	Faroe Is.	-7.433473 61.388327 -6.389718 62.357500	
-GRL	Greenland	-73.053609 59.790273 -12.157637 83.623600	
-XGK	Guernsey	-2.668609 49.422491 -2.500973 49.508191	
-ISL	Iceland	-24.538400 63.390000 -13.499446 66.536100	
-IRL	Ireland	-10.474727 51.445545 -6.013055 55.379991	
-XIM	Isle of Man	-4.787155 54.055545 -4.308682 54.416382	
-SJM	Jan Mayen	-9.119909 70.803863 -7.928509 71.180818	
-XJE	Jersey	-2.247364 49.167773 -2.015000 49.261109	
-GBR	United Kingdom	-8.171664 49.955273 1.749445 60.843327	
-CPV	Cape Verde	-25.360555 14.811109 -22.666109 17.192364	
-CIV	Cote d'Ivoire	-8.606382 4.344718 -2.487782 10.735254	
-GHA	Ghana	-3.248891 4.727082 1.202782 11.155691	
-GIB	Gibraltar	-5.356173 36.112073 -5.334509 36.163309	
-LBR	Liberia	-11.492327 4.343609 -7.368400 8.512782	
-MAR	Morocco	-13.174964 27.664236 -1.011809 35.919164	
-PRT	Portugal	-31.289027 32.637500 -6.190455 42.150673	
-ESP	Spain	-18.169864 27.637500 4.316945 43.764300	
-ESH	Western Sahara	-17.101527 20.764100 -8.666391 27.666954	
-BFA	Burkina Faso	-5.520837 9.395691 2.397927 15.082773	
-GIN	Guinea	-15.080837 7.193927 -7.653373 12.677500	
-GNB	Guinea-Bissau	-16.717773 10.925100 -13.643891 12.684718	
-MLI	Mali	-12.244837 10.142154 4.251391 25.000273	
-MRT	Mauritania	-17.075555 14.725636 -4.806109 27.290454	
-SEN	Senegal	-17.532782 12.301745 -11.369927 16.690618	
-SLE	Sierra Leone	-13.295609 6.923609 -10.264309 9.997500	
-GMB	The Gambia	-16.821664 13.059973 -13.798609 13.826391	
-DJI	Djibouti	41.759854 10.942218 43.420409 12.708327	
-ERI	Eritrea	36.443282 12.363891 43.121382 17.994882	
-ETH	Ethiopia	32.991800 3.406664 47.988245 14.883609	
-MNG	Mongolia	87.761100 41.586654 119.931509 52.142773	
-SDN	Sudan	21.829100 3.493391 38.607500 22.232218	
-UGA	Uganda	29.574300 -1.476109 35.009718 4.222782	
-ISR	Gaza Strip	34.216663 31.216545 34.558891 31.596100	
-IRQ	Iraq	38.794700 29.061664 48.560691 37.383673	
-ISR	Israel	34.267582 29.486709 35.681109 33.270273	
-JOR	Jordan	34.960418 29.188891 39.301109 33.377591	
-KAZ	Kazakhstan	46.499163 40.594436 87.348209 55.442627	
-NOR	Norway	4.789582 57.987918 31.073536 71.154709	
-RUS	Russia	-180.000000 41.196582 180.000000 81.851927	
-SWE	Sweden	11.113336 55.339164 24.167009 69.060300	
-ISR	West Bank	34.888191 31.350691 35.570609 32.546391	
-DZA	Algeria	-8.667218 18.976391 11.986473 37.089854	
-AND	Andorra	1.421391 42.436382 1.781718 42.655964	
-CMR	Cameroon	8.502363 1.654164 16.207000 13.085000	
-CAF	Central African Republic	14.418891 2.221264 27.459718 11.000836	
-LBY	Libya	9.311391 19.499064 25.151663 33.171136	
-MCO	Monaco	7.390900 43.727545 7.439291 43.768300	
-TUN	Tunisia	7.492218 30.234391 11.581663 37.340409	
-BEN	Benin	0.776663 6.218718 3.855000 12.396654	
-TCD	Chad	13.461945 7.458536 24.002745 23.450554	
-GNQ	Equatorial Guinea	8.424163 0.930154 11.353891 3.763336	
-KIR	Kiribati	-157.581700 1.335991 172.947509 2.033054	
-NER	Niger	0.166663 11.693273 15.996663 23.522309	
-NGA	Nigeria	2.692500 4.272845 14.649654 13.891500	
-STP	Sao Tome & Principe	6.465136 0.018336 7.463473 1.701245	
-TGO	Togo	-0.149764 6.100545 1.797800 11.138536	
-ALB	Albania	19.288536 39.645000 21.053327 42.660345	
-BIH	Bosnia & Herzegovina	15.740591 42.565827 19.619782 45.265945	
-HRV	Croatia	13.504791 42.399991 19.425000 46.535827	
-ITA	Italy	6.623963 36.649164 18.514445 47.094582	
-MKD	Macedonia	20.458818 40.855891 23.030973 42.358954	
-MLT	Malta	14.329100 35.800000 14.570000 35.991936	
-SMR	San Marino	12.406945 43.898682 12.511109 43.986873	
-SMN	Serbia & Montenegro	18.453327 41.849000 23.005000 46.181109	
-VTC	Vatican City	12.444473 41.900891 12.457718 41.908391	
-BGR	Bulgaria	22.365273 41.243045 28.605136 44.224718	
-CYP	Cyprus	32.269863 34.640273 34.586036 35.688609	
-EGY	Egypt	24.706800 21.994164 36.895827 31.646945	
-GEO	Georgia	40.002963 41.048045 46.710818 43.584718	
-GRC	Greece	19.640000 34.930545 28.238045 41.747773	
-LBN	Lebanon	35.100827 33.062082 36.623745 34.647500	
-SYR	Syria	35.614463 32.313609 42.378327 37.290545	
-TUR	Turkey	25.665827 35.818445 44.820545 42.109991	
-AUT	Austria	9.533573 46.407491 17.166382 49.018745	
-CZE	Czech Republic	12.093700 48.581382 18.852218 51.052491	
-DNK	Denmark	8.092918 54.561936 15.149163 57.745973	
-HUN	Hungary	16.111800 45.748327 22.894800 48.576173	
-POL	Poland	14.147636 49.002918 24.143473 54.836036	
-SVK	Slovakia	16.844718 47.737500 22.558054 49.600827	
-SVN	Slovenia	13.383473 45.425818 16.607873 46.876245	
-SJM	Svalbard	10.487918 74.343045 33.637500 80.764163	
-BEL	Belgium	2.541663 49.508882 6.398200 51.501245	
-FRA	France	-4.790282 41.364927 9.562218 51.091109	
-DEU	Germany	5.865000 47.274718 15.033818 55.056527	
-LIE	Liechtenstein	9.474636 47.057454 9.633891 47.274545	
-LUX	Luxembourg	5.734445 49.448464 6.524027 50.181809	
-NLD	Netherlands	3.370863 50.753882 7.210973 53.465827	
-CHE	Switzerland	5.967009 45.829436 10.488209 47.806664	
-USA	United States	-178.216555 18.925482 179.775936 71.351436	
-BLR	Belarus	23.165400 51.251845 32.740054 56.167491	
-EST	Estonia	21.837354 57.522636 28.194091 59.664718	
-FIN	Finland	19.511391 59.806800 31.581963 70.088609	
-LVA	Latvia	20.968609 55.674836 28.235963 58.083254	
-LTU	Lithuania	20.942836 53.890336 26.813054 56.449854	
-MDA	Moldova	26.634991 45.448645 30.128709 48.468318	
-ROM	Romania	20.261027 43.623309 29.672218 48.263882	
-UKR	Ukraine	22.151445 44.379154 40.178745 52.378600	
-IND	India	68.144227 6.745827 97.380536 35.505618	
-MDV	Maldives	72.863391 -0.641664 73.637272 7.027773	
-OMN	Oman	51.999291 16.642782 59.847082 26.368709	
-SOM	Somalia	40.988609 -1.674873 51.411318 11.979164	
-LKA	Sri Lanka	79.696091 5.918054 81.891663 9.828191	
-TKM	Turkmenistan	51.250182 35.145991 66.670882 42.796173	
-UZB	Uzbekistan	55.997491 37.184991 73.167545 45.570591	
-YEM	Yemen	42.555973 12.144718 54.473473 18.999345	
-ARM	Armenia	43.454163 38.841145 46.620536 41.297054	
-AZE	Azerbaijan	44.778863 38.262809 51.677009 42.710754	
-BHR	Bahrain	50.453327 25.571945 50.796391 26.288891	
-IRN	Iran	44.034954 25.075973 63.330273 39.779154	
-KWT	Kuwait	46.546945 28.538882 48.416591 30.084164	
-QAT	Qatar	50.751936 24.556045 51.615827 26.152500	
-SAU	Saudi Arabia	34.572145 16.377500 55.666109 32.154945	
-ARE	United Arab Emirates	51.583327 22.633327 56.381663 26.083882	
-AFG	Afghanistan	60.504163 29.406109 74.915736 38.471982	
-KGZ	Kyrgyzstan	69.249500 39.195473 80.281582 43.216900	
-NPL	Nepal	80.052200 26.368364 88.194554 30.424718	
-PAK	Pakistan	60.866300 23.688045 77.823927 37.060791	
-TJK	Tajikistan	67.364700 36.671845 75.187482 41.049254	
-BGD	Bangladesh	88.043872 20.744818 92.669345 26.626136	
-BTN	Bhutan	88.751936 26.703609 92.114218 28.325000	
-BRN	Brunei	114.095082 4.018191 115.360263 5.053054	
-CHN	China	73.620045 18.168882 134.768463 53.553745	
-JPN	Japan	123.678863 24.251391 145.812409 45.486382	
-PRK	North Korea	124.323954 37.671382 130.697418 43.006100	
-PLW	Palau	134.452482 7.305254 134.658872 7.729445	
-PHL	Philippines	116.950000 5.049164 126.598036 19.391109	
-KOR	South Korea	126.099018 33.192209 129.586872 38.625245	
-KHM	Cambodia	102.346509 10.422736 107.636382 14.708618	
-LAO	Laos	100.091372 13.926664 107.695254 22.499927	
-MYS	Malaysia	99.641936 0.852782 119.275818 7.352918	
-MMR	Myanmar	92.204991 9.839582 101.169427 28.546527	
-SGP	Singapore	103.640945 1.259027 103.997945 1.445282	
-THA	Thailand	97.347272 5.633473 105.639291 20.454582	
-VNM	Vietnam	102.140745 8.559236 109.464845 23.324164	
-GUM	Guam	144.634154 13.235000 144.953309 13.652291	
-MHL	Marshall Is.	162.324963 5.600273 171.378063 14.594027	
-FSM	Micronesia	158.120100 5.261664 163.042891 6.977636	
-MNP	Northern Mariana Is.	145.572682 14.908054 145.818082 15.268191	
-UMI	Wake I.	166.608981 19.279445 166.662200 19.324582	
-BWA	Botswana	19.996109 -26.875555 29.373618 -17.782082	
-BDI	Burundi	28.985000 -4.448055 30.853191 -2.301564	
-ATF	French Southern & Antarctic Lands	51.650836 -49.725009 70.567491 -46.327645	
-HMD	Heard I. & McDonald Is.	73.234709 -53.199445 73.773882 -52.965145	
-KEN	Kenya	33.907218 -4.669618 41.905163 4.622500	
-RWA	Rwanda	28.854445 -2.825491 30.893263 -1.054446	
-TZA	Tanzania	29.340827 -11.740418 40.436809 -0.997218	
-ZMB	Zambia	21.996391 -18.074918 33.702282 -8.191664	
-ZWE	Zimbabwe	25.237918 -22.414764 33.071591 -15.616527	
-ATA	Antarctica	-180.000000 -90.000000 180.000000 -60.503336	
-NOR	Bouvet I.	3.342363 -54.462782 3.484163 -54.383609	
-COM	Comoros	43.214027 -12.383055 44.530418 -11.366946	
-REU	Juan De Nova I.	42.723818 -17.076118 42.760900 -17.052018	
-LSO	Lesotho	27.013973 -30.650527 29.455554 -28.570691	
-MWI	Malawi	32.681873 -17.135282 35.920963 -9.376673	
-MOZ	Mozambique	30.213018 -26.860282 40.846109 -10.471109	
-ZAF	South Africa	16.483327 -46.969727 37.892218 -22.136391	
-SWZ	Swaziland	30.798336 -27.316391 32.133400 -25.728336	
-AGO	Angola	11.731245 -18.016391 24.084445 -4.388991	
-COG	Congo	11.140663 -5.015000 18.643609 3.711109	
-ZAR	Congo, DRC	12.214554 -13.458055 31.302773 5.380691	
-FJI	Fiji	-180.000000 -19.162782 180.000000 -16.153473	
-GAB	Gabon	8.700836 -3.925282 14.519582 2.317900	
-NAM	Namibia	11.716391 -28.961873 25.264427 -16.954173	
-NZL	New Zealand	-176.848755 -52.578055 178.841063 -34.414718	
-IOT	British Indian Ocean Territory	72.357900 -7.436246 72.494282 -7.233473	
-REU	Glorioso Is.	47.279091 -11.577782 47.303054 -11.554100	
-MDG	Madagascar	43.236827 -25.588336 50.501391 -11.945555	
-MUS	Mauritius	57.306309 -20.520555 63.495754 -19.673336	
-MYT	Mayotte	45.039163 -12.992500 45.293345 -12.662500	
-REU	Reunion	55.220554 -21.373891 55.853054 -20.856527	
-SYC	Seychelles	46.205691 -9.463055 55.540554 -4.551664	
-CXR	Christmas I.	105.629000 -10.510973 105.751900 -10.384082	
-CCK	Cocos Is.	96.817491 -12.199446 96.864845 -12.130418	
-IDN	Indonesia	95.210945 -10.929655 141.007018 5.913473	
-TLS	Timor Leste	124.046100 -9.463627 127.308591 -8.140000	
-AUS	Australia	112.907209 -54.753891 158.960372 -10.135691	
-NRU	Nauru	166.904418 -0.552218 166.957045 -0.493336	
-NCL	New Caledonia	163.982745 -22.673891 168.130509 -20.087918	
-NFK	Norfolk I.	167.910945 -29.081109 167.998872 -29.000555	
-PNG	Papua New Guinea	140.858854 -11.642500 155.966845 -1.355282	
-SLB	Solomon Is.	155.671300 -11.845836 166.931836 -6.605518	
-TUV	Tuvalu	176.295254 -8.561291 179.232281 -6.089446	
-VUT	Vanuatu	166.521636 -20.254173 169.893863 -13.707218	
+FLK	Falkland Is.	ENVELOPE(-61.148055, -57.733200, -51.249455, -52.343055)
+GUF	French Guiana	ENVELOPE(-54.603782, -51.648055, 5.755418, 2.113473)
+GUY	Guyana	ENVELOPE(-61.389727, -56.470636, 8.535273, 1.186873)
+PCN	Pitcairn Is.	ENVELOPE(-130.105055, -128.286118, -24.325836, -25.082227)
+SGS	South Georgia & the South Sandwich Is.	ENVELOPE(-38.023755, -26.241391, -53.989727, -58.498609)
+SHN	St. Helena	ENVELOPE(-5.792782, -5.645282, -15.903755, -16.021946)
+SUR	Suriname	ENVELOPE(-58.071400, -53.986118, 6.001809, 1.836245)
+TTO	Trinidad & Tobago	ENVELOPE(-61.921600, -60.520836, 11.345554, 10.040345)
+VEN	Venezuela	ENVELOPE(-73.378064, -59.803055, 12.197500, 0.649164)
+ASM	American Samoa	ENVELOPE(-170.823227, -170.561873, -14.254309, -14.375555)
+COK	Cook Is.	ENVELOPE(-165.848345, -157.703764, -10.881318, -21.940836)
+PYF	French Polynesia	ENVELOPE(-151.497773, -138.809755, -8.778191, -17.870836)
+UMI	Jarvis I.	ENVELOPE(-160.045164, -160.009464, -0.374309, -0.398055)
+NIU	Niue	ENVELOPE(-169.952236, -169.781555, -18.963336, -19.145555)
+WSM	Samoa	ENVELOPE(-172.780027, -171.429200, -13.460555, -14.057500)
+TKL	Tokelau	ENVELOPE(-171.862718, -171.843764, -9.170627, -9.218891)
+TON	Tonga	ENVELOPE(-175.360000, -173.906827, -18.568055, -21.268064)
+WLF	Wallis & Futuna	ENVELOPE(-178.190273, -176.121936, -13.214864, -14.323891)
+ARG	Argentina	ENVELOPE(-73.582300, -53.650009, -21.780518, -55.051673)
+BOL	Bolivia	ENVELOPE(-69.656191, -57.521118, -9.679191, -22.901109)
+BRA	Brazil	ENVELOPE(-74.004591, -34.792918, 5.272709, -33.741118)
+CHL	Chile	ENVELOPE(-109.446109, -66.420627, -17.505282, -55.902227)
+ECU	Ecuador	ENVELOPE(-91.663891, -75.216846, 1.437782, -5.000309)
+PRY	Paraguay	ENVELOPE(-62.643773, -54.243900, -19.296809, -27.584727)
+PER	Peru	ENVELOPE(-81.355146, -68.673909, -0.036873, -18.348546)
+URY	Uruguay	ENVELOPE(-58.438609, -53.098300, -30.096673, -34.943818)
+UMI	Baker I.	ENVELOPE(-176.467655, -176.455855, 0.222573, 0.215282)
+CAN	Canada	ENVELOPE(-141.002991, -52.617364, 83.113873, 41.675554)
+GTM	Guatemala	ENVELOPE(-92.246782, -88.214736, 17.821109, 13.745836)
+UMI	Howland I.	ENVELOPE(-176.643082, -176.631091, 0.808609, 0.790282)
+UMI	Johnston Atoll	ENVELOPE(-169.538936, -169.523927, 16.730273, 16.724164)
+MEX	Mexico	ENVELOPE(-118.404164, -86.738618, 32.718454, 14.550545)
+UMI	Midway Is.	ENVELOPE(-177.395845, -177.360545, 28.221518, 28.184154)
+BRB	Barbados	ENVELOPE(-59.659446, -59.427082, 13.337082, 13.050554)
+DMA	Dominica	ENVELOPE(-61.491391, -61.250700, 15.631945, 15.198054)
+GRD	Grenada	ENVELOPE(-61.785182, -61.596391, 12.237154, 11.996945)
+GLP	Guadeloupe	ENVELOPE(-61.796109, -61.187082, 16.512918, 15.870000)
+MTQ	Martinique	ENVELOPE(-61.231536, -60.816946, 14.880136, 14.402773)
+LCA	St. Lucia	ENVELOPE(-61.079582, -60.878064, 14.109309, 13.709445)
+SPM	St. Pierre & Miquelon	ENVELOPE(-56.397782, -56.145500, 47.135827, 46.747191)
+VCT	St. Vincent & the Grenadines	ENVELOPE(-61.280146, -61.120282, 13.383191, 13.130282)
+ABW	Aruba	ENVELOPE(-70.059664, -69.874864, 12.627773, 12.411109)
+BMU	Bermuda	ENVELOPE(-64.823064, -64.676809, 32.379509, 32.260554)
+DOM	Dominican Republic	ENVELOPE(-72.003064, -68.322927, 19.930827, 17.604164)
+HTI	Haiti	ENVELOPE(-74.467791, -71.629182, 20.091454, 18.022782)
+JAM	Jamaica	ENVELOPE(-78.373900, -76.221118, 18.522500, 17.697218)
+ANT	Netherlands Antilles	ENVELOPE(-69.163618, -68.192927, 12.383891, 12.020554)
+BHS	The Bahamas	ENVELOPE(-78.978900, -72.738891, 26.929164, 20.915273)
+TCA	Turks & Caicos Is.	ENVELOPE(-72.031464, -71.127573, 21.957773, 21.429918)
+BLZ	Belize	ENVELOPE(-89.216400, -87.779591, 18.489900, 15.889854)
+CYM	Cayman Is.	ENVELOPE(-81.400836, -81.093064, 19.354164, 19.265000)
+COL	Colombia	ENVELOPE(-81.720146, -66.870455, 12.590273, -4.236873)
+CRI	Costa Rica	ENVELOPE(-85.911391, -82.561400, 11.212845, 8.025673)
+CUB	Cuba	ENVELOPE(-84.952927, -74.131255, 23.194027, 19.821945)
+SLV	El Salvador	ENVELOPE(-90.108064, -87.694673, 14.431982, 13.156391)
+HND	Honduras	ENVELOPE(-89.350491, -83.131855, 16.435827, 12.985173)
+NIC	Nicaragua	ENVELOPE(-87.689827, -83.131855, 15.022218, 10.709691)
+PAN	Panama	ENVELOPE(-83.030291, -77.198336, 9.620136, 7.206109)
+AIA	Anguilla	ENVELOPE(-63.167782, -62.972709, 18.272982, 18.164445)
+ATG	Antigua & Barbuda	ENVELOPE(-61.891109, -61.666946, 17.724300, 16.989718)
+VGB	British Virgin Is.	ENVELOPE(-64.698482, -64.324527, 18.504854, 18.383891)
+MSR	Montserrat	ENVELOPE(-62.236946, -62.138891, 16.812354, 16.671391)
+PRI	Puerto Rico	ENVELOPE(-67.266400, -65.301118, 18.519445, 17.922218)
+KNA	St. Kitts & Nevis	ENVELOPE(-62.862782, -62.622509, 17.410136, 17.208882)
+VIR	Virgin Is.	ENVELOPE(-65.023509, -64.562573, 18.387673, 17.676664)
+FRO	Faroe Is.	ENVELOPE(-7.433473, -6.389718, 62.357500, 61.388327)
+GRL	Greenland	ENVELOPE(-73.053609, -12.157637, 83.623600, 59.790273)
+XGK	Guernsey	ENVELOPE(-2.668609, -2.500973, 49.508191, 49.422491)
+ISL	Iceland	ENVELOPE(-24.538400, -13.499446, 66.536100, 63.390000)
+IRL	Ireland	ENVELOPE(-10.474727, -6.013055, 55.379991, 51.445545)
+XIM	Isle of Man	ENVELOPE(-4.787155, -4.308682, 54.416382, 54.055545)
+SJM	Jan Mayen	ENVELOPE(-9.119909, -7.928509, 71.180818, 70.803863)
+XJE	Jersey	ENVELOPE(-2.247364, -2.015000, 49.261109, 49.167773)
+GBR	United Kingdom	ENVELOPE(-8.171664, 1.749445, 60.843327, 49.955273)
+CPV	Cape Verde	ENVELOPE(-25.360555, -22.666109, 17.192364, 14.811109)
+CIV	Cote d'Ivoire	ENVELOPE(-8.606382, -2.487782, 10.735254, 4.344718)
+GHA	Ghana	ENVELOPE(-3.248891, 1.202782, 11.155691, 4.727082)
+GIB	Gibraltar	ENVELOPE(-5.356173, -5.334509, 36.163309, 36.112073)
+LBR	Liberia	ENVELOPE(-11.492327, -7.368400, 8.512782, 4.343609)
+MAR	Morocco	ENVELOPE(-13.174964, -1.011809, 35.919164, 27.664236)
+PRT	Portugal	ENVELOPE(-31.289027, -6.190455, 42.150673, 32.637500)
+ESP	Spain	ENVELOPE(-18.169864, 4.316945, 43.764300, 27.637500)
+ESH	Western Sahara	ENVELOPE(-17.101527, -8.666391, 27.666954, 20.764100)
+BFA	Burkina Faso	ENVELOPE(-5.520837, 2.397927, 15.082773, 9.395691)
+GIN	Guinea	ENVELOPE(-15.080837, -7.653373, 12.677500, 7.193927)
+GNB	Guinea-Bissau	ENVELOPE(-16.717773, -13.643891, 12.684718, 10.925100)
+MLI	Mali	ENVELOPE(-12.244837, 4.251391, 25.000273, 10.142154)
+MRT	Mauritania	ENVELOPE(-17.075555, -4.806109, 27.290454, 14.725636)
+SEN	Senegal	ENVELOPE(-17.532782, -11.369927, 16.690618, 12.301745)
+SLE	Sierra Leone	ENVELOPE(-13.295609, -10.264309, 9.997500, 6.923609)
+GMB	The Gambia	ENVELOPE(-16.821664, -13.798609, 13.826391, 13.059973)
+DJI	Djibouti	ENVELOPE(41.759854, 43.420409, 12.708327, 10.942218)
+ERI	Eritrea	ENVELOPE(36.443282, 43.121382, 17.994882, 12.363891)
+ETH	Ethiopia	ENVELOPE(32.991800, 47.988245, 14.883609, 3.406664)
+MNG	Mongolia	ENVELOPE(87.761100, 119.931509, 52.142773, 41.586654)
+SDN	Sudan	ENVELOPE(21.829100, 38.607500, 22.232218, 3.493391)
+UGA	Uganda	ENVELOPE(29.574300, 35.009718, 4.222782, -1.476109)
+ISR	Gaza Strip	ENVELOPE(34.216663, 34.558891, 31.596100, 31.216545)
+IRQ	Iraq	ENVELOPE(38.794700, 48.560691, 37.383673, 29.061664)
+ISR	Israel	ENVELOPE(34.267582, 35.681109, 33.270273, 29.486709)
+JOR	Jordan	ENVELOPE(34.960418, 39.301109, 33.377591, 29.188891)
+KAZ	Kazakhstan	ENVELOPE(46.499163, 87.348209, 55.442627, 40.594436)
+NOR	Norway	ENVELOPE(4.789582, 31.073536, 71.154709, 57.987918)
+RUS	Russia	ENVELOPE(-180.000000, 180.000000, 81.851927, 41.196582)
+SWE	Sweden	ENVELOPE(11.113336, 24.167009, 69.060300, 55.339164)
+ISR	West Bank	ENVELOPE(34.888191, 35.570609, 32.546391, 31.350691)
+DZA	Algeria	ENVELOPE(-8.667218, 11.986473, 37.089854, 18.976391)
+AND	Andorra	ENVELOPE(1.421391, 1.781718, 42.655964, 42.436382)
+CMR	Cameroon	ENVELOPE(8.502363, 16.207000, 13.085000, 1.654164)
+CAF	Central African Republic	ENVELOPE(14.418891, 27.459718, 11.000836, 2.221264)
+LBY	Libya	ENVELOPE(9.311391, 25.151663, 33.171136, 19.499064)
+MCO	Monaco	ENVELOPE(7.390900, 7.439291, 43.768300, 43.727545)
+TUN	Tunisia	ENVELOPE(7.492218, 11.581663, 37.340409, 30.234391)
+BEN	Benin	ENVELOPE(0.776663, 3.855000, 12.396654, 6.218718)
+TCD	Chad	ENVELOPE(13.461945, 24.002745, 23.450554, 7.458536)
+GNQ	Equatorial Guinea	ENVELOPE(8.424163, 11.353891, 3.763336, 0.930154)
+KIR	Kiribati	ENVELOPE(-157.581700, 172.947509, 2.033054, 1.335991)
+NER	Niger	ENVELOPE(0.166663, 15.996663, 23.522309, 11.693273)
+NGA	Nigeria	ENVELOPE(2.692500, 14.649654, 13.891500, 4.272845)
+STP	Sao Tome & Principe	ENVELOPE(6.465136, 7.463473, 1.701245, 0.018336)
+TGO	Togo	ENVELOPE(-0.149764, 1.797800, 11.138536, 6.100545)
+ALB	Albania	ENVELOPE(19.288536, 21.053327, 42.660345, 39.645000)
+BIH	Bosnia & Herzegovina	ENVELOPE(15.740591, 19.619782, 45.265945, 42.565827)
+HRV	Croatia	ENVELOPE(13.504791, 19.425000, 46.535827, 42.399991)
+ITA	Italy	ENVELOPE(6.623963, 18.514445, 47.094582, 36.649164)
+MKD	Macedonia	ENVELOPE(20.458818, 23.030973, 42.358954, 40.855891)
+MLT	Malta	ENVELOPE(14.329100, 14.570000, 35.991936, 35.800000)
+SMR	San Marino	ENVELOPE(12.406945, 12.511109, 43.986873, 43.898682)
+SMN	Serbia & Montenegro	ENVELOPE(18.453327, 23.005000, 46.181109, 41.849000)
+VTC	Vatican City	ENVELOPE(12.444473, 12.457718, 41.908391, 41.900891)
+BGR	Bulgaria	ENVELOPE(22.365273, 28.605136, 44.224718, 41.243045)
+CYP	Cyprus	ENVELOPE(32.269863, 34.586036, 35.688609, 34.640273)
+EGY	Egypt	ENVELOPE(24.706800, 36.895827, 31.646945, 21.994164)
+GEO	Georgia	ENVELOPE(40.002963, 46.710818, 43.584718, 41.048045)
+GRC	Greece	ENVELOPE(19.640000, 28.238045, 41.747773, 34.930545)
+LBN	Lebanon	ENVELOPE(35.100827, 36.623745, 34.647500, 33.062082)
+SYR	Syria	ENVELOPE(35.614463, 42.378327, 37.290545, 32.313609)
+TUR	Turkey	ENVELOPE(25.665827, 44.820545, 42.109991, 35.818445)
+AUT	Austria	ENVELOPE(9.533573, 17.166382, 49.018745, 46.407491)
+CZE	Czech Republic	ENVELOPE(12.093700, 18.852218, 51.052491, 48.581382)
+DNK	Denmark	ENVELOPE(8.092918, 15.149163, 57.745973, 54.561936)
+HUN	Hungary	ENVELOPE(16.111800, 22.894800, 48.576173, 45.748327)
+POL	Poland	ENVELOPE(14.147636, 24.143473, 54.836036, 49.002918)
+SVK	Slovakia	ENVELOPE(16.844718, 22.558054, 49.600827, 47.737500)
+SVN	Slovenia	ENVELOPE(13.383473, 16.607873, 46.876245, 45.425818)
+SJM	Svalbard	ENVELOPE(10.487918, 33.637500, 80.764163, 74.343045)
+BEL	Belgium	ENVELOPE(2.541663, 6.398200, 51.501245, 49.508882)
+FRA	France	ENVELOPE(-4.790282, 9.562218, 51.091109, 41.364927)
+DEU	Germany	ENVELOPE(5.865000, 15.033818, 55.056527, 47.274718)
+LIE	Liechtenstein	ENVELOPE(9.474636, 9.633891, 47.274545, 47.057454)
+LUX	Luxembourg	ENVELOPE(5.734445, 6.524027, 50.181809, 49.448464)
+NLD	Netherlands	ENVELOPE(3.370863, 7.210973, 53.465827, 50.753882)
+CHE	Switzerland	ENVELOPE(5.967009, 10.488209, 47.806664, 45.829436)
+USA	United States	ENVELOPE(-178.216555, 179.775936, 71.351436, 18.925482)
+BLR	Belarus	ENVELOPE(23.165400, 32.740054, 56.167491, 51.251845)
+EST	Estonia	ENVELOPE(21.837354, 28.194091, 59.664718, 57.522636)
+FIN	Finland	ENVELOPE(19.511391, 31.581963, 70.088609, 59.806800)
+LVA	Latvia	ENVELOPE(20.968609, 28.235963, 58.083254, 55.674836)
+LTU	Lithuania	ENVELOPE(20.942836, 26.813054, 56.449854, 53.890336)
+MDA	Moldova	ENVELOPE(26.634991, 30.128709, 48.468318, 45.448645)
+ROM	Romania	ENVELOPE(20.261027, 29.672218, 48.263882, 43.623309)
+UKR	Ukraine	ENVELOPE(22.151445, 40.178745, 52.378600, 44.379154)
+IND	India	ENVELOPE(68.144227, 97.380536, 35.505618, 6.745827)
+MDV	Maldives	ENVELOPE(72.863391, 73.637272, 7.027773, -0.641664)
+OMN	Oman	ENVELOPE(51.999291, 59.847082, 26.368709, 16.642782)
+SOM	Somalia	ENVELOPE(40.988609, 51.411318, 11.979164, -1.674873)
+LKA	Sri Lanka	ENVELOPE(79.696091, 81.891663, 9.828191, 5.918054)
+TKM	Turkmenistan	ENVELOPE(51.250182, 66.670882, 42.796173, 35.145991)
+UZB	Uzbekistan	ENVELOPE(55.997491, 73.167545, 45.570591, 37.184991)
+YEM	Yemen	ENVELOPE(42.555973, 54.473473, 18.999345, 12.144718)
+ARM	Armenia	ENVELOPE(43.454163, 46.620536, 41.297054, 38.841145)
+AZE	Azerbaijan	ENVELOPE(44.778863, 51.677009, 42.710754, 38.262809)
+BHR	Bahrain	ENVELOPE(50.453327, 50.796391, 26.288891, 25.571945)
+IRN	Iran	ENVELOPE(44.034954, 63.330273, 39.779154, 25.075973)
+KWT	Kuwait	ENVELOPE(46.546945, 48.416591, 30.084164, 28.538882)
+QAT	Qatar	ENVELOPE(50.751936, 51.615827, 26.152500, 24.556045)
+SAU	Saudi Arabia	ENVELOPE(34.572145, 55.666109, 32.154945, 16.377500)
+ARE	United Arab Emirates	ENVELOPE(51.583327, 56.381663, 26.083882, 22.633327)
+AFG	Afghanistan	ENVELOPE(60.504163, 74.915736, 38.471982, 29.406109)
+KGZ	Kyrgyzstan	ENVELOPE(69.249500, 80.281582, 43.216900, 39.195473)
+NPL	Nepal	ENVELOPE(80.052200, 88.194554, 30.424718, 26.368364)
+PAK	Pakistan	ENVELOPE(60.866300, 77.823927, 37.060791, 23.688045)
+TJK	Tajikistan	ENVELOPE(67.364700, 75.187482, 41.049254, 36.671845)
+BGD	Bangladesh	ENVELOPE(88.043872, 92.669345, 26.626136, 20.744818)
+BTN	Bhutan	ENVELOPE(88.751936, 92.114218, 28.325000, 26.703609)
+BRN	Brunei	ENVELOPE(114.095082, 115.360263, 5.053054, 4.018191)
+CHN	China	ENVELOPE(73.620045, 134.768463, 53.553745, 18.168882)
+JPN	Japan	ENVELOPE(123.678863, 145.812409, 45.486382, 24.251391)
+PRK	North Korea	ENVELOPE(124.323954, 130.697418, 43.006100, 37.671382)
+PLW	Palau	ENVELOPE(134.452482, 134.658872, 7.729445, 7.305254)
+PHL	Philippines	ENVELOPE(116.950000, 126.598036, 19.391109, 5.049164)
+KOR	South Korea	ENVELOPE(126.099018, 129.586872, 38.625245, 33.192209)
+KHM	Cambodia	ENVELOPE(102.346509, 107.636382, 14.708618, 10.422736)
+LAO	Laos	ENVELOPE(100.091372, 107.695254, 22.499927, 13.926664)
+MYS	Malaysia	ENVELOPE(99.641936, 119.275818, 7.352918, 0.852782)
+MMR	Myanmar	ENVELOPE(92.204991, 101.169427, 28.546527, 9.839582)
+SGP	Singapore	ENVELOPE(103.640945, 103.997945, 1.445282, 1.259027)
+THA	Thailand	ENVELOPE(97.347272, 105.639291, 20.454582, 5.633473)
+VNM	Vietnam	ENVELOPE(102.140745, 109.464845, 23.324164, 8.559236)
+GUM	Guam	ENVELOPE(144.634154, 144.953309, 13.652291, 13.235000)
+MHL	Marshall Is.	ENVELOPE(162.324963, 171.378063, 14.594027, 5.600273)
+FSM	Micronesia	ENVELOPE(158.120100, 163.042891, 6.977636, 5.261664)
+MNP	Northern Mariana Is.	ENVELOPE(145.572682, 145.818082, 15.268191, 14.908054)
+UMI	Wake I.	ENVELOPE(166.608981, 166.662200, 19.324582, 19.279445)
+BWA	Botswana	ENVELOPE(19.996109, 29.373618, -17.782082, -26.875555)
+BDI	Burundi	ENVELOPE(28.985000, 30.853191, -2.301564, -4.448055)
+ATF	French Southern & Antarctic Lands	ENVELOPE(51.650836, 70.567491, -46.327645, -49.725009)
+HMD	Heard I. & McDonald Is.	ENVELOPE(73.234709, 73.773882, -52.965145, -53.199445)
+KEN	Kenya	ENVELOPE(33.907218, 41.905163, 4.622500, -4.669618)
+RWA	Rwanda	ENVELOPE(28.854445, 30.893263, -1.054446, -2.825491)
+TZA	Tanzania	ENVELOPE(29.340827, 40.436809, -0.997218, -11.740418)
+ZMB	Zambia	ENVELOPE(21.996391, 33.702282, -8.191664, -18.074918)
+ZWE	Zimbabwe	ENVELOPE(25.237918, 33.071591, -15.616527, -22.414764)
+ATA	Antarctica	ENVELOPE(-180.000000, 180.000000, -60.503336, -90.000000)
+NOR	Bouvet I.	ENVELOPE(3.342363, 3.484163, -54.383609, -54.462782)
+COM	Comoros	ENVELOPE(43.214027, 44.530418, -11.366946, -12.383055)
+REU	Juan De Nova I.	ENVELOPE(42.723818, 42.760900, -17.052018, -17.076118)
+LSO	Lesotho	ENVELOPE(27.013973, 29.455554, -28.570691, -30.650527)
+MWI	Malawi	ENVELOPE(32.681873, 35.920963, -9.376673, -17.135282)
+MOZ	Mozambique	ENVELOPE(30.213018, 40.846109, -10.471109, -26.860282)
+ZAF	South Africa	ENVELOPE(16.483327, 37.892218, -22.136391, -46.969727)
+SWZ	Swaziland	ENVELOPE(30.798336, 32.133400, -25.728336, -27.316391)
+AGO	Angola	ENVELOPE(11.731245, 24.084445, -4.388991, -18.016391)
+COG	Congo	ENVELOPE(11.140663, 18.643609, 3.711109, -5.015000)
+ZAR	Congo, DRC	ENVELOPE(12.214554, 31.302773, 5.380691, -13.458055)
+FJI	Fiji	ENVELOPE(-180.000000, 180.000000, -16.153473, -19.162782)
+GAB	Gabon	ENVELOPE(8.700836, 14.519582, 2.317900, -3.925282)
+NAM	Namibia	ENVELOPE(11.716391, 25.264427, -16.954173, -28.961873)
+NZL	New Zealand	ENVELOPE(-176.848755, 178.841063, -34.414718, -52.578055)
+IOT	British Indian Ocean Territory	ENVELOPE(72.357900, 72.494282, -7.233473, -7.436246)
+REU	Glorioso Is.	ENVELOPE(47.279091, 47.303054, -11.554100, -11.577782)
+MDG	Madagascar	ENVELOPE(43.236827, 50.501391, -11.945555, -25.588336)
+MUS	Mauritius	ENVELOPE(57.306309, 63.495754, -19.673336, -20.520555)
+MYT	Mayotte	ENVELOPE(45.039163, 45.293345, -12.662500, -12.992500)
+REU	Reunion	ENVELOPE(55.220554, 55.853054, -20.856527, -21.373891)
+SYC	Seychelles	ENVELOPE(46.205691, 55.540554, -4.551664, -9.463055)
+CXR	Christmas I.	ENVELOPE(105.629000, 105.751900, -10.384082, -10.510973)
+CCK	Cocos Is.	ENVELOPE(96.817491, 96.864845, -12.130418, -12.199446)
+IDN	Indonesia	ENVELOPE(95.210945, 141.007018, 5.913473, -10.929655)
+TLS	Timor Leste	ENVELOPE(124.046100, 127.308591, -8.140000, -9.463627)
+AUS	Australia	ENVELOPE(112.907209, 158.960372, -10.135691, -54.753891)
+NRU	Nauru	ENVELOPE(166.904418, 166.957045, -0.493336, -0.552218)
+NCL	New Caledonia	ENVELOPE(163.982745, 168.130509, -20.087918, -22.673891)
+NFK	Norfolk I.	ENVELOPE(167.910945, 167.998872, -29.000555, -29.081109)
+PNG	Papua New Guinea	ENVELOPE(140.858854, 155.966845, -1.355282, -11.642500)
+SLB	Solomon Is.	ENVELOPE(155.671300, 166.931836, -6.605518, -11.845836)
+TUV	Tuvalu	ENVELOPE(176.295254, 179.232281, -6.089446, -8.561291)
+VUT	Vanuatu	ENVELOPE(166.521636, 169.893863, -13.707218, -20.254173)

Modified: lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/simple-bbox.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/simple-bbox.txt?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/simple-bbox.txt (original)
+++ lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/simple-bbox.txt Wed Jan 29 11:14:53 2014
@@ -1,5 +1,5 @@
 #id	name	shape	
-C5	CenterAt5	-5 -5 5 5
-C10	CenterAt10	-10 -10 10 10
-NW15	NorthWest	15 15 20 20
+C5	CenterAt5	ENVELOPE(-5, 5, 5, -5)
+C10	CenterAt10	ENVELOPE(-10, 10, 10, -10)
+NW15	NorthWest	ENVELOPE(15, 20, 20, 15)
 

Modified: lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/states-bbox.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/states-bbox.txt?rev=1562403&r1=1562402&r2=1562403&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/states-bbox.txt (original)
+++ lucene/dev/branches/lucene5376/lucene/spatial/src/test-files/data/states-bbox.txt Wed Jan 29 11:14:53 2014
@@ -1,52 +1,52 @@
 #id	name	shape	
-HI	Hawaii	-160.242406 18.921786 -154.791096 22.229120	
-WA	Washington	-124.732769 45.543092 -116.919132 48.999931	
-MT	Montana	-116.063531 44.353639 -104.043072 49.000026	
-ME	Maine	-71.087509 43.091050 -66.969271 47.453334	
-ND	North Dakota	-104.062991 45.930822 -96.551931 49.000026	
-SD	South Dakota	-104.061036 42.488459 -96.439394 45.943547	
-WY	Wyoming	-111.053428 40.994289 -104.051705 45.002793	
-WI	Wisconsin	-92.885397 42.489152 -86.967712 46.952479	
-ID	Idaho	-117.236921 41.994599 -111.046771 48.999950	
-VT	Vermont	-73.436000 42.725852 -71.505372 45.013351	
-MN	Minnesota	-97.229436 43.498102 -89.530673 49.371730	
-OR	Oregon	-124.559617 41.987672 -116.470418 46.236091	
-NH	New Hampshire	-72.553428 42.698603 -70.734139 45.301469	
-IA	Iowa	-96.640709 40.371946 -90.142796 43.501457	
-MA	Massachusetts	-73.498840 41.238279 -69.917780 42.886877	
-NE	Nebraska	-104.056219 39.992595 -95.308697 43.003062	
-NY	New York	-79.763235 40.506003 -71.869986 45.006138	
-PA	Pennsylvania	-80.526045 39.719313 -74.700062 42.267327	
-CT	Connecticut	-73.725237 40.998392 -71.788249 42.047428	
-RI	Rhode Island	-71.866678 41.322769 -71.117132 42.013713	
-NJ	New Jersey	-75.570234 38.956682 -73.896148 41.350573	
-IN	Indiana	-88.101490 37.776224 -84.787446 41.765540	
-NV	Nevada	-119.996324 34.998914 -114.037392 41.996637	
-UT	Utah	-114.047273 36.991746 -109.043206 42.002300	
-CA	California	-124.392638 32.535781 -114.125230 42.002191	
-OH	Ohio	-84.812070 38.400511 -80.519996 41.986872	
-IL	Illinois	-91.516284 36.986822 -87.507909 42.509363	
-DC	District of Columbia	-77.122328 38.788234 -76.910904 38.993541	
-DE	Delaware	-75.791094 38.449602 -75.045623 39.840119	
-WV	West Virginia	-82.647158 37.204910 -77.727467 40.637203	
-MD	Maryland	-79.489865 37.970255 -75.045623 39.725461	
-CO	Colorado	-109.055861 36.988994 -102.037207 41.003375	
-KY	Kentucky	-89.568231 36.496570 -81.959575 39.142063	
-KS	Kansas	-102.051535 36.988875 -94.601224 40.002987	
-VA	Virginia	-83.675177 36.541623 -75.242219 39.456998	
-MO	Missouri	-95.767479 35.989656 -89.105034 40.609784	
-AZ	Arizona	-114.821761 31.335634 -109.045615 37.003926	
-OK	Oklahoma	-102.997709 33.621136 -94.428552 37.001478	
-NC	North Carolina	-84.323773 33.882164 -75.456580 36.589767	
-TN	Tennessee	-90.305448 34.988759 -81.652272 36.679683	
-TX	Texas	-106.650062 25.845557 -93.507389 36.493912	
-NM	New Mexico	-109.051346 31.343453 -102.997401 36.999760	
-AL	Alabama	-88.472952 30.233604 -84.894016 35.016033	
-MS	Mississippi	-91.643682 30.194935 -88.090468 35.005041	
-GA	Georgia	-85.608960 30.361291 -80.894753 35.000366	
-SC	South Carolina	-83.350685 32.068173 -78.579453 35.208356	
-AR	Arkansas	-94.617257 33.010151 -89.645479 36.492811	
-LA	Louisiana	-94.041785 28.939655 -89.021803 33.023422	
-FL	Florida	-87.625711 24.956376 -80.050911 31.003157	
-MI	Michigan	-90.408200 41.697494 -82.419836 48.173795	
-AK	Alaska	-178.217598 51.583032 -129.992235 71.406235	
+HI	Hawaii	ENVELOPE(-160.242406, -154.791096, 22.229120, 18.921786)
+WA	Washington	ENVELOPE(-124.732769, -116.919132, 48.999931, 45.543092)
+MT	Montana	ENVELOPE(-116.063531, -104.043072, 49.000026, 44.353639)
+ME	Maine	ENVELOPE(-71.087509, -66.969271, 47.453334, 43.091050)
+ND	North Dakota	ENVELOPE(-104.062991, -96.551931, 49.000026, 45.930822)
+SD	South Dakota	ENVELOPE(-104.061036, -96.439394, 45.943547, 42.488459)
+WY	Wyoming	ENVELOPE(-111.053428, -104.051705, 45.002793, 40.994289)
+WI	Wisconsin	ENVELOPE(-92.885397, -86.967712, 46.952479, 42.489152)
+ID	Idaho	ENVELOPE(-117.236921, -111.046771, 48.999950, 41.994599)
+VT	Vermont	ENVELOPE(-73.436000, -71.505372, 45.013351, 42.725852)
+MN	Minnesota	ENVELOPE(-97.229436, -89.530673, 49.371730, 43.498102)
+OR	Oregon	ENVELOPE(-124.559617, -116.470418, 46.236091, 41.987672)
+NH	New Hampshire	ENVELOPE(-72.553428, -70.734139, 45.301469, 42.698603)
+IA	Iowa	ENVELOPE(-96.640709, -90.142796, 43.501457, 40.371946)
+MA	Massachusetts	ENVELOPE(-73.498840, -69.917780, 42.886877, 41.238279)
+NE	Nebraska	ENVELOPE(-104.056219, -95.308697, 43.003062, 39.992595)
+NY	New York	ENVELOPE(-79.763235, -71.869986, 45.006138, 40.506003)
+PA	Pennsylvania	ENVELOPE(-80.526045, -74.700062, 42.267327, 39.719313)
+CT	Connecticut	ENVELOPE(-73.725237, -71.788249, 42.047428, 40.998392)
+RI	Rhode Island	ENVELOPE(-71.866678, -71.117132, 42.013713, 41.322769)
+NJ	New Jersey	ENVELOPE(-75.570234, -73.896148, 41.350573, 38.956682)
+IN	Indiana	ENVELOPE(-88.101490, -84.787446, 41.765540, 37.776224)
+NV	Nevada	ENVELOPE(-119.996324, -114.037392, 41.996637, 34.998914)
+UT	Utah	ENVELOPE(-114.047273, -109.043206, 42.002300, 36.991746)
+CA	California	ENVELOPE(-124.392638, -114.125230, 42.002191, 32.535781)
+OH	Ohio	ENVELOPE(-84.812070, -80.519996, 41.986872, 38.400511)
+IL	Illinois	ENVELOPE(-91.516284, -87.507909, 42.509363, 36.986822)
+DC	District of Columbia	ENVELOPE(-77.122328, -76.910904, 38.993541, 38.788234)
+DE	Delaware	ENVELOPE(-75.791094, -75.045623, 39.840119, 38.449602)
+WV	West Virginia	ENVELOPE(-82.647158, -77.727467, 40.637203, 37.204910)
+MD	Maryland	ENVELOPE(-79.489865, -75.045623, 39.725461, 37.970255)
+CO	Colorado	ENVELOPE(-109.055861, -102.037207, 41.003375, 36.988994)
+KY	Kentucky	ENVELOPE(-89.568231, -81.959575, 39.142063, 36.496570)
+KS	Kansas	ENVELOPE(-102.051535, -94.601224, 40.002987, 36.988875)
+VA	Virginia	ENVELOPE(-83.675177, -75.242219, 39.456998, 36.541623)
+MO	Missouri	ENVELOPE(-95.767479, -89.105034, 40.609784, 35.989656)
+AZ	Arizona	ENVELOPE(-114.821761, -109.045615, 37.003926, 31.335634)
+OK	Oklahoma	ENVELOPE(-102.997709, -94.428552, 37.001478, 33.621136)
+NC	North Carolina	ENVELOPE(-84.323773, -75.456580, 36.589767, 33.882164)
+TN	Tennessee	ENVELOPE(-90.305448, -81.652272, 36.679683, 34.988759)
+TX	Texas	ENVELOPE(-106.650062, -93.507389, 36.493912, 25.845557)
+NM	New Mexico	ENVELOPE(-109.051346, -102.997401, 36.999760, 31.343453)
+AL	Alabama	ENVELOPE(-88.472952, -84.894016, 35.016033, 30.233604)
+MS	Mississippi	ENVELOPE(-91.643682, -88.090468, 35.005041, 30.194935)
+GA	Georgia	ENVELOPE(-85.608960, -80.894753, 35.000366, 30.361291)
+SC	South Carolina	ENVELOPE(-83.350685, -78.579453, 35.208356, 32.068173)
+AR	Arkansas	ENVELOPE(-94.617257, -89.645479, 36.492811, 33.010151)
+LA	Louisiana	ENVELOPE(-94.041785, -89.021803, 33.023422, 28.939655)
+FL	Florida	ENVELOPE(-87.625711, -80.050911, 31.003157, 24.956376)
+MI	Michigan	ENVELOPE(-90.408200, -82.419836, 48.173795, 41.697494)
+AK	Alaska	ENVELOPE(-178.217598, -129.992235, 71.406235, 51.583032)