Bug report #10711

every geojson layers are named OGRGeoJSON

Added by Amrit Karmacharya over 6 years ago. Updated almost 6 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Data Provider/OGR
Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:19103

Description

I am a web developer and I mostly store data in geojson format. When i add data to QGIS every layer shows up with name "OGRGeoJSON" in layer box. Is there a way to Name the layers according to filename.

Associated revisions

Revision d9419498
Added by Jürgen Fischer almost 6 years ago

also restore style for file based layers (followup dfff717a0) and
use file name for GeoJSON layers (fixes #10711)

History

#1 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Open to Feedback

can you please attach a sample of your data?

#2 Updated by Antonio Locandro about 6 years ago

Confirmed,

Every time you add a geoJSON layer via add vector command to map canvas the default layer name is OGRGeoJSON instead of reading the filename

Would be much more intuitive if it used filename as default specially if you load several ones

#3 Updated by Jürgen Fischer about 6 years ago

  • Category set to Data Provider/OGR

#4 Updated by Giovanni Manghi almost 6 years ago

  • Status changed from Feedback to Open
  • Affected QGIS version changed from 2.2.0 to master

#5 Updated by Antonio Locandro almost 6 years ago

Just to add to this, if you drag & drop the geojson file it does preserve the filename, so this issue only happens using add vector command. IMHO adding files via browser and add vector command should work the same to have the same User Experience

#6 Updated by Jukka Rahkonen almost 6 years ago

Reason is probably that the GDAL GeoJSON driver finds the layer as "OGRGeoJSON". Perhaps this should be discussed with GDAL developers. I don't know if GeoJSON can contain more than one layer or if it is possible to give a name to the layer(s).

ogrinfo test.json
ERROR 4: GeoJSON Driver doesn't support update.
Had to open data source read-only.
INFO: Open of `test.json'
using driver `GeoJSON' successful.
1: OGRGeoJSON (Polygon)

#7 Updated by Jürgen Fischer almost 6 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF