Skip to content

Commit

Permalink
added store name to publish
Browse files Browse the repository at this point in the history
  • Loading branch information
romer8 committed Jun 10, 2024
1 parent d130197 commit 0f2c0c3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cli/convert_geom.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def _read_and_transform(gpkg_path, layer_name):
def _create_and_publish_shp(
gdf,
shp_path,
store_name,
geoserver_host,
geoserver_port,
geoserver_username,
Expand All @@ -39,7 +40,7 @@ def _create_and_publish_shp(

geo.create_shp_datastore(
path=f"{shp_path}.zip",
store_name="hydrofabrics",
store_name=f"{store_name}",
workspace="nextgen",
)
# remove zip file
Expand Down Expand Up @@ -77,6 +78,7 @@ def publish_gpkg_layer_to_geoserver(
gpkg_path,
layer_name,
shp_path,
store_name,
geoserver_host,
geoserver_port,
geoserver_username,
Expand All @@ -87,6 +89,7 @@ def publish_gpkg_layer_to_geoserver(
_create_and_publish_shp(
gdf,
shp_path,
store_name,
geoserver_host,
geoserver_port,
geoserver_username,
Expand All @@ -101,6 +104,7 @@ def publish_gpkg_layer_to_geoserver(
def publish_geojson_layer_to_geoserver(
geojson_path,
shp_path,
store_name,
geoserver_host,
geoserver_port,
geoserver_username,
Expand All @@ -111,6 +115,7 @@ def publish_geojson_layer_to_geoserver(
_create_and_publish_shp(
gdf,
shp_path,
store_name,
geoserver_host,
geoserver_port,
geoserver_username,
Expand Down Expand Up @@ -163,6 +168,7 @@ def main():
parser.add_argument(
"--shp_path", help="Path to save the shapefile for GeoServer", required=False
)
parser.add_argument("--store_name", help="Shapefile store name", required=False)
parser.add_argument("--geoserver_host", help="GeoServer host", required=False)
parser.add_argument("--geoserver_port", help="GeoServer port", required=False)
parser.add_argument(
Expand Down Expand Up @@ -193,6 +199,7 @@ def main():
args.gpkg_path,
args.layer_name,
args.shp_path,
args.store_name,
args.geoserver_host,
args.geoserver_port,
args.geoserver_username,
Expand All @@ -206,6 +213,7 @@ def main():
result = publish_geojson_layer_to_geoserver(
args.geojson_path,
args.shp_path,
args.store_name,
args.geoserver_host,
args.geoserver_port,
args.geoserver_username,
Expand Down

0 comments on commit 0f2c0c3

Please sign in to comment.