Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on conversion to DXF #86

Closed
GastonZalba opened this issue Jul 16, 2020 · 4 comments
Closed

Error on conversion to DXF #86

GastonZalba opened this issue Jul 16, 2020 · 4 comments

Comments

@GastonZalba
Copy link
Contributor

GastonZalba commented Jul 16, 2020

An error occurs everytime dxf is set as the output format. The problem is that the ogr2ogr module can't create this format in stream mode using .exec() like all the other formats, you must use the .destination('file.dxf') method.

The error:
"ERROR 6: Read or update mode not supported on /vsistdout\nERROR 4: Failed to open '/vsistdout/' for writing.\nERROR 1: DXF driver failed to create /vsistdout/\n

Reference

@abjardim
Copy link

Can somebody give me a tip on how to handle this error when using XMLHttpRequest?
Below is the code I'm using. With it I'm able to open a download window with the zipped shapefile, but when I change the format to DXF I receive the error mentioned above.

    var http = new XMLHttpRequest();
    var url = "http://ogre.adc4gis.com/convertJson";
    var params = "json=" + JSON.stringify(resultAsGeojson) +
      "&skipFailures=" + true +
      "&format=" + "DXF";
    http.open("POST", url, true);
     
    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
     
    http.onreadystatechange = function() {//Call a function when the state changes.
      var a;
      if(http.readyState == 4 && http.status == 200) {
            a = document.createElement('a');
            a.href = window.URL.createObjectURL(http.response);
            a.download = "test-file.zip";
            a.style.display = 'none';
            document.body.appendChild(a);
            a.click()
        }
    }

    http.responseType = 'blob';
    http.send(params);

I am very new to js, so thanks in advance!

@GastonZalba
Copy link
Contributor Author

The online version still has this issue unsolved, so DXF format is broken. Check this PR #87 if you want to try running your own instance.

@wavded
Copy link
Owner

wavded commented Feb 2, 2021

This fix has been released, thx again @GastonZalba !

@wavded wavded closed this as completed Feb 2, 2021
@abjardim
Copy link

abjardim commented Feb 4, 2021

That's great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants