Aller au contenu principal

results.from-shapefile operation parameters

Commentaires

7 commentaires

  • Berend Veldkamp

    This is all the documentation there is, so you may want to raise your voice here

    That said, without telling us what exactly you have tried, it is hard to see what the problem could be. 

    I suppose the first thing to do is to unzip the downloaded file (there's an Unzip activity in the Zip activity pack). Then, for each shapefile, call results.from-shapefile (without ‘s’, BTW)

    0
  • Christoph Wenninger

    Hello Berend,

    thanks for your response. The documentation you linked was the one I already found, but it seems that the arguments are different than the ones my vertigis app wants to have. When I run the operation through the “Run Operation” activity, my console tells me either the error “An invalid argument was specified for parameter ‘Parameter `blobs` is required.’” when I dont have “blobs” or “e is not iterable” when I have “blobs” as parameter. So it seems that the parameter “blobs” is what I need, but it's not like the arguments in the documentation.

    I think I'm just missing out the right structure of the operation parameter.

    Here are some more informations of what I tried or think could be necessary:

    • Vertigis Workflow Version: 5.45.1
    • I'm running my tests in the Vertigis Workflow Sandbox as Vertigis Studio Web (Web Map)
    • I tried the blob of the .zip, as suggested in here
    • I tried to unzip and pass the .shp blob
    • I tried different writings of the argument “Blob” ("blobs", “Blobs”, “blob”, etc.)
    • I tried the argument structure used in the above example with different variables:
    {
        "code": "{blobs:$webRequest1.blob}",
        "source": "{blobs:$webRequest1.blob}"
    }
    0
  • Christoph Wenninger

    And thanks for the typo correction. I used results.from-shapefile (without ‘s’).

    0
  • Berend Veldkamp

    I haven't used the result.from-shapefile command myself, but I'd think you may need to pass all necessary parts of the shapefile, i.e. .shp, .shx and .dbf.

    The command arguments would look something like this:

    {
        blobs: [$unzip1.result["myshape.shp"], $unzip1.result["myshape.shx"], $unzip1.result["myshape.dbf"]]
    }

     

    I have seen the ‘e is not iterable’ error before with another command, in that case I resolved it by passing an empty array for another parameter I initially though was optional. Here, adding outfields:[] might just fix this, that is the only argument for this command that could be iterable, afaics.

     

    0
  • Christoph Wenninger

    When i pass all parts of the shapefile, like you suggested, I'm getting the error “Can't find end of central directory : is this a zip file ?”.

    So it seems that Alan was right in this post and the blob has to be a .zip with the necessary shapefile parts.

    When im passing an empty (or defined) array of “outfields”, it doesn't change anything.

    0
  • Berend Veldkamp

    Ok, sorry for the confusion.

     

    I now tested this myself, and found out that you need to create a ‘file’ first. The necessary activities are therefore:

    1. Web Request to download the .zip
    2. Create File to create a file from =$webrequest1.blob
    3. Run Operation results.from-shapefile with parameter: ={ blobs: [$file1.result] }

    My zipfile contains only a single shape, I haven't tested with multiple. 

    I also noticed that using a somewhat larger file (zip=700 kB), will completely freeze the browser. A zip of 20 kB works fine.

     

    0
  • Christoph Wenninger

    Back at office, I now tried your last suggestions. Your hint to user Create File was the right direction.

    I've got it now sorted out and it works, thanks to your help!
    Only difference I had to make: As parameter for the Run Operation I had to pass the $file1.result (result of Create File).

    For size limitations I will have to do some more research, but the main problem is solved now.

    Thank you Berend Veldkamp !

    0

Vous devez vous connecter pour laisser un commentaire.