I have downloaded a shapefile of Stockholm (files on GitHub). I'm trying to convert the shapefiles to GeoJSON with the ogr2ogr command line tool. It does not work with the following error:

Export to vector file failed. Error: creation of data source failed (OGR error:Failed to create GeoJSON datasource: test.geojson.)

The method that I'm using is as follows:

  1. Open the Adm.shp file as a layer in QGIS
  2. Right click on the layer and select "Save as..."
  3. Save as GeoJSON

I've tried using different projections and such without success. Does anyone have an idea what could be wrong?

  • If you are using the command line too, please post the exact command you are running. – John Powell Sep 6 '15 at 9:53

When I got that error what caused it was that I tried saving the file to a directory I didn't have write permissions (oops!).

I downloaded the linked shapefile and it converted to GeoJSON just fine, projected in EPSG:3011, all features came over in the file.

| improve this answer | |
  • Thanks for trying, will double check my folder permissions and retry. – seb Sep 6 '15 at 8:13

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