Mailing List Archive

Indexing & Searching Geometries ( MultiLine & MultiPolygon )
Hello Forum,

I want to create a Reverse Geocode service for data i have in this data set
there is Points, Lines, MultiLines, Polygons and MultiPolygons some how i
was able to Index Point, Line And Poligon And created search queries for
those indexes .But i can not understand how i will index Other Geometry
Types is there any documents or code examples for Lucene Spatial Indexing I
have seen Component2D but There is only InMemeory search as i understand.

Lucene 8.6.0
Jdk 12



--
Sent from: https://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org
Re: Indexing & Searching Geometries ( MultiLine & MultiPolygon ) [ In reply to ]
Hello!

Let's consider polygons. I imagine you are doing something like this to
index one polygon:

Polygon polygon = ....
Document document = new Document();
Field[] fields = LatLonShape.createIndexableFields(FIELDNAME, polygon);
for (Field f : fields) {
document.add(f);
}

So a multipolygon is just an array of polygons, so you can easily do:

Polygon[] multiPolygon = ....
Document document = new Document();
for (Polygon polygon: multiPolygon) {
Field[] fields = LatLonShape.createIndexableFields(FIELDNAME, polygon);
for (Field f : fields) {
document.add(f);
}
}

Hope it makes sense,

I.

On Fri, Oct 2, 2020 at 1:48 PM thturk <tahaturk25@hotmail.com> wrote:

> Hello Forum,
>
> I want to create a Reverse Geocode service for data i have in this data set
> there is Points, Lines, MultiLines, Polygons and MultiPolygons some how i
> was able to Index Point, Line And Poligon And created search queries for
> those indexes .But i can not understand how i will index Other Geometry
> Types is there any documents or code examples for Lucene Spatial Indexing
> I
> have seen Component2D but There is only InMemeory search as i understand.
>
> Lucene 8.6.0
> Jdk 12
>
>
>
> --
> Sent from:
> https://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-user-help@lucene.apache.org
>
>
Re: Indexing & Searching Geometries ( MultiLine & MultiPolygon ) [ In reply to ]
Thank you for your fast response.

Yes i have tired this. Actually also There is directly polygon created from
geojson recommend me to do dame. Because its returns Polygon Array But is
it the Most efficient method if indexing spatial data ? Ana same For
MultiLine They are also type of Line Arrays. Just i have to convert Them
Into Line array There is no Line creater from geojson. as i checked
documentation .



--
Sent from: https://lucene.472066.n3.nabble.com/Lucene-Java-Users-f532864.html

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org