0

My image is in Raspberry Pi, GeoServer is in a client system. I want upload the image from Raspberry Pi to GeoServer using HTTP POST. I have read lot of documentations but everything says how to retrieve data.

With WCS request I have tried like this but no response:

from owslib.wcs import WebCoverageService
from owslib.coverage import Coverage
import gdal

# Open the image file
ds = gdal.Open('/home/pi/Desktop/Camera Module/image.jpg')

# Get the bounding box
xmin, xres, xskew, ymax, yskew, yres = ds.GetGeoTransform()
xmax = xmin + (ds.RasterXSize * xres)
ymin = ymax + (ds.RasterYSize * yres)
bbox = (xmin, ymin, xmax, ymax)
print('Bounding box:', bbox)

# Get the size
size = (ds.RasterXSize, ds.RasterYSize)
print('Size:', size)

# Close the image file
ds = None


# Connect to GeoServer WCS service
wcs = WebCoverageService('http://ipadddress:port/geoserver/wcs', version='2.0.1')

# Define the coverage
bbox = bbox# longitude, latitude coordinates
size = size  # image size in pixels
crs = 'EPSG:4326'  # coordinate reference system
coverage = Coverage('myimage', bbox, crs, size)

# Send the image
response = wcs.getCoverage(identifier='myimage', format='image/tiff', coverage=coverage)
with open('myimage.tiff', 'wb') as f:
    f.write(response.read())

1 Answer 1

1

There is no such thing as a WCS-T (transactional) in GeoServer: you can only use the WCS requests to download data.

However, you can upload data using the REST API.

See: Creating Coveragestore GeoTIFF using REST API

1
  • The only server software that supports transactional WCS is I think Rasdaman/Petascope
    – nmtoken
    Mar 10, 2023 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.