Importing a custom map

Hi,

I am trying to import a custom map by using a geojson. When I import the geojson file metabase is able to parse the file and am able to select the tag as the display name. However, I am unable to see any map.

I am trying to import the following geojson file:

https://s3.ap-south-1.amazonaws.com/public-maps/cluster.geojson

Any help would be greatly appreciated.

Best,
Shubham Gupta

Are you able to see the map when adding/editing it in the settings? Like this:

I don't have a dataset that I can use with this but if you see it there and you select the correct properties it should work.

Hey Tom,

No I am not able to. Then is there a problem with the way the instance has been setup? Is there come config flag that I have to setup to use the custom map feature?

Best,
Shubham Gupta

What are the versions of metabase, your OS and your browser?

@tom I'm getting an error with that geojson as well w/ the mac app v0.22.

see attached screenshot.

I get the exact same error message as @sameer when uploading a custom GeoJSON file, running v0.22 on Linux and browsing through Chrome. I know it’s valid JSON since I’ve used it with other applications. Other files seem to work fine though.

Same error here.
I’m trying to load the GeoJSON (https://github.com/tbrugz/geodata-br/blob/master/geojson/geojs-100-mun.json) and it’s giving this same error message:
“Unexpected token I in JSON at position 0”
Running on Elastic BeanStalk Metabase 0.24.1

@timoteo.alvarenga when I click that link I’m not taken to a JSON file. The link has to be to an actual JSON file, not an HTML page

You need to make sure your link is actually to a JSON file. If you use the link to “View Raw” on GitHub (https://raw.githubusercontent.com/tbrugz/geodata-br/master/geojson/geojs-100-mun.json for the link you posted above) you get a link to an actual JSON file. That should work

@shubhamgupta731 when I try to follow that link I get an AWS access denied page. Make sure the link you’re trying to use links to a valid raw GeoJSON file. If you can’t access it from your browser, it won’t work on Metabase either.

Thanks for your help @camsaul
That was a silly mistake of mine
Working now

1 Like

Hi everyone,
I have the same problem as the others and despite your advise it still doesn’t work.
I want to use this link : https://rawgit.com/larsbouwens/nl-geojson/master/nl.geojson
Or this one : https://raw.githubusercontent.com/larsbouwens/nl-geojson/master/nl.json

I checked all you said before but I have the error : “Unexpected token I in JSON at position 0”
Someone could help me ?

Hi everyone,
Congratulations for the excelent work!!!,
I have the same error, now i try to import a map with colombian municipalities in this link
https://raw.githubusercontent.com/dsuarezn/colombia.geojson/master/mpio.json
i verify the json with http://geojson.io and works ok but on import give me error, says “JSON.parse: unexpected character at line 1 column 1 of the JSON data” on firefox, in chrome says “Unexpected token I in JSON at position 0”
On chrome console get this
PUT http: //localhost:3002/api/setting/custom-geojson 500 (Server Error) GuideDetailEditor.jsx:33
GET http: //localhost:3002/api/geojson/ea94070e-bb60-a353-ad7b-dd73a87e6595 400 (Bad Request) GuideDetail.jsx:107

The metabase version is v0.24.2

Same error one put europe geocode

Unexpected token I in JSON at position 0

I try to put json code but same error

metabase version is v0.24.2

Hi, there!

i’m encountering this error when i tried to load a geojson file.

file: https://raw.githubusercontent.com/tbrugz/geodata-br/master/geojson/geojs-100-mun.json

error: Value does not match schema: {:54af425d-6da4-18b9-67ee-5eb53d4a4cce {:url (throws? (“URL must point to a valid JSON file.” a-java.lang.String))}}

SO: Windows 7 64bits

metabase version: v0.25.2

Guys, any thoughts about it ?

I’m not able to load that file in my browser. If we can’t read + parse the file at that url, we throw that error.

Hello! There is a another link: https://drive.google.com/open?id=0B8JeTkdtm-M2OElxdWpYNmg5d2M

In my case the custom map only shows in a shared dashboard if the user has previously logged in to Metabase in other web browser window. If you use another web browser it fails. Let’s say you are in Edge (let’s just say you are), you log in and go to dashbaords, the map shows perfectly then you copy the public link and open another Edge window. It works but if you go to Chrome or Firefox it will fail.

First I thought it was a file permission issue and since I’m running Ubuntu and all the json files are placed in /var/www/html I made sure I can watch the file by opening http://myserver/json.file which I can.

So, apparently you need to be logged in order to use a custom map in a public dashboard.

1 Like

We have the same issue with what clearly seems to be valid geojson file:

https://swingleft.org/static/data/districts-simplified.json

The error is:
“Value does not match schema: {:dfbd0a90-3f25-8e70-7296-1aa18e392be5 {:url (throws? (“URL must point to a valid JSON file.” a-java.lang.String))}}”

This is on Metabase v0.25.2. I’ve had the same problem for months on several different versions.

The json file was generated using Python’s json module, and is readable by geojson.io.

Any ideas?

I have the same problem. I can not publish the maps without being logged in.

so… I’ve upgraded to 0.27 and the issue remains.