Partilhar via


GeoPolygon Classe

Definição

Representa um polígono que consiste em anel externo e anéis internos opcionais.

[System.Text.Json.Serialization.JsonConverter(typeof(Azure.Core.GeoJson.GeoJsonConverter))]
public sealed class GeoPolygon : Azure.Core.GeoJson.GeoObject
[<System.Text.Json.Serialization.JsonConverter(typeof(Azure.Core.GeoJson.GeoJsonConverter))>]
type GeoPolygon = class
    inherit GeoObject
Public NotInheritable Class GeoPolygon
Inherits GeoObject
Herança
GeoPolygon
Atributos

Exemplos

Criando um polígono:

var polygon = new GeoPolygon(new[]
{
    new GeoPosition(-122.108727, 47.649383),
    new GeoPosition(-122.081538, 47.640846),
    new GeoPosition(-122.078634, 47.576066),
    new GeoPosition(-122.112686, 47.578559),
    new GeoPosition(-122.108727, 47.649383),
});

Criando um polígono com furos:

var polygon = new GeoPolygon(new[]
{
    // Outer ring
    new GeoLinearRing(new[]
    {
        new GeoPosition(-122.108727, 47.649383),
        new GeoPosition(-122.081538, 47.640846),
        new GeoPosition(-122.078634, 47.576066),
        new GeoPosition(-122.112686, 47.578559),
        // Last position same as first
        new GeoPosition(-122.108727, 47.649383),
    }),
    // Inner ring
    new GeoLinearRing(new[]
    {
        new GeoPosition(-122.102370, 47.607370),
        new GeoPosition(-122.083488, 47.608007),
        new GeoPosition(-122.085419, 47.597879),
        new GeoPosition(-122.107005, 47.596895),
        // Last position same as first
        new GeoPosition(-122.102370, 47.607370),
    })
});

Construtores

GeoPolygon(IEnumerable<GeoLinearRing>)

Inicializa a nova instância do GeoPolygon.

GeoPolygon(IEnumerable<GeoLinearRing>, GeoBoundingBox, IReadOnlyDictionary<String,Object>)

Inicializa a nova instância do GeoPolygon.

GeoPolygon(IEnumerable<GeoPosition>)

Inicializa a nova instância do GeoPolygon.

Propriedades

BoundingBox

Representa informações sobre o intervalo de coordenadas do GeoObject.

(Herdado de GeoObject)
Coordinates

Retorna uma exibição sobre a matriz de coordenadas que forma essa geometria.

OuterRing

Retorna o anel externo do polígono.

Rings

Obtém um conjunto de anéis que formam o polígono.

Type

Obtém o tipo GeoJSON desse objeto.

Métodos

ToString()

Converte uma instância de em GeoObject uma representação GeoJSON.

(Herdado de GeoObject)
TryGetCustomProperty(String, Object)

Tenta obter um valor de uma propriedade personalizada associada ao GeoObject.

(Herdado de GeoObject)

Aplica-se a