QGIS'in Sanal Katmanında bulunan tüm işlevleri listelemek
Dec 23 2020
QGIS'in Sanal Katmanında kullanılabilen tüm işlevlerin bir listesini otomatik olarak nasıl alabilirim?
Kendi anlayışım / deneyimime ve QGIS Dokümantasyonuna göre , QGIS'in Sanal Katmanı, PostGIS , SQLite , SpatiaLite ve QGIS ifadelerinin İşlevlerinde sağlanan işlevlerin bir karışımını kullanır . (Umarım hayati bir şeyi kaçırmamışımdır.)
Birkaç konu gördüm QGIS DB Manager'da şekil dosyalarında “sanal katmanlar” olarak hangi uzamsal işlevler mevcuttur? ve QGIS (GitHub) için sanal katmanlar , maalesef hiçbirinde endişeme çözüm bulamadım.
Yanıtlar
11 J.Monticolo Dec 23 2020 at 22:14
Aşağıdaki kod QGIS konsolunda yürütülen Python iç gözlem ve iyi biçimlendirilmiş QGIS Python modüllerinin gücüyle Sanal Katmanlara doğrudan erişebilirsiniz:
from db_manager.db_plugins.vlayers import sql_dictionary
print(f"Functions: {sql_dictionary.functions}")
print(f"Math functions: {sql_dictionary.math_functions}")
print(f"String functions: {sql_dictionary.string_functions}")
print(f"Aggregate functions: {sql_dictionary.aggregate_functions}")
print(f"Spatialite functions: {sql_dictionary.spatialite_functions}")
print(f"QGIS functions: {sql_dictionary.qgis_functions}")
Sonuçlar:
Functions: ['changes', 'coalesce', 'glob', 'ifnull', 'hex', 'last_insert_rowid', 'nullif', 'quote', 'random', 'randomblob', 'replace', 'round', 'soundex', 'total_change', 'typeof', 'zeroblob', 'date', 'datetime', 'julianday', 'strftime']
Math functions: ['Abs', 'ACos', 'ASin', 'ATan', 'Cos', 'Cot', 'Degrees', 'Exp', 'Floor', 'Log', 'Log2', 'Log10', 'Pi', 'Radians', 'Round', 'Sign', 'Sin', 'Sqrt', 'StdDev_Pop', 'StdDev_Samp', 'Tan', 'Var_Pop', 'Var_Samp']
String functions: ['Length', 'Lower', 'Upper', 'Like', 'Trim', 'LTrim', 'RTrim', 'Replace', 'Substr']
Aggregate functions: ['Max', 'Min', 'Avg', 'Count', 'Sum', 'Group_Concat', 'Total', 'Var_Pop', 'Var_Samp', 'StdDev_Pop', 'StdDev_Samp']
Spatialite functions: ['*iszipblob', '*ispdfblob', '*isgifblob', '*ispngblob', '*isjpegblob', '*isexifblob', '*isexifgpsblob', '*geomfromexifgpsblob', 'MakePoint', 'BuildMbr', '*buildcirclembr', 'ST_MinX', 'ST_MinY', 'ST_MaxX', 'ST_MaxY', 'ST_GeomFromText', '*pointfromtext', '*geomfromwkb', '*pointfromwkb', 'ST_AsText', 'ST_AsBinary', '*assvg', '*asfgf', '*geomfromfgf', 'ST_Dimension', 'ST_GeometryType', 'ST_Srid', 'ST_SetSrid', 'ST_isEmpty', 'ST_isSimple', 'ST_isValid', 'ST_Boundary', 'ST_Envelope', 'ST_X', 'ST_Y', 'ST_StartPoint', 'ST_EndPoint', 'ST_Length', 'ST_isClosed', 'ST_isRing', 'ST_Simplify', '*simplifypreservetopology', 'ST_NumPoints', 'ST_PointN', 'ST_Centroid', 'ST_PointOnSurface', 'ST_Area', 'ST_ExteriorRing', 'ST_InteriorRingN', 'ST_NumGeometries', 'ST_GeometryN', 'MbrEqual', 'MbrDisjoint', 'MbrTouches', 'MbrWithin', 'MbrOverlaps', 'MbrIntersects', 'MbrContains', 'ST_Equals', 'ST_Disjoint', 'ST_Touches', 'ST_Within', 'ST_Overlaps', 'ST_Crosses', 'ST_Intersects', 'ST_Contains', 'ST_Relate', 'ST_Distance', 'ST_Intersection', 'ST_Difference', 'ST_Union', 'ST_SymDifference', 'ST_Buffer', 'ST_ConvexHull', 'ST_Transform', '*initspatialmetadata', '*addgeometrycolumn', '*recovergeometrycolumn', '*discardgeometrycolumn', '*createspatialindex', '*creatembrcache', '*disablespatialindex', '*checkspatialmetadata', '*autofdostart', '*autofdostop', '*initfdospatialmetadata', '*addfdogeometrycolumn', '*recoverfdogeometrycolumn', '*discardfdogeometrycolumn', '*filtermbrwithin', '*filtermbrcontains', '*filtermbrintersects', '*buildmbrfilter']
QGIS functions: ['atan2', 'round', 'rand', 'randf', 'clamp', 'scale_linear', 'scale_exp', '_pi', 'to_int', 'toint', 'to_real', 'toreal', 'to_string', 'tostring', 'to_datetime', 'todatetime', 'to_date', 'todate', 'to_time', 'totime', 'to_interval', 'tointerval', 'regexp_match', 'now', '_now', 'age', 'year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'day_of_week', 'title', 'levenshtein', 'longest_common_substring', 'hamming_distance', 'wordwrap', 'regexp_replace', 'regexp_substr', 'concat', 'strpos', '_left', '_right', 'rpad', 'lpad', 'format', 'format_number', 'format_date', 'color_rgb', 'color_rgba', 'ramp_color', 'color_hsl', 'color_hsla', 'color_hsv', 'color_hsva', 'color_cmyk', 'color_cmyka', 'color_part', 'darker', 'lighter', 'set_color_part', 'point_n', 'start_point', 'end_point', 'nodes_to_points', 'segments_to_lines', 'make_point', 'make_point_m', 'make_line', 'make_polygon', 'x_min', 'xmin', 'x_max', 'xmax', 'y_min', 'ymin', 'y_max', 'ymax', 'geom_from_wkt', 'geomFromWKT', 'geom_from_gml', 'relate', 'intersects_bbox', 'bbox', 'translate', 'buffer', 'point_on_surface', 'reverse', 'exterior_ring', 'interior_ring_n', 'geometry_n', 'bounds', 'num_points', 'num_interior_rings', 'num_rings', 'num_geometries', 'bounds_width', 'bounds_height', 'is_closed', 'convex_hull', 'sym_difference', 'combine', '_union', 'geom_to_wkt', 'geomToWKT', 'transform', 'uuid', '_uuid', 'layer_property', 'var', '_specialcol_', 'project_color']
Nicole Kidman, Michael Keaton ve Val Kilmer'in Batman Olarak Paylaştığı Bu 1 Çekici Özelliğe Bayıldı
Gene Simmons, KISS Çizgi Romanlarının Potansiyel Olarak "İnsanlığı Yeniden Yaratabileceğini" Söyledi
Tom Girardi Dolandırıcılık Suçlamalarından Yargılanma Yetkisinin Belirlenmesi İçin Duruşmaya Katıldı
Kevin Jonas'ın Kızı Alena, Doğum Günü Fotoğrafında Büyümüş Görünüyor: '9 Yaşında Gerçek Hissetmiyor'