QGIS: Copy feature from table to GeoJSON

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.

QGIS copy to GeoJSON

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 (SettingsOptions):

„Data Sources“ allows us to change „copy features as“ to GeoJSON (Screenshot)

qgis_geojson_table1

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 🙂

QGIS copy to GeoJSON