Skip to main content
Cartegraph Campus

Data Types for REST API

This feature may not be available in every package. Not sure if you have this feature or you want to learn more about it? Send us a message at support@cartegraph.com. 

Cartegraph's API is a licensed product that requires a purchase and verified ownership before production use.

Boolean

  • Allowed False values
    • 0
    • "0"
    • FALSE
    • "False" - case insensitive string
  • Allowed True values
    • 1
    • "1"
    • TRUE
    • "True" - case insensitive string
  • Examples
    • {'Retired': 0}
    • {'Retired': "0"}
    • {'Retired': FALSE}
    • {'Retired': "FaLsE"}
    • {'Retired': 1}
    • {'Retired': "1"}
    • {'Retired': TRUE}
    • {'Retired': "tRuE"}

Date / DateTime / Time

The Rest API uses the International Standard for the representation of dates and times: ISO 8601.

Formats

The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.

  • Year and month
    • YYYY-MM (for example, 1997-07)
  • Complete date
    • YYYY-MM-DD (for example, 1997-07-16)
  • Complete date plus hours, minutes and seconds
    • YYYY-MM-DDThh:mm:ssTZD (for example, 1997-07-16T19:20:30+01:00)
  • Complete date plus hours, minutes, seconds and a decimal fraction of a second
    • YYYY-MM-DDThh:mm:ss.sTZD (for example, 1997-07-16T19:20:30.45+01:00)


Where:

 YYYY = four-digit year
 MM   = two-digit month (01=January, etc.)
 DD   = two-digit day of month (01 through 31)
 hh   = two digits of hour (00 through 23) (am/pm NOT allowed)
 mm   = two digits of minute (00 through 59)
 ss   = two digits of second (00 through 59)
 s    = one or more digits representing a decimal fraction of a second
 TZD  = time zone designator (Z or +hh:mm or -hh:mm)


Examples

1994-11-05T08:15:30-06:00 corresponds to November 5, 1994, 8:15:30 am, US Central Standard Time.

1994-11-05T13:15:30Z corresponds to the same instant.


Number

A double precision floating-point format in JavaScript depending on implementation.

Values SHOULD NOT be quoted Octal and hexadecimal formats are not used.

No NaN or Infinity is used in Number.

Types

  • Integer
    • Digits 1-9, 0 and positive or negative
  • Fraction
    • Fractions like .3, .9
  • Exponent
    • Exponent like e, e+, e-,E, E+, E-

Syntax

{ string : number value, .......}

Examples

{'Units': 97}


Quantity

A Quantity is a number with a unit.

Syntax

Two formats are supported for PUT and POST:

String

  • string: string containing the number and unit separated by a space

Quantity Dictionary Object

  • string: { "Amount": number, "Unit": string }

Examples

"HeightField": "2 in"

"HeightField": {
   "Amount": 2,
   "Unit": "in"
}


String (Text)

A sequence of zero or more double or single quoted characters with backslash escaping.

Character is a single character string (in other words, a string with length 1).

Characters that need to be backslashed

  • "
    • double quotation
  • \
    • reverse solidus
  • /
    • solidus
  • b
    • backspace
  • f
    • form feed
  • n
    • new line
  • r
    • carriage return
  • t
    • horizontal tab
  • u
    • four hexadecimal digits (for example, \u2122 - Trademark)

Syntax

{ string : "string value", .......}

Example

{'Name': 'Brian\u2122'}


CgShape

Represents how geometry is stored in Cartegraph OMS. Any class with a non-zero GeoType contains a property called CgShape which contains the geographic coordinate information for the record. This field will not appear in the Metadata listing for a class.

The only coordinate system supported is WGS 84.

Properties

  • Points
    • An array of point objects. Each point contains a Lat and a Lng property.
    • The order of the Points is important as it indicates the drawing order of lines and polygons.
    • A polygon's first and last point must be the same. For convenience when creating or updating the shape, specifying the last point for a polygon is not required--the system will automatically add it for you when you have at least 3 points (for example, if you provided 3 points of a triangle polygon and didn't specify the 4th and last point to close the polygon).
  • Breaks
    • An array of integers that correspond to indexes in the Points array that describe complex geometry (for example, lines with multiple parts, polygons with holes, and polygons with islands).
  • Center
    • A point object representing the calculated center of the shape. This value is derived from the Points property and is read-only.
  • ShapeType
    • An integer that represents the type of the shape
    • 1
      • Point
    • 2
      • Line
    • 3
      • Polygon

