keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.39k stars 1.74k forks source link

[Bug] Importing data from a URL that's not a file no longer works #791

Closed rjimenezda closed 5 years ago

rjimenezda commented 5 years ago

Describe the bug Before #780, you could import data into kepler from APIs such as the CARTO SQL API, as long as the url ended in a recognized format.

So, for instance, the URLhttps://roman-carto.carto.com/api/v2/sql?q=select%20*%20from%20%22roman-carto%22.school_paths&format=geojson would work nicely, because it ended in geojson. You can even specify &filename=out.geojson.

However, #780 introduced a new way of parsing the URI that is more restrictive.

To Reproduce Steps to reproduce the behavior:

  1. Go to kepler.gl/demo
  2. Click on 'Load Map via URL'
  3. Input https://roman-carto.carto.com/api/v2/sql?q=select%20*%20from%20%22roman-carto%22.school_paths&format=geojson
  4. There'll be an error on the console because the file extension is not recognized.

Expected behavior I would expect the data to be downloaded and imported.

rjimenezda commented 5 years ago

I actually like the new approach to URL parsing, but maybe it should try to guess the file type if the URL parsing yielded nothing?

For instance, using the mime type of the response, or falling back to the previous approach.

macrigiuseppe commented 5 years ago

@rjimenezda This is not a bug. The application is actually working as intended and the enhancement is required in order to pass extra params to an third party service when generating a file, e.g. /data.csv?start=[]&end=[]

We already have an open issue to automatically detect the type of file we are trying to dowload

https://github.com/keplergl/kepler.gl/issues/778

VictorVelarde commented 5 years ago

Thx @macrigiuseppe! We'll be aware of the mime type change.

@rjimenezda could you please close this issue?