Skip to content

Commit

Permalink
Update geospatial for sync support
Browse files Browse the repository at this point in the history
  • Loading branch information
cbullinger committed Dec 6, 2023
1 parent 6e66c33 commit f0771e5
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 12 deletions.
6 changes: 6 additions & 0 deletions source/includes/important-cant-persist-geospatial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. important:: Cannot Persist Geospatial Data Types

Currently, geospatial data types *cannot* be persisted. For example, you
can't declare a property that is of type ``GeoBox``.

These types can only be used as arguments for geospatial queries.
14 changes: 13 additions & 1 deletion source/sdk/dotnet/model-data/data-types/geospatials.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,28 @@ Geospatial Data Types - .NET SDK
:depth: 2
:class: singlecol

.. versionadded:: 11.1.0

Geospatial data, or "geodata", specifies points and geometric objects on the Earth's
surface. With the geodata types, you can create queries that check whether a given
point is contained within a shape. For example, you can find all coffee shops within
15 km of a specified point.

.. include:: /includes/no-geospatial-sync.rst
.. versionchanged:: 11.6.1
Geospatial data supported in Atlas Device Sync

Realm .NET SDK version 11.16.1 and later adds support for geospatial data
in Atlas Device Sync. This allows you to subscribe to geospatial queries
in a synced realm. For more information, refer to :ref:`<dotnet-flexible-sync>`.

If you try to subscribe to a geospatial query with an older version of the SDK,
you will receive a server error and cause a compensating write.

Geospatial Data Types
---------------------

.. include:: /includes/important-cant-persist-geospatial.rst

.. _geopoint:

GeoPoint
Expand Down
11 changes: 11 additions & 0 deletions source/sdk/dotnet/sync/flexible-sync.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,17 @@ specific object type. In your Flexible Sync subscriptions, you can have
subscriptions on several different object types or several queries on the same
object type.

You can't create subscriptions for :ref:`asymmetric objects <dotnet-data-ingest>` and
because they only send data to your App Services backend.

In the Realm .NET version 11.6.1 and later, you can create subscriptions to
geospatial queries. If you try to subscribe to a geospatial query with an
older version of the SDK, you will receive a server error and cause a
compensating write.

For more information, refer to :ref:`<geospatial>` in the App Services
documentation.

.. _dotnet-sync-add-subscription:

Add a Subscription
Expand Down
17 changes: 10 additions & 7 deletions source/sdk/kotlin/realm-database/schemas/geospatials.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ that support querying with geospatial data. These queries can check whether a gi
point is contained within a shape. For example, you can find all coffee shops within
15 km of a specified point.

.. include:: /includes/no-geospatial-sync.rst
.. versionchanged:: 1.13.0
Geospatial data supported in Atlas Device Sync

Kotlin SDK version 1.13.0 and later adds support for geospatial data
in Atlas Device Sync. This allows you to subscribe to geospatial queries
in a synced realm. For more information, refer to :ref:`<kotlin-subscriptions>`.

If you try to subscribe to a geospatial query with an older version of the SDK,
you will receive a server error and cause a compensating write.

Geospatial Data Types
---------------------
Expand All @@ -32,12 +40,7 @@ The Kotlin SDK supports geospatial queries using the following data types:
- GeoBox
- GeoPolygon

.. important:: Cannot Persist Geospatial Data Types

Currently, geospatial data types *cannot* be persisted. For example, you
can't declare a property that is of type ``GeoBox``.

These types can only be used as arguments for geospatial queries.
.. include:: /includes/important-cant-persist-geospatial.rst

.. _kotlin-geopoint:

Expand Down
20 changes: 18 additions & 2 deletions source/sdk/kotlin/sync/subscribe.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ You might have multiple subscriptions if you have
many types of Realm objects. You can also have multiple subscriptions on the same
object type.

However, note the following if you use :ref:`linked objects <kotlin-relationships>` or
:ref:`asymmetric objects <kotlin-asymmetric-objects>` in your app:
However, if you use :ref:`linked objects <kotlin-relationships>`,
:ref:`asymmetric objects <kotlin-asymmetric-objects>`, or
:ref:`geospatial data <kotlin-geospatial>` in your app, refer the following
sections for additional information:

