You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Pradeep Chandra <pr...@gmail.com> on 2016/03/15 19:45:01 UTC
Regarding google maps polyline to use IsWithin(POLYGON(())) in solr
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
Re: Regarding google maps polyline to use IsWithin(POLYGON(())) in
solr
Posted by Pradeep Chandra <pr...@gmail.com>.
Hi Sir,
I downloaded the file from
http://search.maven.org/#artifactdetails%7Ccom.vividsolutions%7Cjts-core%7C1.14.0%7Cjar
....as you said in my previous post. Then I copied the .jar file into the
server/lib directory...That is the thing only I did. At the first time I
tried with small polygons. It gives the output...
Now I am trying with the polygon of having above 500 points...It is not
giving anything ...It is not showing any error also...Simply It is showing a
blank page when I entered that query URL. Kindly consider this and let me
know whether there is any other configuration I have to do.
Thanks and regards
M Pradeep Chandra
--
View this message in context: http://lucene.472066.n3.nabble.com/Regarding-google-maps-polyline-to-use-IsWithin-POLYGON-in-solr-tp4263975p4264311.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Regarding google maps polyline to use IsWithin(POLYGON(())) in solr
Posted by David Smiley <da...@gmail.com>.
JTS doesn't has any vertex limit on the geometries. So I don't know why
your query isn't working.
On Wed, Mar 16, 2016 at 1:58 AM Pradeep Chandra <
pradeepchandra.551@gmail.com> wrote:
> Hi Sir,
>
> Let me give some clarification on IsWithin(POLYGON(())) query...It is not
> giving any result for beyond 213 points of polygon...
>
> Thanks
> M Pradeep Chandra
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Regarding-google-maps-polyline-to-use-IsWithin-POLYGON-in-solr-tp4263975p4264046.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>
--
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com
Re: Regarding google maps polyline to use IsWithin(POLYGON(())) in
solr
Posted by Pradeep Chandra <pr...@gmail.com>.
Hi Sir,
Let me give some clarification on IsWithin(POLYGON(())) query...It is not
giving any result for beyond 213 points of polygon...
Thanks
M Pradeep Chandra
--
View this message in context: http://lucene.472066.n3.nabble.com/Regarding-google-maps-polyline-to-use-IsWithin-POLYGON-in-solr-tp4263975p4264046.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Regarding google maps polyline to use IsWithin(POLYGON(())) in solr
Posted by David Smiley <da...@gmail.com>.
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.551@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