Skip to content

Commit ec149ae

Browse files
committed
Add missing geospatial query API descriptions
1 parent 295c666 commit ec149ae

21 files changed

+248
-39
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
A :dotnet-sdk:`GeoBox <reference/Realms.GeoBox.html>` is a
2+
rectangular shape whose bounds are determined by :dotnet-sdk:`GeoPoint
3+
<reference/Realms.GeoPoint.html>` coordinates for a bottom-left
4+
and a top-right corner.
5+
6+
In C#, you can optionally construct a ``GeoBox`` from a set of four doubles,
7+
which represent:
8+
9+
- ``left``: The longitude of the left edge of the rectangle.
10+
- ``top``: The latitude of the top edge of the rectangle.
11+
- ``right``: The longitude of the right edge of the rectangle.
12+
- ``bottom``: The latitude of the bottom edge of the rectangle.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
A :dotnet-sdk:`GeoCircle <reference/Realms.GeoCircle.html>` is a
2+
circular shape whose bounds originate from a central :dotnet-sdk:`GeoPoint
3+
<reference/Realms.GeoPoint.html>`, and has a size corresponding to
4+
a radius measured in radians. You can use the SDK's convenience
5+
:dotnet-sdk:`Distance <reference/Realms.Distance.html>` structure to
6+
easily work with radii in different units.
7+
8+
You can construct a ``Distance`` with a radius measurement in one of four units:
9+
10+
- ``FromDegrees(double)``
11+
- ``FromKilometers(double)``
12+
- ``FromMiles(double)``
13+
- ``FromRadians(double)``
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
A :dotnet-sdk:`GeoPolygon <reference/Realms.GeoPolygon.html>` is a polygon
2+
shape whose bounds consist of an outer ring, and 0 or more inner holes
3+
to exclude from the geospatial query.
4+
5+
A polygon's outer ring must contain at least three segments. The last
6+
and the first :dotnet-sdk:`GeoPoint <reference/Realms.GeoPoint.html>`
7+
must be the same, which indicates a closed polygon. This means that it takes
8+
at least four ``GeoPoint`` values to construct a polygon.
9+
10+
Inner holes in a ``GeoPolygon`` are optional, and must be entirely contained
11+
within the outer ring. Each ``GeoPoint`` collection in the ``Holes`` collection
12+
must contain at least three segments, with the same rules as the outer ring.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
The SDK provides two specialized non-persistable data types to define shapes:
2+
3+
- :dotnet-sdk:`GeoPoint <reference/Realms.GeoPoint.html>`: A
4+
struct that represents the coordinates of a point formed by a pair of
5+
doubles consisting of these values:
6+
7+
- Latitude: ranges between -90 and 90 degrees, inclusive.
8+
- Longitude: ranges between -180 and 180 degrees, inclusive.
9+
- :dotnet-sdk:`Distance <reference/Realms.Distance.html>`: A helper
10+
struct to represent and convert a distance.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
You can query geospatial data in two ways:
2+
3+
- Using the :dotnet-sdk:`GeoWithin()
4+
<reference/Realms.QueryMethods.html#Realms_QueryMethods_GeoWithin_Realms_IEmbeddedObject_Realms_GeoShapeBase_>`
5+
operator with the :ref:`LINQ <sdks-dotnet-linq>` query engine.
6+
- Using the :dotnet-sdk:`Filter()
7+
<reference/Realms.CollectionExtensions.html?q=Filter>` method with the
8+
:ref:`Realm Query Language <rql-geospatial>` ``geoWithin`` operator.
9+
10+
The examples below show the results of queries using these two ``Company``
11+
objects.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
A :flutter-sdk:`GeoCircle <realm/GeoCircle-class.html>` is a
2+
circular shape whose bounds originate from a central :flutter-sdk:`GeoPoint
3+
<realm/GeoPoint-class.html>`, and has a size corresponding to
4+
a radius measured in radians. You can use the SDK's convenience
5+
:flutter-sdk:`GeoDistance <realm/GeoDistance-class.html>` class to
6+
easily work with radii in different units.
7+
8+
The default constructor for ``GeoDistance()`` takes a double that represents
9+
a distance in radians. You can use the following convenience methods to create
10+
a ``GeoDistance`` from a different measure:
11+
12+
- ``GeoDistance.fromDegrees(double degrees)``
13+
- ``GeoDistance.fromKilometers(double kilometers)``
14+
- ``GeoDistance.fromMeters(double meters)``
15+
- ``GeoDistance.fromMiles(double miles)``
16+
17+
You can optionally access the distance value in any of these units, represented
18+
as a double.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
A :flutter-sdk:`GeoPolygon <realm/GeoPolygon-class.html>` is a polygon
2+
shape whose bounds consist of an outer ring of type :flutter-sdk:`GeoRing
3+
<realm/GeoRing.html>`, and 0 or more inner holes to exclude from the
4+
geospatial query.
5+
6+
The ``GeoRing`` is a list of three or more :flutter-sdk:`GeoPoint
7+
<reference/Realms.GeoPoint.html>` coordinates. The last
8+
and the first ``GeoPoint`` must be the same, which indicates a closed ring.
9+
This means that it takes at least four ``GeoPoint`` values to construct a
10+
polygon.
11+
12+
Inner holes in a ``GeoPolygon`` are optional, and must be entirely contained
13+
within the outer ring. Each ``GeoRing`` collection in the ``holes`` collection
14+
must contain at least three segments, with the same rules as the outer ring.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
The SDK provides two specialized non-persistable data types to define shapes:
2+
3+
- :flutter-sdk:`GeoPoint <realm/GeoPoint-class.html>`: A class that represents
4+
the coordinates of a point formed by a pair of doubles consisting of these
5+
values:
6+
7+
- ``lat``: a double value representing the latitude of a point.
8+
- ``lon````: a doubble value representing the longitude of a point.
9+
- :flutter-sdk:`GeoDistance <realm/GeoDistance/GeoDistance.html>`: A double
10+
that represents a distance in radians used to calculate the size of the
11+
circle shape. ``GeoDistance`` provides convenience methods to simplify
12+
converting degrees, kilometers, meters, and miles to radians.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can query geospatial data using the :ref:`Realm Query Language
2+
<rql-geospatial>` ``geoWithin`` operator.
3+
4+
The examples below show the results of queries using these two ``Company``
5+
objects.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
The selected language does not currently support persisting and querying
2+
geospatial data. Instead, you can manually define your own logic and types
3+
for working with geospatial data.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
A :js-sdk:`GeoPolygon <types/Realm.GeoPolygon.html>` is a polygon
2+
shape whose bounds consist of an outer ring, and 0 or more inner holes
3+
to exclude from the geospatial query.
4+
5+
A polygon's outer ring must contain at least three segments. The last
6+
and the first :js-sdk:`GeoPoint <types/Realm.GeoPoint.html>`
7+
must be the same, which indicates a closed polygon. This means that it takes
8+
at least four ``GeoPoint`` values to construct a polygon.
9+
10+
Inner holes in a ``GeoPolygon`` are optional, and must be entirely contained
11+
within the outer ring. Each ``GeoPoint`` collection in the ``holes?``
12+
collection must contain at least three segments, with the same rules as the
13+
outer ring.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
The SDK provides specialized non-persistable data types to define shapes:
2+
3+
- :js-sdk:`GeoPoint <types/Realm.GeoPoint.html>`: A type that represents the
4+
coordinates of a point. A ``GeoPoint`` can be one of three types:
5+
6+
- An object with:
7+
8+
- Latitude: a number value.
9+
- Longitude: a number value.
10+
- Altitude: an optional number value.
11+
- :js-sdk:`CanonicalGeoPoint
12+
<interfaces/Realm.CanonicalGeoPoint.html>`: an interface that satisfies the
13+
GeoJSON specifications for a point.
14+
- :js-sdk:`GeoPosition <types/Realm.GeoPosition.html>`: an array with
15+
longitude, latitude, and an optional altitude.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
A :js-sdk:`GeoBox <types/Realm.GeoBox.html>` is a rectangular shape whose
2+
bounds are determined by :js-sdk:`GeoPoint <types/Realm.GeoPoint.html>`
3+
coordinates for a bottom-left and a top-right corner.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
A :js-sdk:`GeoCircle <types/Realm.GeoCircle.html>` is a
2+
circular shape whose bounds originate from a central :js-sdk:`GeoPoint
3+
<types/Realm.GeoPoint.html>`, and has a size corresponding to
4+
a ``distance`` radius measured in radians. You can use the SDK's convenience
5+
methods to convert kilometers and miles to radians:
6+
7+
- :js-sdk:`kmToRadians() <functions/Realm.kmToRadians.html>`
8+
- :js-sdk:`miToRadians() <functions/Realm.miToRadians.html>`
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can query geospatial data using the :ref:`Realm Query Language
2+
<rql-geospatial>` ``geoWithin`` operator.
3+
4+
The examples below show the results of queries using these two ``Company``
5+
objects.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
A :kotlin-sdk:`GeoCircle <io.realm.kotlin.types.geo/-geo-circle/index.html>` is
2+
a circular shape whose bounds originate from a central :kotlin-sdk:`GeoPoint
3+
<io.realm.kotlin.types.geo/-geo-point/index.html>`, and has a size
4+
corresponding to a radius measured in radians. You can use the SDK's
5+
convenience :kotlin-sdk:`Distance
6+
<io.realm.kotlin.types.geo/-distance/index.html>` class to easily work with
7+
radii in different units.
8+
9+
You can use the following convenience methods to create a ``GeoDistance`` from
10+
different measures:
11+
12+
- ``GeoDistance.fromDegrees(double degrees)``
13+
- ``GeoDistance.fromKilometers(double kilometers)``
14+
- ``GeoDistance.fromMiles(double miles)``
15+
- ``GeoDistance.fromRadians(double radians)``
16+
17+
You can optionally access the distance value in any of these units, represented
18+
as a double.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
A :kotlin-sdk:`GeoPolygon <io.realm.kotlin.types.geo/-geo-polygon/index.html>`
2+
is a polygon shape whose bounds consist of an outer ring, and 0 or more inner
3+
holes to exclude from the geospatial query.
4+
5+
A polygon's outer ring must contain at least three segments. The last
6+
and the first :kotlin-sdk:`GeoPoint
7+
<io.realm.kotlin.types.geo/-geo-polygon/index.html>` must be the same, which
8+
indicates a closed polygon. This means that it takes at least four ``GeoPoint``
9+
values to construct a polygon.
10+
11+
Inner holes in a ``GeoPolygon`` are optional, and must be entirely contained
12+
within the outer ring. Each ``GeoPoint`` collection in the ``Holes`` collection
13+
must contain at least three segments, with the same rules as the outer ring.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
The SDK provides two specialized non-persistable data types to define shapes:
2+
3+
- :kotlin-sdk:`GeoPoint <io.realm.kotlin.types.geo/-geo-point/index.html>`: An
4+
interface that represents the coordinates of a point formed by a pair of
5+
doubles consisting of these values:
6+
7+
- Latitude: ranges between -90 and 90 degrees, inclusive.
8+
- Longitude: ranges between -180 and 180 degrees, inclusive.
9+
- :kotlin-sdk:`Distance <io.realm.kotlin.types.geo/-distance/index.html>`: A
10+
class that represents a distance used to calculate the size of the
11+
circle shape. ``Distance`` provides convenience methods to simplify
12+
converting degrees, kilometers, miles, and radians to and from the
13+
``Distance`` measure.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
A :kotlin-sdk:`GeoBox <io.realm.kotlin.types.geo/-geo-box/index.html>` is a
2+
rectangular shape whose bounds are determined by :kotlin-sdk:`GeoPoint
3+
<io.realm.kotlin.types.geo/-geo-point/index.html>`coordinates for a bottom-left
4+
and a top-right corner.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
You can query geospatial data using the :ref:`Realm Query Language
2+
<rql-geospatial>` ``geoWithin`` operator.
3+
4+
The examples below show the results of queries using these two ``Company``
5+
objects.

0 commit comments

Comments
 (0)