Geography

Geography Data Types are special cases in the Database which allow you to store geographical data based on the different characteristics. When you are adding content to one of these columns a different interface will show up. There will be a map that you can manipulate to find exactly what you need and make the shapes that are useful to your app. An example of this can be a polygon around a certain area that acts like an invisible fence that your users can trigger when they enter it with your app.

Features of the map: 1. Search Box: you search for any address in this input field. 2. Clear: this clears all items that were created on the map. 3. Add: this creates a new item on the map, depending on the selected type you can have only 1 item or multiple items. 4. Save: this saves the added item(s). 5. + (zoom in): this gives a more magnified view of the map for more specific locations. 6. - (zoom out): this gives a bigger picture view of the map to draw broader items.

Point:

Point of Lat/Long coordinates. This allows you to put a single point on the map. This point is then converted into the relative Latitude and Longitude coordinates. You can click on the point and drag it to where you want it to go.

JSON Data Format:

"point": {
    "type": "point",
    "data": {
      "lng": a,
      "lat": b
    }
  }

Point Collection:

Collection of points.

JSON Data Format:

"point_collection": {
    "type": "points",
    "data": [
      {
        "lng": a,
        "lat": b
      },
      {
        "lng": c,
        "lat": d
      },
      {
        "lng": e,
        "lat": f
      }
    ]
  }

Path:

Path of Lat/Long coordinates. This creates a line using two connected points. By clicking on the line, you can drag it to where you want it. By clicking the ends of the line you can increase or decrease the distance between the two points.

JSON Data Format:

"path": {
    "type": "path",
    "data": [
      {
        "lng": a,
        "lat": b
      },
      {
        "lng": c,
        "lat": d
      }
    ]
  }

Path Collection:

Collection of paths.

JSON Data Format:

  "path_collection": {
    "type": "paths",
    "data": [
      [
        {
          "lng": a,
          "lat": b
        },
        {
          "lng": c,
          "lat": d
        },
        {
          "lng": e,
          "lat": f
        }
      ],
      [
        {
          "lng": g,
          "lat": h
        },
        {
          "lng": i,
          "lat": j
        }
      ]
    ]
  }

Polygon:

Polygon of Lat/Long coordinates.

JSON Data Format:

  "polygon": {
    "type": "poly",
    "data": [
      {
        "lng": a,
        "lat": b
      },
      {
        "lng": c,
        "lat": d
      },
      {
        "lng": e,
        "lat": f
      },
      {
        "lng": g,
        "lat": h
      },
      {
        "lng": i,
        "lat": j
      }
    ]
  }

Polygon Collection:

Collection of polygons.

JSON Data Format:

"polygon_collection": {
    "type": "polys",
    "data": [
      [
        {
          "lng": a,
          "lat": b
        },
        {
          "lng": c,
          "lat": d
        },
        {
          "lng": e,
          "lat": f
        },
        {
          "lng": g,
          "lat": h
        },
        {
          "lng": i,
          "lat": j
        }
      ],
      [
        {
          "lng": k,
          "lat": l
        },
        {
          "lng": m,
          "lat": n
        },
        {
          "lng": o,
          "lat": p
        },
        {
          "lng": q,
          "lat": r
        },
        {
          "lng": s,
          "lat": t
        }
      ]
    ]
  }

Last updated