Hello, I guess I'm closer. But my geom field does not show up in the index.
I have a table full of polys, stored as SQL Server Geometry Type.
Taken from the example schema I have:
..
<field name="geom" type="location_rpt" indexed="true" stored="true"/>
..
In my data-config.xml I have:
<entity name="data" dataSource="ds1" pk="key"
query="SELECT wt.Id, wt.Name,
wt.WorkTypeTypeId,wt.ChildId,wt.CreatedDate,wt.ModifiedDate,wt.Year,
wta.GEOM.STAsText(), wta.OBJECTID
FROM dbo.WorkTypes wt Inner Join dbo.WorkTypeAreas wta ON wt.Id =
wta.WorkTypeId">
<field column="Id" name="id" />
<field column="ChildId" name="childid" />
<field column="WorkTypeTypeId" name="worktypetypeid" />
<field column="Name" name="name" />
<field column="CreatedDate" name="createddate" />
<field column="ModifiedDate" name="modifieddate" />
<field column="UserId" name="userid" />
<field column="Year" name="year" />
<field column="GEOM" name="geom" />
<field column="OBJECTID" name="objectid" />
</entity>
OBJECTID shows up fine in my updated index, gut GEOM does not. The index was
successful and I don't see any errors in the console or the log (from the web)
I am starting solr like so:
java -Dsolr.solr.home=c:\AddedSoftware\solr-4.90\ocsirasspatial\solr
-Djetty.class.path=c:\AddedSoftware\solr-4.9.0\jts-1.13\lib -jar start.jar
Based on the above, what am I missing to get this to work. Maybe I am
overlooking an issue in the console?
Thanks
Alex Bostic
GIS Developer
URS Corporation
12420 Milestone Center Drive, Suite 150
Germantown, MD 20876
direct line: 301-820-3287
cell line: 301-213-2639
-----Original Message-----
From: Bostic, Alex [mailto:[email protected]]
Sent: Wednesday, August 20, 2014 4:41 PM
To: [email protected]
Subject: RE: Indexing and Querying MS SQL Server 2012 Spatial
Ok Great, I'm just going to dive in and see if I can index my data. Does
spatial reference matter?
Alex Bostic
GIS Developer
URS Corporation
12420 Milestone Center Drive, Suite 150
Germantown, MD 20876
direct line: 301-820-3287
cell line: 301-213-2639
-----Original Message-----
From: Pires, Guilherme [mailto:[email protected]]
Sent: Wednesday, August 20, 2014 4:30 PM
To: [email protected]
Subject: RE: Indexing and Querying MS SQL Server 2012 Spatial
Hello,
I've been working with Solr together with JTS and use location_rpt class for
the geometry field for a while now. (However, I must say that the index grew a
lot when used this class instead of the geohash for simple points ..so use it
only if you really need to index polylines and/or polygons)
I actually already successfully connected solr to postGis and oracle spatial
via DIH but in this live website ( http://cascaismap.com ) we had a GE
Smallworld as the GIS system so it was easier just to build a sync engine that
periodically queries differences from the GIS and push them into solr via xml
document. This project has already couple of years now so a lot would be
different now.
In that website, solr provides, obviously, all the text search on the top and
also 70% of the themes available on the treeview on the left (expand in the red
button) that are result of a bounding box query to geometry index in solr.
Something like this : (...)q=bounds:Intersects(-9.463118366688718
38.67913579372146 -9.370549969166746 38.7109390712568)(...)
After this, we actually provided for a different project, a similar sync
mechanism but between in-house solr instances and google maps engine datastore
in the cloud and it works like a charm.
Guilherme Pires
Geospatial Intelligence @ CGI
[email protected]
________________________________________
De: [email protected] [[email protected]]
Enviado: quarta-feira, 20 de Agosto de 2014 18:49
Para: [email protected]
Assunto: Re: Indexing and Querying MS SQL Server 2012 Spatial
Hi Alex,
I guess a spatial tutorial might be helpful, but there isn't one. There is a
sample at the Lucene-spatial layer but not up at Solr. You need to use WKT
syntax for line's and polys, and you may do so as well for other shapes. And
in the schema use location_rpt copied from Solr's example schema for starters,
but modified as the ref guide & wiki show to use JTS.
The ref guide, wiki, and I would guess that book should show how to to a
bounding box query using {!bbox} - it's pretty simple.
~ David Smiley
Freelance Apache Lucene/Solr Search Consultant/Developer
http://www.linkedin.com/in/davidwsmiley
On Tue, Aug 19, 2014 at 11:25 AM, Bostic, Alex <[email protected]> wrote:
> Hello I'm new to Solr:
> I have a SQL Server 2012 database with spatial columns
> (points/lines/polys) Do you have any resources to point to for the
> following Creating a Solr index of a sql server spatial table Bounding
> Box query (intersect) example, possibly with front-end from GMaps or
> OpenLayers I'm currently reading Apache Solr Beginner's Guide and
> have reviewed
> https://wiki.apache.org/solr/SolrAdaptersForLuceneSpatial4
> I am able to index and query my non spatial data, I am just looking
> for some resource that may have some more detail about how to set everything
> up.
> I can provide more detail if needed.
> Thanks
>
> Alex Bostic
> GIS Developer
> URS Corporation
> 12420 Milestone Center Drive, Suite 150 Germantown, MD 20876 direct
> line: 301-820-3287 cell line: 301-213-2639
>
>
>
> This e-mail and any attachments contain URS Corporation confidential
> information that may be proprietary or privileged. If you receive this
> message in error or are not the intended recipient, you should not
> retain, distribute, disclose or use any of this information and you
> should destroy the e-mail and any attachments or copies.
>
This e-mail and any attachments contain URS Corporation confidential
information that may be proprietary or privileged. If you receive this message
in error or are not the intended recipient, you should not retain, distribute,
disclose or use any of this information and you should destroy the e-mail and
any attachments or copies.