Linked Objects
``````````````
Expand All @@ -80,6 +82,20 @@ those objects. If your app contains asymmetric objects and non-asymmetric object
same realm, you can add Flexible Sync subscription queries for the
non-asymmetric objects.

Geospatial Data
```````````````

.. versionchanged:: 1.13.0
Geospatial data supported in Atlas Device Sync

In Kotlin SDK version 1.13.0 and later, you can create subscriptions to
geospatial queries. If you try to subscribe to a geospatial query with an
older version of the SDK, you will receive a server error and cause a
compensating write.

For more information, refer to :ref:`<geospatial>` in the App Services
documentation.

Initial Subscriptions
~~~~~~~~~~~~~~~~~~~~~

Expand Down
12 changes: 11 additions & 1 deletion source/sdk/node/model-data/data-types/geospatial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ surface. With the geodata types, you can create queries that check whether a giv
point is contained within a shape. For example, you can find all coffee shops within
15 km of a specified point.

.. include:: /includes/no-geospatial-sync.rst
.. versionchanged:: 12.3.0
Geospatial data supported in Atlas Device Sync

Realm Node.js SDK v12.3.0 and later adds support for geospatial data
in Atlas Device Sync. This allows you to subscribe to geospatial queries
in a synced realm. For more information, refer to :ref:`<node-flexible-sync>`.

If you try to subscribe to a geospatial query with an older version of the SDK,
you will receive a server error and cause a compensating write.

Geospatial Data Types
---------------------

.. include:: /includes/important-cant-persist-geospatial.rst

.. _node-geopoint:

GeoPoint
Expand Down
8 changes: 8 additions & 0 deletions source/sdk/node/sync/flexible-sync.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ You can't create subscriptions for :ref:`Data Ingest <optimize-data-ingest>` and
:ref:`asymmetric objects <node-define-an-asymmetric-object>` because they only
send data to your app's backend.

In the Realm Node.js SDK v12.3.0 and later, you can create subscriptions to
geospatial queries. If you try to subscribe to a geospatial query with an
older version of the SDK, you will receive a server error and cause a
compensating write.

For more information, refer to :ref:`<geospatial>` in the App Services
documentation.

.. important:: Flexible Sync Query Limitations

Flexible Sync subscriptions only support a subset of the RQL query operators.
Expand Down
12 changes: 11 additions & 1 deletion source/sdk/react-native/model-data/data-types/geospatial.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,21 @@ surface. With the geodata types, you can create queries that check whether a giv
point is contained within a shape. For example, you can find all coffee shops within
15 km of a specified point.

.. include:: /includes/no-geospatial-sync.rst
.. versionchanged:: 12.3.0
Geospatial data supported in Atlas Device Sync

Realm.js v12.3.0 and later adds support for geospatial data
in Atlas Device Sync. This allows you to subscribe to geospatial queries
in a synced realm. For more information, refer to :ref:`<react-native-data-types-geospatial>`.

If you try to subscribe to a geospatial query with an older version of the SDK,
you will receive a server error and cause a compensating write.

Geospatial Data Types
---------------------

.. include:: /includes/important-cant-persist-geospatial.rst

To query against geospatial data, you can use the ``geoWithin`` operator
with :ref:`RQL <rql>`. The ``geoWithin`` operator takes the ``coordinates``
property of an embedded object that defines the point we're querying, and
Expand Down
8 changes: 8 additions & 0 deletions source/sdk/react-native/sync-data/flexible-sync.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ You can't create subscriptions for :ref:`Data Ingest <optimize-data-ingest>` and
:ref:`asymmetric objects <react-native-define-an-asymmetric-object>` because
they only send data to your App Services backend.

In the Realm.js v12.3.0 and later, you can create subscriptions to
geospatial queries. If you try to subscribe to a geospatial query with an
older version of the SDK, you will receive a server error and cause a
compensating write.

For more information, refer to :ref:`<geospatial>` in the App Services
documentation.

.. important:: Flexible Sync Query Limitations

Flexible Sync subscriptions only support a subset of the RQL query operators.
Expand Down

0 comments on commit f0771e5

Please sign in to comment.