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 pandas as pd
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')
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?
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.