Did anyone encounter: “Unable to parse locations” if you replaced one of the existing .json files with a custom one? I think it is not an issue with my json format.
Thanks
In our case the file was uploaded to the “/public/gazetteer” folder, and in the GEOMAP option of data layer we typed the Geojson URL as: /public/gazetteer/image.geojson
Hope it helps!
Thanks! It’s hard to notice that one can write a custom path there.
If anybody is trying to get it to work with german postal codes:
Get the file DE.tab here:
And then run the following python script in that folder:
import sys
import pandas as pd
import json
dat = pd.read_csv("DE.tab",sep='\t')
dat = dat[dat["plz"].notnull()]
dat = dat[dat["lat"].notnull()]
dat = dat[["plz","lat","lon","name"]]
dat.columns = ["key","latitude","longitude","name"]
for i,row in dat.iterrows():
if "," in row["key"]:
for alt in row["key"].split(','):
tmp = row.copy()
tmp["key"] = alt
dat = dat.append(tmp,ignore_index=True)
dat = dat[~dat["key"].str.contains(",")]
parsed = json.loads(dat.to_json(orient='records'))
tmp = json.dumps(parsed, indent=4, ensure_ascii=False).encode('utf8')
print(tmp.decode())
I have set up a server that serves geoJSON files and thought that I could have grafana query my server for the files by adding the url to the server as stated above, but it does not show me anything. Have anyone managed to do this?
i need to know more on this. Where is your node.js located? on the same Grafana server? I have about 700 geojson files, and statically assining them is a pain.
just like you can serve data in a database via rest api, you can also serve file data on disk as rest api but I would not recommend it. these files should really be in a database.
then your rest api for geolocation is served from a database and not a file.