mbloch / mapshaper

Tools for editing Shapefile, GeoJSON, TopoJSON and CSV files
http://mapshaper.org
Other
3.78k stars 535 forks source link

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

Closed Re-Invent closed 1 year ago

Re-Invent commented 2 years ago

When I select the file to import, nothing happens.

mbloch commented 2 years ago

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.

Ideenpionier commented 2 years ago

I have the same issue.

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.

ThomasG77 commented 2 years ago

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.

mbloch commented 2 years ago

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 commented 2 years ago

@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 commented 1 year ago

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