... いますが、ルックアップはラスタの両側で同じように使用できます。ルックアップがラスター入力をサポートしていない場合、入力は ST_Polygon 関数を使用して必要に応じて自動的にジオメトリに変換されます。 ラスタルックアップの概要 も参照してください。 ルックアップ ... T_Contains(rast, rst) N, B rast__1__contains=(rst, 2) ST_Contains(rast, 1, rst, 2) B, C rast__contains=geom ST_Contains(ST_Polygon(rast), geom) B, C rast__1__contains=geom ST_Contains(ST_Polygon(rast, 1), geom) B, C poly__contains=rst ST_Contains(pol ... y, ST_Polygon(rst)) B, C poly__contains=(rst, 1) ST_Contains(poly, ST_Polygon(rst, 1)) C rast__crosses=rst ST_Crosses(ST_Polygon(rast ... ... ジェクトの作成例を示します ( Zipcode モデルを想定): >>> from zipcode.models import Zipcode >>> z = Zipcode ( code = 77096 , poly = "POLYGON(( 10 10, 10 20, 20 20, 20 15, 10 10))" ) >>> z . save () GEOSGeometry オブジェクトもジオメトリモデルを保存するた ... めに使用できます: >>> from django.contrib.gis.geos import GEOSGeometry >>> poly = GEOSGeometry ( "POLYGON(( 10 10, 10 20, 20 20, 20 15, 10 10))" ) >>> z = Zipcode ( code = 77096 , poly = poly ) >>> z . ... SRID 値を持つ) 場合は、空間データベースの変換プロシージャを使用して、モデルのフィールドの SRID に暗黙的に変換されます: >>> poly_3084 = GEOSGeometry ( ... "POLYGON(( 10 10, 10 20, 20 20, 20 15, 10 10))" , srid = 3084 ... ) # SRID 3084 is 'NAD83(HARN) ... ... スを表すタプルであることもあります。例えば: class ZipcodeFeed ( Feed ): def geometry ( self , obj ): # Can also return: `obj.poly`, and `obj.poly.centroid`. return obj . poly . extent # tuple like: (X0, Y0, X1, Y1). item_geometry ( item ) これをセットす ... すタプルとなります。たとえば次のようになります: class ZipcodeFeed ( Feed ): def item_geometry ( self , obj ): # Returns the polygon. return obj . poly SyndicationFeed サブクラス 以下の django.utils.feedgenerator.SyndicationFeed のサブクラスが利用可能で ... ... eString (( 0 , 0 ), ( 0 , 50 ), ( 50 , 50 ), ( 50 , 0 ), ( 0 , 0 )) >>> line [ 0 ] (0.0, 0.0) >>> line [ - 2 ] (50.0, 0.0) Polygon 上のインデックス指定は、そのインデックスに対応するリング ( LinearRing オブジェクト) を返します: >>> from django.contrib ... .gis.geos import Polygon >>> poly = Polygon ((( 0.0 , 0.0 ), ( 0.0 , 50.0 ), ( 50.0 , 50.0 ), ( 50.0 , 0.0 ), ( 0.0 , 0.0 ))) >>> poly [ 0 ] <Li ... nearRing object at 0x1044395b0> >>> poly [ 0 ][ - 2 ] # second-to-last coordinate of external ring (50.0, 0.0) さらに、ジオメトリの座標や要素はPythonのリストのよう ... ... イルのような、GDALがサポートするデータソースが必要です (ここでは、3つのフィーチャを持つ単純なポリゴンシェープファイル、 test_poly.shp を使用しています): >>> from django.contrib.gis.gdal import DataSource >>> ds = DataSource ( "test_poly.shp" ) >>> laye ... len ( layer )) # getting the number of features in the layer (should be 3) 3 >>> print ( layer . geom_type ) # Should be 'Polygon' Polygon >>> print ( layer . srs ) # WGS84 in WKT GEOGCS["GCS_WGS_1984", DATUM["WGS_1984", SPHEROID["WGS_1984",6378137, ... rt models class TestGeo ( models . Model ): name = models . CharField ( max_length = 25 ) # corresponds to the 'str' field poly = models . PolygonField ( srid = 4269 ) # we want our model in a different SRID def __str__ ( self ): return "Name: %s " % ... ... is.db import models class Zipcode ( models . Model ): code = models . CharField ( max_length = 5 ) poly = models . PolygonField () class Elevation ( models . Model ): name = models . CharField ( max_length = 100 ) rast = model ... ld class PointField [ソース] Point を格納します。 LineStringField class LineStringField [ソース] LineString を格納します。 PolygonField class PolygonField [ソース] Polygon を格納します。 MultiPointField class MultiPointField [ソース] MultiPoint を格納 ... します。 MultiLineStringField class MultiLineStringField [ソース] MultiLineString を格納します。 MultiPolygonField class MultiPolygonField [ソース] MultiPolygon を格納します。 GeometryCollectionField class GeometryCollectionField ... ... IS , Oracle, SpatiaLite 2 つの地理情報フィールドまたは式を受け取り、それらの両方のジオメトリの和集合を返します。 編集 ForcePolygonCW class ForcePolygonCW ( expression , ** extra ) [ソース] 利用可能なDB : PostGIS , SpatiaLite 1つの地理情報フィールドま ... のジオメトリの Geographic Markup Language (GML) 表現を返します。 例: >>> qs = Zipcode . objects . annotate ( gml = AsGML ( "poly" )) >>> print ( qs [ 0 ] . gml ) <gml:Polygon srsName="EPSG:4326"><gml:OuterBoundaryIs>-147.78711,70.245363 ... -147.78711 ... ,70.245363</gml:OuterBoundaryIs></gml:Polygon> キーワード引数 説明 precision GML 表現における座標の有効桁数を指定します (デフォルト値は 8)。Oracle では無視されます。 ... 2026年10月08日