Exemplo n.º 1
0
 def ga_geometry(_, gatype, nullable=True):
     t = gatype.geometry_type
     if t == 'POINT':
         return dt.Point(nullable=nullable)
     if t == 'LINESTRING':
         return dt.LineString(nullable=nullable)
     if t == 'POLYGON':
         return dt.Polygon(nullable=nullable)
     if t == 'MULTILINESTRING':
         return dt.MultiLineString(nullable=nullable)
     if t == 'MULTIPOINT':
         return dt.MultiPoint(nullable=nullable)
     if t == 'MULTIPOLYGON':
         return dt.MultiPolygon(nullable=nullable)
     if t == 'GEOMETRY':
         return dt.Geometry(nullable=nullable)
     else:
         raise ValueError("Unrecognized geometry type: {}".format(t))
Exemplo n.º 2
0
 [
     ("ARRAY<DOUBLE>", dt.Array(dt.double)),
     ("array<array<string>>", dt.Array(dt.Array(dt.string))),
     ("map<string, double>", dt.Map(dt.string, dt.double)),
     (
         "map<int64, array<map<string, int8>>>",
         dt.Map(dt.int64, dt.Array(dt.Map(dt.string, dt.int8))),
     ),
     ("set<uint8>", dt.Set(dt.uint8)),
     ([dt.uint8], dt.Array(dt.uint8)),
     ([dt.float32, dt.float64], dt.Array(dt.float64)),
     ({dt.string}, dt.Set(dt.string)),
     ("geography", dt.Geography()),
     ("geography;4326", dt.Geography(srid=4326)),
     ("geography;2000", dt.Geography(srid=2000)),
     ("geometry", dt.Geometry()),
     ("point", dt.point),
     ("point;4326", dt.point),
     ("point;4326:geometry", dt.point),
     ("point;4326:geography", dt.point),
     ("linestring", dt.linestring),
     ("linestring;4326", dt.linestring),
     ("linestring;4326:geometry", dt.linestring),
     ("linestring;4326:geography", dt.linestring),
     ("polygon", dt.polygon),
     ("polygon;4326", dt.polygon),
     ("polygon;4326:geometry", dt.polygon),
     ("polygon;4326:geography", dt.polygon),
     ("multilinestring", dt.multilinestring),
     ("multilinestring;4326", dt.multilinestring),
     ("multilinestring;4326:geometry", dt.multilinestring),