0

I want to use the importer extension for the geoserver. I 'installed' this library and it works so far. My challenge is that i want to upload several shapefiles from a directory and I found this example.

But every time I run this command:

C:\WINDOWS\system32>curl -u admin:geoserver -XPOST -H "Content-type: application/json" -d @import.json "http://127.0.0.1:8080/geoserver2110/rest/imports?async=true"

I get this error message:

Warning: Couldn't read data from file "import.json", this makes an empty POST. A JSONObject text must begin with '{' at character 0 of

For me is unclear, where I have to place the import.json file?

1

It seems you have no import.json in the current folder.

You must create import.json with JSON like this (take a look at the example):

{
    "import": {
        "targetWorkspace": {
            "workspace": {
                "name": "tasmania"
            }
        },
        "data": {
            "type": "directory",
            "location": "C:/data/tasmania"
        }
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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