Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-24 Thread Giuseppe Falcone
Hi to all, I think the exception is due to geoserver version: 24 mag 07:21:53 ERROR [geoserver.rest] - com.thoughtworks.xstream.mapper.CannotResolveClassException: updateMode at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79) at com.thoughtworks.xstr

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-23 Thread Giuseppe Falcone
Thanks I try the PUT with this body { "updateMode": "APPEND", "layer": { "name": "layerA", "nativeName": "layerA" } } I receive a 500 error with the message 'updateMode' I'm using geoserver 2.10.1 for layer REST representation do you mean the response of these? http:

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-23 Thread Andrea Aime
Hi Giuseppe, close, but your JSON is one level off, you're updating the task, so it's the top level object in the request. So it would be something like this: { "updateMode": "APPEND", "layer": { "name": "layerA" } } Checking a REST script I have handy, inside the layer I also

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-23 Thread Giuseppe Falcone
Thanks a lot Andrea for the response, but I'm not able to do that 1. POST http://10.23.8.193:8080/geoserver/rest/import to create task import 2. POST http://10.23.8.193:8080/geoserver/rest/import//task to upload shapefile zip (multipart form-data) 3. What is the body of PUT request /geoserver/rest

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-22 Thread Andrea Aime
On Thu, May 19, 2022 at 9:47 AM Giuseppe Falcone wrote: > Thanks for you response. > I rephrase the question: > I have a web application where a user uploads a shapefile and this needs > to be inserted into a postgis table that has the same fields (in append > mode). Shapefile and table don't nec

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-19 Thread Jody Garnett
No it is a good feature request for importer; which I would love to see take on more functionality for updating tables. Right now it just keeps making table1, table2, table3 each time and there is not much control. There is also no way to clean up a table that was added by importer. If you are in

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-19 Thread Giuseppe Falcone
Thanks for you response. I rephrase the question: I have a web application where a user uploads a shapefile and this needs to be inserted into a postgis table that has the same fields (in append mode). Shapefile and table don't necessarily have the same name. There is a manner to execute this task

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-11 Thread Jody Garnett
I tried using the importer user interface using a shapefile, and while I can adjust the name of the layer being created, the result still has the native name unchanged. So I think you are looking change to the code, it would be a nice change allowing user to define the name of the table being im

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-10 Thread Giuseppe Falcone
I use importer rest api. So: step 1: POST /geoserver/rest/imports (specifying target workspace and target datastore) to obtain an importID step2: POST/geoserver/rest/imports//tasks (passing zip file into body) to obtain a taskID (zip is uploaded into geoserver data dir and is unzipped) step3:

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-09 Thread Jody Garnett
You may also consider using the resource rest api to upload the file, and the the importer rest api in ingest (it offers greater control as Ian suggests). The upload you found determines a unique table name based on the provided content, so for your shapefile this is based on the filename. The f

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-09 Thread Giuseppe Falcone
Hi thanks for the response. I'm building a web application that must have this function. >From browser user upload a shapefile e I put into a db table. I think REST API are perfect for this purpose. Giuseppe Il giorno lun 9 mag 2022 alle ore 19:22 Ian Turton ha scritto: > I'm not sure that you

Re: [Geoserver-users] REST API importer: specify table to load data

2022-05-09 Thread Ian Turton
I'm not sure that you need to involve geoserver in this, Ogr2ogr would be quicker and easier to append a shapefile to a database. The GeoServer rest api is for creating data stores and layers etc not individual data management. Alternatively you might be able to use the importer extension to do th