Condividi tramite


GeomFromGml (tipo di dati geometry)

Costruisce un'istanza geometry data una rappresentazione nel subset SQL Server di Geography Markup Language (GML).

Per ulteriori informazioni su Geography Markup Language, vedere le seguenti specifiche Open Geospatial Consortium:

OGC Specifications, Geography Markup Language (informazioni in lingua inglese)

Sintassi

GeomFromGml ( GML_input, SRID )

Argomenti

  • GML_input
    Input XML dal quale GML restituirà un valore.

  • SRID
    Espressione int che rappresenta l'identificatore SRID dell'istanza geometry da restituire.

Tipi restituiti

SQL Server - tipo restituito: geometry

Tipo CLR restituito: SqlGeometry

Osservazioni

Questo metodo genererà un'eccezione FormatException se l'input non è formattato in modo corretto.

Esempi

Nell'esempio seguente viene utilizzato il metodo GeomFromGml() per creare un'istanza geometry.

DECLARE @g geometry;
DECLARE @x xml;
SET @x = '<LineString xmlns="http://www.opengis.net/gml"> <posList>100 100 20 180 180 180</posList> </LineString>';
SET @g = geometry::GeomFromGml(@x, 0);
SELECT @g.ToString();

Vedere anche

Altre risorse