Relationship of ShapeType with Points and Breaks

  • ShapeType = Point
    • List of Points has one point, ShapeType = Point. No Breaks.
  • ShapeType = Line
    • Single line string: List of Points has points in order, ShapeType = Line. No Breaks.
    • Multiple: List of Points has all points in order, ShapeType = Line. Breaks list has index of each line's starting point.
  • ShapeType = Polygon
    • Simple: List of Points has points CCW. No Breaks.
    • With holes: List of Points has all points, exterior ring CCW, interiors CW. Breaks list has negative indexes of interior rings (zero index of exterior ring not included).
    • Multiple: List of Points has all points, exterior rings CCW, interiors CW. Breaks list has index of start of each ring, zero or positive for exterior, negative for interior.

Complex Geometry

  • A shape with Breaks has complex geometry. Complex geometry cannot be edited in the Cartegraph OMS user interface, but it can be edited in Esri ArcMap. Refer to separate documentation for Cartegraph OMS and Esri Integration to learn more.

Creating and Updating

  • When providing the CgShape, the entire CgShape must be provided (Points, Breaks, ShapeType).
  • To delete the CgShape value, set it to null.

Examples

Point

"CgShape": {
    "Points": [
        {
            "Lat": 42.479487828076024,
            "Lng": -90.67411422729492
        }
    ],
    "Breaks": [],
    "ShapeType": 1,
    "Center": {
      "Lat": 42.479487828076024,
      "Lng": -90.67411422729492
    }
}

Line

"CgShape": {
    "Points": [
        {
            "Lat": 42.47984389955722,
            "Lng": -90.67418932914734
        },
        {
            "Lat": 42.47923462045663,
            "Lng": -90.6745970249176
        },
        {
            "Lat": 42.47936913713201,
            "Lng": -90.67382454872131
        },
        {
            "Lat": 42.47970147120787,
            "Lng": -90.67489743232728
        }
    ],
    "Breaks": [],
    "ShapeType": 2,
    "Center": {
      "Lat": 42.479487828076024,
      "Lng": -90.67411422729492
    }
}

Line with Breaks (a 3-piece Line)

"CgShape": {
    "Points": [
        {
            "Lat": 42.445920241057095,
            "Lng": -90.6643833075052
        },
        {
            "Lat": 42.44592024137133,
            "Lng": -90.65920797901866
        },
        {
            "Lat": 42.444064260757,
            "Lng": -90.66434761628952
        },
        {
            "Lat": 42.444028569061096,
            "Lng": -90.65924367081952
        },
        {
            "Lat": 42.4424224324853,
            "Lng": -90.66441899912827
        },
        {
            "Lat": 42.44249381680681,
            "Lng": -90.65931505467019
        }
    ],
    "Breaks": [0, 2, 4],
    "ShapeType": 2,
    "Center": {
      "Lat": 42.479487828076024,
      "Lng": -90.67411422729492
    }
}

Polygon

"CgShape": {
    "Points": [
        {
            "Lat": 42.47951156623772,
            "Lng": -90.67227959632874
        },
        {
            "Lat": 42.4793533116557,
            "Lng": -90.67193627357484
        },
        {
            "Lat": 42.47929792245744,
            "Lng": -90.67176461219788
        },
        {
            "Lat": 42.47949574079741,
            "Lng": -90.6715714931488
        },
        {
            "Lat": 42.479776641667854,
            "Lng": -90.67124426283992
        },
        {
            "Lat": 42.48004765089806,
            "Lng": -90.67154735298652
        },
        {
            "Lat": 42.47971729659599,
            "Lng": -90.67176461219788
        },
        {
            "Lat": 42.479452220391295,
            "Lng": -90.67171096839002
        },
        {
            "Lat": 42.47951156623772,
            "Lng": -90.67227959632874
        }
    ],
    "Breaks": [],
    "ShapeType": 3,
    "Center": {
      "Lat": 42.479487828076024,
      "Lng": -90.67411422729492
    }
}

Common Error Messages

  • CgShape value is not a valid Shape.
    • Occurs when validation is performed on the CgShape (including Points, Breaks, and ShapeType).
  • CgShape ShapeType is not compatible with the class geometry type.
    • Occurs when the CgShape's ShapeType is not compatible with the class/recordset's geometry type. For example, if the class geometry is Line then the CgShape's ShapeType for records of that class must also be Line.
    • If the class/recordset is Tasks or if the class/recordset geometry type is Mixed then this validation will not occur. Currently there are no existing examples of the Mixed geometry type in Cartegraph OMS.