Message:

Subscribe rss
Blog categories
All | Backendless features
Feature 100: Creating relationships between data objects and geopoints
April 18, 2015 by markpiller
Spread the love

In my post yesterday I described how to declare a relationship in a data table schema with a geopoint. Now that you know how to create a table column which contains one or more geo points, I am going to show how to populate it with data.

If you follow the post from yesterday and add a table column of the GEOPOINT  type, your data objects in Backendless console will appear as shown below. Notice the location column:
geopoint relationship column in table - Feature 100: Creating relationships between data objects and geopoints

None of the objects in the table have any related geopoints – the cells in the location column are empty. However, there is a plus icon which lets you create a relation between a data object and a geo point. When you click the plus icon, you will see the following popup (assuming you have geopoints in your Geolocation storage):
selecting a geo point - Feature 100: Creating relationships between data objects and geopoints

The popup window includes a list of geopoints for the selected geocategory. There is also a way to search for geopoints using SQL queries. Every geo point in the list has a radio button which lets you select it. The radio buttons are shown for the one-to-one relations between a data object and a geo point. If the relation is a one-to-many, every geo point has its own checkbox. To assign a geo point to a data object, click the radio button for the geo point and click the Set Related GeoPoint button.

Once a relationship is established, the coordinates of the related geo point are shown in the column:
data to geo relation established - Feature 100: Creating relationships between data objects and geopoints

When you click the coordinates link, console displays the geopoint in the Geolocation screen:
geopoint in geolocation - Feature 100: Creating relationships between data objects and geopoints

Enjoy!

 

Share this post
Tweet about this on TwitterShare on FacebookGoogle+