Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The GeoServer REST API docs here does not detail how to do this. I'd like to create a PostGIS table and corresponding featureType in GeoServer using the REST API, without having to chain requests.

For now I can upload a shapefile to geosever, but not to PostGIS. I can also create a PostGIS data store in a separate request. Unfortunately, its not possible to use an existing PostGIS data store when uploading a new shapefile. Anyone with experience on how to achieve, please assist.

share|improve this question
up vote 1 down vote accepted

I don't think you can do this using GeoServer - it isn't what the REST interface (or GeoServer) was designed to do. You need to use shp2psql (or any other uploader like ogr2ogr) to add shapefiles to PostGIS. The GeoServer REST interface is designed for adding new stores/layers etc to GeoServer.

share|improve this answer
Hi Iant. That's what I thought. But its possible to create layers, postgis data store, workspaces, and features types based on existing tables using the REST API without much effort. So, I figured that it should be possible to upload the shape file to the postgis directly, and create corresponding feature type, all in one request. So far, I'm able to do this, but in 3 different requests: a request to create postgis data store, a request to create feature type, and a request to upload shape file to the data store (which is a postgis data store). – okello Jun 18 '12 at 11:33
Just to add: Im doing all this from an app I'm developing. Not from a command line. Im using C#. But I can translate cURL commands provided to C#. – okello Jun 18 '12 at 12:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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