observablehq / feedback

Customer submitted bugs and feature requests
42 stars 3 forks source link

Parse GeoJSON and TopoJSON files as JSON by default #525

Closed saneef closed 1 year ago

saneef commented 1 year ago

Is your feature request related to a problem? Please describe. When using 'Insert into notebook' for a JSON file attachment, the inserted code snippet has .json() parsing included. But it is not the case when the file extension is of .geojson or .topojson. This has me perplexed a number of times.

See Snippet inserted from a GeoJSON file into notebook.

Describe the solution you'd like Enable JSON parsing for other commons JSON file types like GeoJSON, TopoJSON, ....

CobusT commented 1 year ago

I think .topojson files are mime type application/json, but it looks like .geojson files are mime type application/geo+json. See https://github.com/topojson/topojson-specification/issues/11

I think we can add the .json() parsing to geojson files.