Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-4879

Indexing a field of type solr.SpatialRecursivePrefixTreeFieldType fails when at least two vertexes are more than 180 degrees apart

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.7
    • None
    • None
    • Linux, Solr 4.0.0, Solr 4.3.0

    Description

      When trying to index a field of the type solr.SpatialRecursivePrefixTreeFieldType the indexing will fail if two vertexes are more than 180 longitudal degress apart.

      For instance this polygon will fail:

      POLYGON((-161 49, 0 49, 20 49, 20 89.1, 0 89.1, -161 89.2, -161 49))

      but this will not.

      POLYGON((-160 49, 0 49, 20 49, 20 89.1, 0 89.1, -160 89.2, -160 49))

      This contradicts the documentation found here: http://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4

      The documentation states that each vertex must be less than 180 longitudal degrees apart from the previous vertex.

      Relevant parts from the schema.xml file:

      <!-- Field type for storing WTK based polygons -->
      <fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
      spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
      distErrPct="0.025"
      maxDistErr="0.000009"
      units="degrees"
      />

      <field name="geographic_extent" type="location_rpt" index="true" stored="true" />

      Attachments

        Issue Links

          Activity

            People

              dsmiley David Smiley
              oyse Øystein Torget
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: