yashhema opened a new issue, #782:
URL: https://github.com/apache/lucenenet/issues/782
Hello,
I indexed MultiPolygon using this
IDictionary<string, string> margs = new Dictionary<string, string>
{
["SpatialContextFactory"] =
typeof(NtsSpatialContextFactory).FullName
};
var ctx = SpatialContextFactory.MakeSpatialContext(margs,
GetType().Assembly);
SpatialPrefixTree trie = new QuadPrefixTree(ctx, 12);
_locationfindstrategy = new TermQueryPrefixTreeStrategy(trie,
"geo");
then indexed each polygon via
IShape area = ctx.ReadShapeFromWkt(v.wktstr);
Document doc = new Document();
doc.Add(new TextField("id", v.stname, Field.Store.YES));
Field[] fields =
_locationfindstrategy.CreateIndexableFields(area, 0.025);
foreach (Field field in fields)
{
doc.Add(field);
}
Now I am trying to search documents containing a point (For example , say i
want to find the city from lat/long, and I have stored polygon shapes of city )
IPoint upperleft = ctx.MakePoint(92.515830993652514, 10.8976411819458);
Query query = _locationfindstrategy.MakeQuery(new
SpatialArgs(SpatialOperation.Contains, upperleft));
TopDocs search = searcher.Search(query, 10);
I am getting error - Opeation Not supported
Is there any other mechanism which i can use
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]