Skip to main content
Solved

How to upload shape to geoserver rest api?

  • October 28, 2022
  • 2 replies
  • 319 views

limo
Supporter
Forum|alt.badge.img+8
  • Supporter
  • 52 replies

Hi,

 

I will try to upload shapefile to geoserver over the rest api.

This should be possible with the HTTPCaller! I am using the following option: - http methode: PUT

Upload from data

...

imageBut I get the error:

image 

I have access to the given url. So what is the problem here?

Does someone has experience in uploading shapes to geoserver with fme?

Best answer by limo

thanks for your hint!

I found out that the url was not correct. I need to add .../file.shp that Geoserver (rest) knows nex external data will come. Furthermore I need all files of the shape. So I have to zip all files and to define "application/zip" as content-type.

 

Now it work. New data will be published on the server and the layer is created automatically in geoserver.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

nielsgerrits
VIP
Forum|alt.badge.img+60
  • 2938 replies
  • October 28, 2022

I have no experience using GeoServer's API. As this is a specific GeoServer, not FME question, I think you probably have more reponse if you ask this on https://gis.stackexchange.com/

 

That being said, my best practice to learn how to work with the syntax of a new API is to use PostMan. When it works, replicate the webrequest(s) in HTTPCallers in FME.


limo
Supporter
Forum|alt.badge.img+8
  • Author
  • Supporter
  • 52 replies
  • Best Answer
  • October 28, 2022

thanks for your hint!

I found out that the url was not correct. I need to add .../file.shp that Geoserver (rest) knows nex external data will come. Furthermore I need all files of the shape. So I have to zip all files and to define "application/zip" as content-type.

 

Now it work. New data will be published on the server and the layer is created automatically in geoserver.