st_pointonsurface fonksiyon

Şunun için geçerlidir:evet olarak işaretlendi Databricks Runtime 18 LTS ve üzerini denetleyin

Note

Databricks Runtime 18, Databricks Runtime 18.0, 18.1 ve 18.2'den daha yenidir. Daha önce daha sonra numaralandırılmış sürüm olarak gönderilecek özellikler artık databricks Runtime 18'e tarihli güncelleştirmeler olarak gönderilir. Ayrıntılar için bkz. Birleşik sürüm notları hakkında.

Giriş GEOMETRY değerinin üzerinde veya içinde olması garanti edilen bir nokta döndürür.

Syntax

st_pointonsurface ( geoExpr )

Bağımsız değişken

  • geoExpr: Bir GEOMETRY değer.

İadeler

Giriş GEOMETRY değerinin üzerinde veya içinde olması garanti edilen bir 2B nokta GEOMETRY değeri. Daha doğrusu:

  • Giriş GEOMETRY değeri boşsa, 2D boş nokta döndürülür.
  • Giriş GEOMETRY değeri boş olmayan bir noktaysa, noktanın 2B projeksiyonu döndürülür.
  • Giriş GEOMETRY değeri boş olmayan bir çizgi dizesiyse ortanca köşe döndürülür.
  • Giriş GEOMETRY değeri boş olmayan bir çokgense, mümkün olduğunda çokgenin iç kısmındaki bir nokta döndürülür; aksi takdirde sınırında bir nokta döndürülür.
  • Giriş GEOMETRY değeri çok noktalıysa, sınırlayıcı kutu merkezine en yakın boş olmayan nokta döndürülür.
  • Giriş GEOMETRY değeri çok satırlı bir dizeyse, çizgi dizesinin yüzeyinde en büyük uzunluğa sahip bir nokta döndürülür.
  • Giriş GEOMETRY değeri çok kutupluysa, çokgen yüzeyinde en büyük alana sahip bir nokta döndürülür.
  • Giriş GEOMETRY değeri bir geometri koleksiyonuysa, koleksiyonun en büyük boyutlu öğelerinden birinin yüzeyinde bir nokta döndürülür.

Çıkış GEOMETRY değerinin SRID değeri, giriş değerinin değeriyle aynıdır.

Examples

-- Example taking a 2D polygon.
> SELECT st_asewkt(st_pointonsurface(st_geomfromtext('POLYGON((0 0,10 0,10 10,0 10,0 0))')));
  POINT(5 5)

-- Example taking a 2D polygon with a hole: the result lies in the donut region.
> SELECT st_asewkt(st_pointonsurface(st_geomfromtext('POLYGON((0 0,30 0,30 30,0 30,0 0),(5 5,25 5,25 25,5 25,5 5))')));
  POINT(3.75 3.75)

-- Example taking a 3DZ linestring: the median vertex is returned and the Z coordinate is dropped.
> SELECT st_asewkt(st_pointonsurface(st_geomfromtext('LINESTRING Z (1 2 -1,3 4 -2,5 6 -3)')));
  POINT(3 4)

-- Example taking a multipolygon: a point on the polygon with the largest area is returned.
> SELECT st_asewkt(st_pointonsurface(st_geomfromtext('MULTIPOLYGON(((0 0,10 0,10 10,0 10,0 0)),((100 100,101 100,101 101,100 101,100 100)))')));
  POINT(5 5)

-- Example showing that the SRID is preserved.
> SELECT st_asewkt(st_pointonsurface(st_geomfromtext('POLYGON((0 0,10 0,10 10,0 10,0 0))', 3857)));
  SRID=3857;POINT(5 5)

-- Example taking a NULL input.
> SELECT st_pointonsurface(NULL);
  NULL