Oihana PHP System

GeoShape extends StructuredValue

The geographic shape of a place.

A GeoShape can be described using several properties whose values are based on latitude/longitude pairs. Either whitespace or commas can be used to separate latitude and longitude; whitespace should be used when writing a list of several such points.

Tags
see
https://schema.org/GeoShape

Table of Contents

Constants

CONTEXT  = 'https://schema.org'
JSON-LD @context declaration for Schema.org.

Properties

$_from  : string|null
The metadata to indicates the edge 'from' identifier.
$_id  : null|string
The metadata identifier of the item.
$_key  : null|string
The metadata unique key identifier of the thing.
$_rev  : null|string
The metadata revision value of the thing.
$_to  : string|null
The metadata to indicates the edge 'to' identifier.
$active  : bool|null
The active flag.
$additionalType  : array<string|int, mixed>|string|null|object
An additionalType for the item.
$address  : null|string|PostalAddress
Physical address of the item.
$addressCountry  : null|string|Country
The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a full country name such as "Singapore" can also be used.
$alternateName  : string|object|null
An alias for the item.
$box  : string|null
A box is the area enclosed by the rectangle formed by two points.
$circle  : string|null
A circle is the circular region of a specified radius centered at a specified latitude and longitude.
$created  : null|string|DateTime
Date of creation of the resource.
$description  : string|null
A short description of the item.
$disambiguatingDescription  : string|null
A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.
$elevation  : null|string|float|int
The elevation of a location (WGS 84).
$hasPart  : string|Thing|array<string|int, mixed>|null
Indicates an item that this part of this item.
$id  : null|int|string
The unique identifier of the item.
$identifier  : string|null
The identifier of the item.
$image  : string|object|null
The image reference of this resource.
$isPartOf  : string|Thing|array<string|int, mixed>|null
Indicates an item that this item is part of.
$license  : string|object|null
A legal document giving official permission to do something with the resource.
$line  : string|null
A line is a point-to-point path consisting of two or more points. A line is expressed as a series of two or more point objects separated by space.
$modified  : null|string|DateTime
Date on which the resource was changed.
$name  : int|string|null
The name of the item.
$polygon  : string|null
A polygon is the area enclosed by a point-to-point path for which the starting and ending points are the same.
$postalCode  : string|null
The postal code. For example, 94043.
$publisher  : string|array<string|int, mixed>|Person|Organization|null
The publisher of the resource.
$url  : int|string|null
URL of the item.

Methods

__construct()  : mixed
Constructor to hydrate public properties from an array or stdClass.
jsonSerialize()  : array<string|int, mixed>
Serializes the current object into a JSON-LD array.

Constants

CONTEXT

JSON-LD @context declaration for Schema.org.

public mixed CONTEXT = 'https://schema.org'

Properties

$_from

The metadata to indicates the edge 'from' identifier.

public string|null $_from

$_id

The metadata identifier of the item.

public null|string $_id

$_key

The metadata unique key identifier of the thing.

public null|string $_key

$_rev

The metadata revision value of the thing.

public null|string $_rev

$_to

The metadata to indicates the edge 'to' identifier.

public string|null $_to

$active

The active flag.

public bool|null $active

$additionalType

An additionalType for the item.

public array<string|int, mixed>|string|null|object $additionalType

$addressCountry

The country. Recommended to be in 2-letter ISO 3166-1 alpha-2 format, for example "US". For backward compatibility, a 3-letter ISO 3166-1 alpha-3 country code such as "SGP" or a full country name such as "Singapore" can also be used.

public null|string|Country $addressCountry

$alternateName

An alias for the item.

public string|object|null $alternateName

$box

A box is the area enclosed by the rectangle formed by two points.

public string|null $box

The first point is the lower corner, the second point is the upper corner. A box is expressed as two points separated by a space character.

$circle

A circle is the circular region of a specified radius centered at a specified latitude and longitude.

public string|null $circle

A circle is expressed as a pair followed by a radius in meters.

$created

Date of creation of the resource.

public null|string|DateTime $created

$description

A short description of the item.

public string|null $description

$disambiguatingDescription

A sub property of description. A short description of the item used to disambiguate from other, similar items. Information from other properties (in particular, name) may be necessary for the description to be useful for disambiguation.

public string|null $disambiguatingDescription

$elevation

The elevation of a location (WGS 84).

public null|string|float|int $elevation

Values may be of the form 'NUMBER UNIT_OF_MEASUREMENT' (e.g., '1,000 m', '3,200 ft') while numbers alone should be assumed to be a value in meters.

$hasPart

Indicates an item that this part of this item.

public string|Thing|array<string|int, mixed>|null $hasPart

$id

The unique identifier of the item.

public null|int|string $id

$identifier

The identifier of the item.

public string|null $identifier

$image

The image reference of this resource.

public string|object|null $image

$isPartOf

Indicates an item that this item is part of.

public string|Thing|array<string|int, mixed>|null $isPartOf

$license

A legal document giving official permission to do something with the resource.

public string|object|null $license

$line

A line is a point-to-point path consisting of two or more points. A line is expressed as a series of two or more point objects separated by space.

public string|null $line

$modified

Date on which the resource was changed.

public null|string|DateTime $modified

$name

The name of the item.

public int|string|null $name

$polygon

A polygon is the area enclosed by a point-to-point path for which the starting and ending points are the same.

public string|null $polygon

A polygon is expressed as a series of four or more space delimited points where the first and final points are identical.

$postalCode

The postal code. For example, 94043.

public string|null $postalCode

$url

URL of the item.

public int|string|null $url

Methods

__construct()

Constructor to hydrate public properties from an array or stdClass.

public __construct([array<string|int, mixed>|object|null $init = null ]) : mixed

This allows objects to be quickly populated with associative data without manually setting each property.

Parameters
$init : array<string|int, mixed>|object|null = null

A data array or object used to initialize the instance. Keys must match public property names.

Tags
example
use org\schema\Person;
use org\schema\constants\Prop;

$person = new Person
([
    Prop::NAME => 'Jane Doe',
    Prop::URL  => 'https://example.com/janedoe'
]);

echo $person->name; // Outputs: Jane Doe

jsonSerialize()

Serializes the current object into a JSON-LD array.

public jsonSerialize() : array<string|int, mixed>

This method will include all public properties, the schema.org @context, and the inferred @type based on the class name.

Null values will be automatically removed using compress().

Tags
throws
ReflectionException

If reflection fails when accessing properties.

example
use org\schema\Person;
use org\schema\constants\Prop;

$person = new Person([
    Prop::NAME => 'John Smith',
    Prop::ID   => 'jsmith-001'
]);

echo json_encode($person, JSON_PRETTY_PRINT);

Output:

{
  "@type": "Person",
  "@context": "https://schema.org",
  "id": "jsmith-001",
  "name": "John Smith"
}
Return values
array<string|int, mixed>

A JSON-LD array representation of the object.


        
On this page

Search results