I've managed to get this working by using smaller values in my
spatial-mapped-time field. The definition is now:

<fieldType name="time_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
        geo="false" distErrPct="0" worldBounds="0 0 200000 200000"
units="degrees"  />

The values I'm adding are now given in hours since a custom epoch,
which seems to be working well. My hunch is that using very large
values is causing the quadtree to partition itself down below
`maxLevels`, but I haven't investigated this thoroughly. Is this
something that should get taken up on the dev list?

Thanks!

-Jon

On Wed, Mar 6, 2013 at 6:11 PM, Jon Chambers <j...@relayrides.com> wrote:
> Well, I've resolved one part of the problem, but run into another. I
> was specifying points as "%d,%d", which caused spatial4j to interpret
> them as lat/lon points (see
> https://github.com/spatial4j/spatial4j/blob/master/src/main/java/com/spatial4j/core/io/ShapeReadWriter.java#L145
> for the line in question). Now I'm formatting the points as "%d %d"
> (space instead of comma) and am running into the same issue as this
> gentleman: 
> http://mail-archives.apache.org/mod_mbox/lucene-java-user/201302.mbox/%3c511d2b66.7090...@kodama.at%3E
>
> To summarize, it's an IndexOutOfBoundsException in
> QuadPrefixTree#getNode. The relevant part of the stack trace appears
> to be:
>
> Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
>     at java.util.ArrayList.RangeCheck(ArrayList.java:547)
>     at java.util.ArrayList.get(ArrayList.java:322)
>     at 
> org.apache.lucene.spatial.prefix.tree.QuadPrefixTree.getNode(QuadPrefixTree.java:146)
>     at 
> org.apache.lucene.spatial.prefix.tree.SpatialPrefixTree.getNodesAltPoint(SpatialPrefixTree.java:201)
>     at 
> org.apache.lucene.spatial.prefix.tree.QuadPrefixTree.getNodes(QuadPrefixTree.java:162)
>     at 
> org.apache.lucene.spatial.prefix.PrefixTreeStrategy.createIndexableFields(PrefixTreeStrategy.java:127)
>     at 
> org.apache.lucene.spatial.prefix.PrefixTreeStrategy.createIndexableFields(PrefixTreeStrategy.java:122)
>     at 
> org.apache.solr.schema.AbstractSpatialFieldType.createFields(AbstractSpatialFieldType.java:123)
>     at 
> org.apache.solr.schema.AbstractSpatialFieldType.createFields(AbstractSpatialFieldType.java:63)
>     at 
> org.apache.solr.update.DocumentBuilder.addField(DocumentBuilder.java:193)
>     at 
> org.apache.solr.update.DocumentBuilder.toDocument(DocumentBuilder.java:269)
>     ... 41 more
>
> I realize the original question didn't get answered (and feel bad
> repeating it effectively verbatim), but any suggestions would be
> greatly appreciated.
>
> -Jon
>
> On Wed, Mar 6, 2013 at 4:31 PM, Jon Chambers <j...@relayrides.com> wrote:
>> Hi there!
>>
>> As suggested elsewhere
>> (http://lucene.472066.n3.nabble.com/Modeling-openinghours-using-multipoints-td4025336.html),
>> I'm trying to use spatial mapping to model intervals of availability.
>> I've defined the following fieldType in schema.xml:
>>
>> <fieldType name="time_rpt"
>> class="solr.SpatialRecursivePrefixTreeFieldType" geo="false"
>> distErrPct="0.001" worldBounds="1362528000000 1362528000000
>> 2524608000000 2524608000000" units="degrees" />
>>
>> ...and then I have a field like this:
>>
>> <field name="availability" type="time_rpt" indexed="true"
>> stored="false" required="false" multiValued="true"/>
>>
>> When I try to index a document (via solrj) with availability values in
>> the the worldBounds range, I get the following exception:
>>
>> org.apache.solr.common.SolrException:
>> com.spatial4j.core.exception.InvalidShapeException: Invalid latitude:
>> latitudes are range -90 to 90: provided lat: [1.3626036E12]
>>     at 
>> org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:404)
>>     at 
>> org.apache.solr.client.solrj.impl.HttpSolrServer.request(HttpSolrServer.java:181)
>>     at 
>> org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117)
>>     at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:116)
>>     at org.apache.solr.client.solrj.SolrServer.addBean(SolrServer.java:136)
>>     at org.apache.solr.client.solrj.SolrServer.addBean(SolrServer.java:125)
>>
>> I've searched around a bit, and haven't found anybody else with this
>> problem. In fact, it sounds like lots of people are doing this kind of
>> thing with some success. I'm using solr 4.1.0; am I missing something?
>>
>> Thanks very much!
>>
>> -Jon

Reply via email to