+1 to David's patch from SOLR-2155. 

It would be great to implement. Great job using GDAL on converting the WKT Adam!

Cheers,
Chris

On Feb 8, 2011, at 8:18 PM, Adam Estrada wrote:

> I just came across a ~nudge post over in the SIS list on what the status is 
> for that project. This got me looking more in to spatial mods with Solr4.0.  
> I found this enhancement in Jira. 
> https://issues.apache.org/jira/browse/SOLR-2155. In this issue, David 
> mentions that he's already integrated JTS in to Solr4.0 for querying on 
> polygons stored as WKT. 
> 
> It's relatively easy to get WKT strings in to Solr but does the Field type 
> exist yet? Is there a patch or something that I can test out? 
> 
> Here's how I would do it using GDAL/OGR and the already existing csv update 
> handler. http://www.gdal.org/ogr/drv_csv.html
> 
> ogr2ogr -f CSV output.csv input.shp -lco GEOMETRY=AS_WKT
> This converts a shapefile to a csv with the geometries in tact in the form of 
> WKT. You can then get the data in to Solr by running the following command.
> curl 
> "http://localhost:8983/solr/update/csv?commit=true&separator=%2C&fieldnames=id,attr1,attr2,attr3,geom&stream.file=C:\tmp\output.csv&overwrite=true&stream.contentType=text/plain;charset=utf-8";
> There are lots of flavors of geometries so I suspect that this will be a 
> daunting task but because JTS recognizes each geometry type it should be 
> possible to work with them. 
> Does anyone know of a patch or even when this functionality might be included 
> in to Solr4.0? I need to query for polygons ;-)
> Thanks,
> Adam
> 
> 
> 


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Chris Mattmann, Ph.D.
Senior Computer Scientist
NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA
Office: 171-266B, Mailstop: 171-246
Email: chris.a.mattm...@nasa.gov
WWW:   http://sunset.usc.edu/~mattmann/
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adjunct Assistant Professor, Computer Science Department
University of Southern California, Los Angeles, CA 90089 USA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply via email to