Indexing and querying polygons

Using United States of America state data, this tutorial demonstrates how to index and query geospatial shapes, such as Polygons and MultiPolygons.

Geospatial data is stored in the database in WKT (Well Known Text) format. To support Polygons and MultiPolygons fields, set the field type in the table index schema to solr.SpatialRecursivePrefixTreeFieldType.

SpatialRecursivePrefixTreeFieldType supports multiValued spatial data. Most states are describable as Polygons, but others such as Hawaii and Alaska are MultiPolygons.

Polygonal searches use the following geospatial predicates:

  • Intersects: Matches if the indexed value overlaps the search criteria.

  • IsWithin: Matches if the indexed value completely encapsulates the search criteria.

  • IsDisjointTo: Matches if the index value does not overlap or touch the search criteria.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com