ArcGIS Desktop

  • Documentación
  • Soporte

  • My Profile
  • Ayuda
  • Sign Out
ArcGIS Desktop

ArcGIS Online

La plataforma de representación cartográfica para tu organización

ArcGIS Desktop

Un completo SIG profesional

ArcGIS Enterprise

SIG en tu empresa

ArcGIS for Developers

Herramientas para crear aplicaciones basadas en la ubicación

ArcGIS Solutions

Plantillas de aplicaciones y mapas gratuitas para tu sector

ArcGIS Marketplace

Obtén aplicaciones y datos para tu organización.

  • Documentación
  • Soporte
Esri
  • Iniciar sesión
user
  • Mi perfil
  • Cerrar sesión

Ayuda

  • Inicio
  • Introducción
  • Mapa
  • Analizar
  • Administrar datos
  • Herramientas
  • Más...

ST_NumPoints

  • Definición
  • Sintaxis
  • Tipo de devolución
  • Ejemplo

Definición

ST_NumPoints devuelve el número de puntos (vértices) de una geometría.

Para los polígonos, los vértices de inicio y de fin se cuentan, aunque ocupan la misma ubicación.

Tenga en cuenta que este número es diferente que el atributo NUMPTS del tipo ST_Geometry. El atributo NUMPTS contiene un conteo de vértices en todas las partes de la geometría incluso los separadores que tienen lugar entre las partes. Hay un separador entre cada parte. Por ejemplo, una cadena de texto de líneas multiparte con tres partes tiene dos separadores. En el atributo NUMPTS, cada separador se cuenta como un vértice. Por el contrario, la función ST_NumPoints no incluye los separadores en el conteo de vértices.

Sintaxis

Oracle y PostgreSQL

sde.st_numpoints (geometry1 sde.st_geometry)

SQLite

st_numpoints (geometry1 geometryblob)

Tipo de devolución

Entero

Ejemplo

La tabla numpoints_test se crea con la columna geotype, que contiene el tipo de geometría almacenado en la columna g1.

Las declaraciones INSERT para insertar un punto, una cadena de texto y un polígono.

La consulta SELECT utiliza la función ST_NumPoints para obtener el número de puntos de cada entidad para cada tipo de entidad.

Oracle

CREATE TABLE numpoints_test (
 geotype varchar(12),
 g1 sde.st_geometry
);

INSERT INTO NUMPOINTS_TEST VALUES (
 'point',
 sde.st_pointfromtext ('point (10.02 20.01)', 4326)
);

INSERT INTO NUMPOINTS_TEST VALUES (
 'linestring',
 sde.st_linefromtext ('linestring (10.02 20.01, 23.73 21.92)', 4326)
);

INSERT INTO NUMPOINTS_TEST VALUES (
 'polygon',
 sde.st_polyfromtext ('polygon ((10.02 20.01, 23.73 21.92, 24.51 12.98, 11.64 13.42, 10.02 20.01))', 4326)
);
SELECT geotype, sde.st_numpoints (g1) Number_of_points
 FROM NUMPOINTS_TEST;

GEOTYPE     Number_of_points

point                       1
linestring                  2
polygon                     5

PostgreSQL

CREATE TABLE numpoints_test (
 geotype varchar(12),
 g1 sde.st_geometry
);

INSERT INTO numpoints_test VALUES (
 'point',
 sde.st_point ('point (10.02 20.01)', 4326)
);

INSERT INTO numpoints_test VALUES (
 'linestring',
 sde.st_linestring ('linestring (10.02 20.01, 23.73 21.92)', 4326)
);

INSERT INTO numpoints_test VALUES (
 'polygon',
 sde.st_polygon ('polygon ((10.02 20.01, 23.73 21.92, 24.51 12.98, 11.64 13.42, 10.02 20.01))', 4326)
);
SELECT geotype, sde.st_numpoints (g1)
 AS Number_of_points
 FROM numpoints_test;

geotype     number_of_points

point                       1
linestring                  2
polygon                     5

SQLite

CREATE TABLE numpoints_test (
 geotype text(12)
);

SELECT AddGeometryColumn(
 NULL,
 'numpoints_test',
 'g1',
 4326,
 'geometry',
 'xy',
 'null'
);

INSERT INTO numpoints_test VALUES (
 'point',
 st_point ('point (10.02 20.01)', 4326)
);

INSERT INTO numpoints_test VALUES (
 'linestring',
 st_linestring ('linestring (10.02 20.01, 23.73 21.92)', 4326)
);

INSERT INTO numpoints_test VALUES (
 'polygon',
 st_polygon ('polygon ((10.02 20.01, 23.73 21.92, 24.51 12.98, 11.64 13.42, 10.02 20.01))', 4326)
);
SELECT geotype AS "Type of geometry", st_numpoints (g1) AS "Number of points"
 FROM numpoints_test;

Type of geometry     Number of points

point                       1
linestring                  2
polygon                     5

Temas relacionados

  • Cargar la biblioteca ST_Geometry de SQLite

ArcGIS Desktop

  • Inicio
  • Documentación
  • Soporte

Plataforma ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

Acerca de Esri

  • Quiénes somos
  • Empleo
  • Blog interno
  • Conferencia de usuarios
  • Cumbre de desarrolladores
Esri
Díganos su opinión.
Copyright © 2017 Esri. | Privacidad | Legal