Fooling around with QGIS (v 2.18) global program-settings, I found some interesting setting. It allows the user to copy geo-features directly from the table to the clipboard as GeoJSON (geom + attributes). So, no “export to…” etc. is needed.
Maybe not a lot of GIS-professionales will need this nice feature, but for people/developers working with geodata and JSON it’s a welcome feature.
Just open a vector-dataset in QGIS (tested it with Shapefiles, SQL/Spatialite, PostgreSQL/PostGIS, FGDB) and to enable “copy to GeoJSON” we have to change a setting in the global program settings (Settings – Options):
“Data Sources” allows us to change “copy features as” to GeoJSON (Screenshot)
After changing this setting select one or more features in the table-view of a dataset and with “Copy to clipboard” the attributes and feature-geom will be in your clipboard as GeoJSON 🙂