Yeap, AFAIK you can only send the field in WKT format POINT (X Y), here is my definition for lat lons using polygons in the map:

*JTS field definition:*

        <!-- Spatial field type -->
<fieldType name="location_rpt" class="solr.SpatialRecursivePrefixTreeFieldType"
spatialContextFactory="com.spatial4j.core.context.jts.JtsSpatialContextFactory"
units="degrees" distErrPct="0.010" maxDistErr="0.000005"/>

*JTS field:*

        <!-- JTS spatial polygon field -->
<field name="usergeopolygon" type="location_rpt" indexed="true" stored="false" required="false" multiValued="true"/>

Where "usergeopolygon" could be really anything: POINT, POLYGON, MULTIPOLYGON; depending on the actual value you can do queries like:

*usergeopolygin:Intersects(POINT(X Y))*

HTH,

Guido.

On 14/10/13 13:11, Shahbaz lodhi wrote:
Thanks Guido for the reply,
Just to clarify; this means that we cannot index JTS POINT in format
like Pt(x=55.76056,y=24.19167).
Is that so?


Thanks again.


On Mon, Oct 14, 2013 at 4:20 PM, Guido Medina <guido.med...@temetra.com>wrote:

WKT format should work, like explained in the wiki:

http://en.wikipedia.org/wiki/**Well-known_text<http://en.wikipedia.org/wiki/Well-known_text>

Guido.

On 14/10/13 11:50, Shahbaz lodhi wrote:

Hi,

*Story:*
I am trying to index *JTS point* in following format; not successful
though:

Pt(x=55.76056,y=24.19167)
It is the format that i get by ctx.readShape( shapeString ).

I don't get any error at reading shape or adding shape
to solrInputDocument but prompts "*error reading WKT*" on adding document
to solr (i.e. solrServer.add(**solrInputDocument)).
*
*

*Question:*

Is it a legal way to index:
solrInputDocument.addField("**myGeoField",
JtsSpatialContext.GEO.**readShape(shapeString));
solr.add(solrInputDocument);

   or I'll have to stick to the WKT format.






Any help will be highly appreciated.

Thanks,

Shahbaz



Reply via email to