self intersecting polygon errors

2012-12-05 Thread jend
http://lucene.472066.n3.nabble.com/file/n4024423/5-12-2012_9-26-09_PM.jpg 

Hi, trying to play with polygon searches and have noticed this issue. It
seems when you cross a line you invalidate the polygon (Sorry I have no idea
about the technical term) and solr cannot handle it.

As far as my google fu goes, there is no fix, its not specific to solr, its
to do with geometry moreso.

Anyone have a work around? Could this be fixed or should I just try and
control this at the customer front end script to check if the shape is
valid.

Using Solr4 and I think current version of JTS (downloaded/installed in mid
November).

Thanks

lst name=error
str name=msg
Self-intersection at or near point (128.93654657968983, -24.34876200980167,
NaN)
/str
str name=trace
com.spatial4j.core.exception.InvalidShapeException: Self-intersection at or
near point (128.93654657968983, -24.34876200980167, NaN) at
com.spatial4j.core.shape.jts.JtsGeometry.init(JtsGeometry.java:90) at
com.spatial4j.core.io.JtsShapeReadWriter.readShape(JtsShapeReadWriter.java:93)
at
com.spatial4j.core.context.SpatialContext.readShape(SpatialContext.java:195)
at
org.apache.lucene.spatial.query.SpatialArgsParser.parse(SpatialArgsParser.java:89)
at
org.apache.solr.schema.AbstractSpatialFieldType.getFieldQuery(AbstractSpatialFieldType.java:175)
at
org.apache.solr.search.SolrQueryParser.getFieldQuery(SolrQueryParser.java:171)
at
org.apache.lucene.queryparser.classic.QueryParserBase.getFieldQuery(QueryParserBase.java:657)
at
org.apache.lucene.queryparser.classic.QueryParserBase.handleQuotedTerm(QueryParserBase.java:1082)
at
org.apache.lucene.queryparser.classic.QueryParser.Term(QueryParser.java:462)
at
org.apache.lucene.queryparser.classic.QueryParser.Clause(QueryParser.java:257)
at
org.apache.lucene.queryparser.classic.QueryParser.Query(QueryParser.java:181)
at
org.apache.lucene.queryparser.classic.QueryParser.TopLevelQuery(QueryParser.java:170)
at
org.apache.lucene.queryparser.classic.QueryParserBase.parse(QueryParserBase.java:120)
at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:72)
at org.apache.solr.search.QParser.getQuery(QParser.java:143) at
org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:137)
at
org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:185)
at
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1699) at
org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:455)
at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:276)
at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
at
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
at
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:351) at
org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
at
org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at
org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
at
org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634) at
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230) at
org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at
org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:722)
/str
int name=code500/int
/lst



--
View this message in context: 
http://lucene.472066.n3.nabble.com/self-intersecting-polygon-errors-tp4024423.html
Sent from the Solr - User mailing list archive at Nabble.com.


how to do a range search not on ordered data (text type)

2012-12-01 Thread jend
Hi,
Im building a solr install which has a blurb of data in a field
description.

In that field there are sentences such as This property has a block size of
770sqm. or 1200sqm block blah blah blah.

Its a text field obviously.

How can I construct a search as follows.

Someone wants to search for properties 
with the block size over 900sqm.

with a block size under 1200sqm.

with a block size of between 550 and 1500sqm.

Its essentially a text string but can you range values in text somehow?

Thanks in advance.



--
View this message in context: 
http://lucene.472066.n3.nabble.com/how-to-do-a-range-search-not-on-ordered-data-text-type-tp4023761.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: solr4 MULTIPOLYGON search syntax

2012-11-20 Thread jend
Thanks to both of you. 
I got it working as follows after your helpful posts.
I get this polygon search working.
fq=geo:Intersects(POLYGON((149.4023 -34.6072, 149.4023 -34.8690, 149.9022
-34.8690, 149.9022 -34.6072, 149.4023 -34.6072)))

AND I can get this search working (as in results returned)
fq=geo:Intersects(POLYGON((151.506958 -33.458943, 150.551147 -33.60547,
151.00708 -34.257216, 151.627808 -33.861293, 151.506958 -33.458943)))

But no matter what MULTIPOLYGON I try with various Parentheses combinations
and im still not getting results, I will get results from either only 1 of
the polygons in the multipolygon search, or the error unable to read .

fq=geo:Intersects(MULTIPOLYGON(((149.4023 -34.6072, 149.4023 -34.8690,
149.9022 -34.8690, 149.9022 -34.6072, 149.4023 -34.6072))), ((151.506958
-33.458943, 150.551147 -33.60547, 151.00708 -34.257216, 151.627808
-33.861293, 151.506958 -33.458943)))

Returns only the results from the first polygon.

fq=geo:Intersects(MULTIPOLYGON(((149.4023 -34.6072, 149.4023 -34.8690,
149.9022 -34.8690, 149.9022 -34.6072, 149.4023 -34.6072)), ((151.506958
-33.458943, 150.551147 -33.60547, 151.00708 -34.257216, 151.627808
-33.861293, 151.506958 -33.458943)))

Gives error 
ERROR 500

error reading WKT

Finally this
fq=geo:Intersects(MULTIPOLYGON(((149.4023 -34.6072, 149.4023 -34.8690,
149.9022 -34.8690, 149.9022 -34.6072, 149.4023 -34.6072)), ((151.506958
-33.458943, 150.551147 -33.60547, 151.00708 -34.257216, 151.627808
-33.861293, 151.506958 -33.458943

Worked :)



--
View this message in context: 
http://lucene.472066.n3.nabble.com/solr4-MULTIPOLYGON-search-syntax-tp4021199p4021435.html
Sent from the Solr - User mailing list archive at Nabble.com.


solr4 MULTIPOLYGON search syntax

2012-11-19 Thread jend
Does anybody have any info on how to property construct a multipolygon
search?

Im very interested in

Polygon (search all documents within a shape)
Multipolygon (search all documents within 2+ shapes)
Multipolygon (search all documents with 2+ shapes but not within an area
within a shape - if you can image a donut where you dont search within the
hole in the center)

Im trying to search 2 shapes but get errors at the moment. Polygon searches
work just fine so I have everything installed correctly, but 2 shapes in the
one search as per below is not working. I cant find anything on the net to
try and debug Multipolygons.

My multipolygon query looks like this.
fq=geo:Intersects(MULTIPOLYGON ((149.4023 -34.6072, 149.4023 -34.8690,
149.9022 -34.8690, 149.9022 -34.6072, 149.4023 -34.6072)), ((151.506958
-33.458943, 150.551147 -33.60547, 151.00708 -34.257216, 151.627808
-33.861293, 151.506958 -33.458943)))

And I get this error.
ERROR 500

error reading WKT

But a polygon search works fine.
fq=geo:Intersects(POLYGON((149.4023 -34.6072, 149.4023 -34.8690, 149.9022
-34.8690, 149.9022 -34.6072, 149.4023 -34.6072))) 




--
View this message in context: 
http://lucene.472066.n3.nabble.com/solr4-MULTIPOLYGON-search-syntax-tp4021199.html
Sent from the Solr - User mailing list archive at Nabble.com.