Skip to main content
added 29 characters in body
Source Link
Bera
  • 77.9k
  • 14
  • 78
  • 188

You can create one by writing any GeoPandas dataframe to it:

import geopandas as gpd
from shapely.geometry import Point, LineString, MultiPolygon
out_db = r"/home/bera/Desktop/gistest/fgdb.gdb"

#Create some geometries
pnt = Point(1,1)
line = LineString([pnt, Point(1,2)])
polygon = MultiPolygon([pnt.buffer(distance=1)])

for layername, geom in zip(["Pointfc", "Linefc", "Polygonfc"], [pnt, line, polygon]):
    df = gpd.GeoDataFrame(geometry=[geom], crs="EPSG:3006")
    df.to_file(filename=out_db, layer=layername, driver='OpenFileGDB')

enter image description here

You can create one by writing any GeoPandas dataframe to it:

import geopandas as gpd
from shapely.geometry import Point, LineString, MultiPolygon
out_db = r"/home/bera/Desktop/gistest/fgdb.gdb"

pnt = Point(1,1)
line = LineString([pnt, Point(1,2)])
polygon = MultiPolygon([pnt.buffer(distance=1)])

for layername, geom in zip(["Pointfc", "Linefc", "Polygonfc"], [pnt, line, polygon]):
    df = gpd.GeoDataFrame(geometry=[geom], crs="EPSG:3006")
    df.to_file(filename=out_db, layer=layername, driver='OpenFileGDB')

enter image description here

You can create one by writing any GeoPandas dataframe to it:

import geopandas as gpd
from shapely.geometry import Point, LineString, MultiPolygon
out_db = r"/home/bera/Desktop/gistest/fgdb.gdb"

#Create some geometries
pnt = Point(1,1)
line = LineString([pnt, Point(1,2)])
polygon = MultiPolygon([pnt.buffer(distance=1)])

for layername, geom in zip(["Pointfc", "Linefc", "Polygonfc"], [pnt, line, polygon]):
    df = gpd.GeoDataFrame(geometry=[geom], crs="EPSG:3006")
    df.to_file(filename=out_db, layer=layername, driver='OpenFileGDB')

enter image description here

Source Link
Bera
  • 77.9k
  • 14
  • 78
  • 188

You can create one by writing any GeoPandas dataframe to it:

import geopandas as gpd
from shapely.geometry import Point, LineString, MultiPolygon
out_db = r"/home/bera/Desktop/gistest/fgdb.gdb"

pnt = Point(1,1)
line = LineString([pnt, Point(1,2)])
polygon = MultiPolygon([pnt.buffer(distance=1)])

for layername, geom in zip(["Pointfc", "Linefc", "Polygonfc"], [pnt, line, polygon]):
    df = gpd.GeoDataFrame(geometry=[geom], crs="EPSG:3006")
    df.to_file(filename=out_db, layer=layername, driver='OpenFileGDB')

enter image description here