Hi Pradeep, Are you seeing an error when it doesn't work? I believe a shape overlapping itself will cause an error from JTS. If you do see that, then you can ask Spatial4j (used by Lucene/Solr) to attempt to deal with it in a number of ways. See "validationRule": https://locationtech.github.io/spatial4j/apidocs/org/locationtech/spatial4j/context/jts/JtsSpatialContextFactory.html <https://locationtech.github.io/spatial4j/apidocs/> Probably try validationRule="repairBuffer0".
If it still doesn't work (and if you can't use what I say next), I suggesting debugging this at the JTS level. You might then wind up submitting a question to the JTS list. Spatial4j extends the WKT syntax with a BUFFER() syntax which is possibly easier/better than your approach of manually building up the buffered path with your own code to produce a large polygon to send to Solr. You would do something like BUFFER(LINESTRING(.......),0.001) whereas "10" is the distance in degrees if you have geo="true", otherwise whatever units your data was put in. You can use that with or without JTS since Spatial4j has a native BufferedLineString shape. But FYI it doesn't support geo="true" very well (i.e. working in degrees); the buffer will be skewed very much away from the equator. So you could set geo="false" and supply, say, web-mercator bounding box and work in that Euclidean/2D projected space. Another FYI, Lucene has a "Geo3d" package within the Spatial3d module that has a native implementation of a buffered LineString as well, one that works on the surface of the earth. It hasn't yet been hooked into Spatial4j, after which Solr would need no changes. There's a user "Chris" who is working on that; it's filed here: https://github.com/locationtech/spatial4j/issues/134 Good luck. ~ David On Tue, Mar 15, 2016 at 2:45 PM Pradeep Chandra < pradeepchandra....@gmail.com> wrote: > Hi Sir, > > I want to draw a polyline along the route given by google maps (from one > place to another place). > > I applied the logic of calculating parallel lines between the two markers > on the route on both sides of the route. Because of the non-linear nature > of the route. In some cases the polyline is overlapping. > > Finally what I am willing to do is by drawing that polyline along the > route. I will give that polygon go Solr in order to get the results within > the polygon. But where the problem I am getting is because of the > overlapping nature of polyline, the Solr is not taking that shape. > > Can u suggest me a logic to draw a polyline along the route / Let me know > is there any type to fetch the data with that type of polyline also in Sorl. > > I construct a polygon with 300 points. But for that solr is not giving any > result..Where as it is giving for results for polygon having points of < > 200...Can u tell me about the max no.of points to construct a polygon using > solr...Or it is restricted to that many points in solr. > > I am sending some images of my final desired one & my applied one. Please > find those attachments. > > Thanks and Regards > M Pradeep Chandra > -- Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker LinkedIn: http://linkedin.com/in/davidwsmiley | Book: http://www.solrenterprisesearchserver.com