mapshaper icon indicating copy to clipboard operation
mapshaper copied to clipboard

The website does not work when I try to import the file

Open Re-Invent opened this issue 2 years ago • 5 comments

When I select the file to import, nothing happens.

Re-Invent avatar Jun 25 '22 18:06 Re-Invent

That's not quite enough info to help me debug this. To help me troubleshoot this problem, you could tell me what browser and OS you're using, whether there are any JavaScript error messages in the browser's developer console, and whether the problem occurs on all data files or just certain ones.

mbloch avatar Sep 02 '22 14:09 mbloch

I have the same issue.

  • macOS Monterey (v 12.5.1)
  • Chrome Version 105.0.5195.102 (Offizieller Build) (x86_64)
  • Safari Version 15.6.1 (17613.3.9.1.16)

I wanted to import a TOPO JSON file from this source: https://github.com/deldersveld/topojson/blob/master/countries/germany/germany-regions.json

After selecting the file there is neither a warning nor an error in the console log. The dialog closes but after clicking on the select button again the dialog won't show up.

Ideenpionier avatar Sep 05 '22 15:09 Ideenpionier

It worked on my side by taking file from https://raw.githubusercontent.com/deldersveld/topojson/master/countries/germany/germany-regions.json (the raw file) instead of https://github.com/deldersveld/topojson/blob/master/countries/germany/germany-regions.json. The second URL although ending with .json does not contains a TOPOJSON but a html. In this case, it will fail to load within mapshaper but because taking the wrong file.

ThomasG77 avatar Sep 12 '22 20:09 ThomasG77

Thanks for the tip, Thomas, you may have identified the problem. I'll try to add a useful error message if someone tries to import a ".json" (or .geojson, etc) file that doesn't contain JSON

mbloch avatar Sep 12 '22 20:09 mbloch

@Ideenpionier I wasn't able to replicate the problem with the file that you provided... did you try to download the file from the URL you posted using a tool like curl or wget? If so, you likely didn't download the correct content.

mbloch avatar Sep 12 '22 21:09 mbloch

Now, if someone imports a file with a .json extension that does not contain valid JSON, an error message will pop up, like this: image

mbloch avatar Jan 17 '23 22:01 mbloch