grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
311 stars 199 forks source link

Add GeoJSON support #6

Open fabienengels opened 8 years ago

fabienengels commented 8 years ago

Hi,

It could be nice to add a GeoJSON data source instead of Elasticsearch. For example it could be useful to plot maps with data provided by USGS : http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.geojson

or even the one we provide : http://renass.unistra.fr/fdsnws/event/1/query?orderby=time&format=json&longitude=1.9&limit=30&latitude=46.6&maxradius=8.0

What do you think about it ?

daniellee commented 8 years ago

This sounds very interesting. I have some follow-up questions.

This is feature request is a bit tricky due to it being a new datasource and therefore maybe outside the bounds of a plugin but I would like to hear more!

fabienengels commented 8 years ago

Currently we visualize these data using two main solutions : QGIS and our website ( http://renass.unistra.fr/ ). These geojson outpus are generated on the fly, it's up to users to choose what area they want to retrieve (bounding box, min/max magnitudes, etc).

Currently we build a prototype based on Grafana which shows realtime seismoter waveforms (using influxdb as backend). The idea is to allow users to build dashboards in their browsers or to show these data in public places (observatories, schools, etc) by using some lowcost hardware (raspberry, chromecast ?). The existing solutions are pretty heavy to deploy (mainly heavy clients).

And as we are a very small team (two people :) ), using grafana will allow us to have a very small code base to maintain and move the maintenance to the server side instead of client side.

This is feature request is a bit tricky due to it being a new datasource and therefore maybe outside the bounds of a plugin but I would like to hear more!

That's why I was not sure it was the right place to open the ticket :)

In the worst case, a solution could be to mock an elastic search instance by implementing the right endpoints but it's far less elegant and I thing usage of GeoJSON is far beyond of seismology field :)

daniellee commented 8 years ago

How do you match the geojson with the measurements in InfluxDB? Is there any code that I can look at to get a better idea of how it works?

It should be possible to build a geojson datasource plugin so I don't think you need to mock the elasticsearch datasource. It would be something like the example datasource, Simple JSON Datasource.

daniellee commented 8 years ago

@fabienengels I'd love to do something with this feature but I need to know a bit more about your needs first!

fabienengels commented 8 years ago

Hi,

Sorry for the delay.

Currently, our usage is really pretty basic, just showing points on the map. This is feature would be enough. Associated measurements will be more complex ... the epicenter is determined by many measurements located somewhere else ... so it starts to be a very specific usage and I'm not sure it should be implemented in Grafana ...

daniellee commented 8 years ago

@fabienengels Points on a map is definitely possible! Do you have some example geojson that I could use to test with?

daniellee commented 8 years ago

Using google translate, I was able to find some geojson on your website. We have some ongoing work to support InfluxDB so I'll test using the geojson with that.

fabienengels commented 8 years ago

You can find worldwide earthquakes here : http://earthquake.usgs.gov/earthquakes/feed/v1.0/geojson.php

For example M4.5+ Earthquakes during the last 7 days : http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_week.geojson

Or the last 30 earthquakes in France : http://renass.unistra.fr/fdsnws/event/1/query?orderby=time&format=json&longitude=1.9&limit=30&latitude=46.6&maxradius=8.0

lblt commented 7 years ago

Hi, @daniellee do you now if something has been done recently on that question? Having GeoJSON data source would indeed be very helpful. If you need some help I'm ready to give you a hand!

daniellee commented 7 years ago

@lblt I haven't done anything with this. I'm working full-time on Grafana these days and this has got pushed down my list of priorities. But I would absolutely accept a PR for this.

hoppfrosch commented 3 years ago

Any progress on this?

tedraymond commented 3 years ago

i've been looking into the as well. The recent Geomap is nice and works for everything "easy" so far, but practically banging my head against the wall trying to get geojson polygons to display on the map.

Does anyone have any input on how i could do this. I've tried a couple other plugins but nothing quick and easy yet with no good results.

Is this maybe something that can be added to the Geomap, maybe something along the lines of how geojson.io works?

It would be nice to use a api url that grabs geojson data then plots the data in the map. or have the agility to build your own layers.

shashwat-kalpvaig commented 2 years ago

@tedraymond have you found any solution to this issue, dirty method would also do fine ? The issue has been opened since 5 years, so its possible that this feature is probably last in their feature list.

tedraymond commented 2 years ago

@50shashwat , nothing yet but it’s looking promising. I recently upgraded to the latest 8.3 version and there is an option for adding a static geojson file to the geomap. They appear to be default map files included with the release and I am eager to get it working. It’s still a priority on my end for a project. I’ll keep you updated if I find out more.

shashwat-kalpvaig commented 2 years ago

Is the static geojson file one is working?

tedraymond commented 2 years ago

@50shashwat in a way on the new geomap panel. But i only see the three options. I've added my own json geojson files to that directory and restarted the service but no luck on getting additional layers to populate, yet.

image

zufolo441 commented 2 years ago

I just copied .geojson files in that folders and it worked. Version 8.4.3.

another question: is there a way to set color of polygon based on a query result value?

tedraymond commented 2 years ago

Yes. Its working with the newest release.

On Thu, Mar 3, 2022 at 08:57 Francesco Consumi @.***> wrote:

I just copied .geojson files in that folders and it worked. Version 8.4.3.

another question: is there a way to set color of polygon based on a query result value?

— Reply to this email directly, view it on GitHub https://github.com/grafana/worldmap-panel/issues/6#issuecomment-1058124855, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARNCCWPGRXUPCDZBZVI4YZLU6DHMBANCNFSM4CDYK7NQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

yosiasz commented 2 years ago

not seeing my added files. Was there some configuration change for this to work?

tedraymond commented 2 years ago

Ive been able to manually enter the directory\file name.json in 8.3.

It would be nice if you could set the file name to a variable on the dashboard

On Fri, Jun 17, 2022 at 12:41 Yosi @.***> wrote:

not seeing my added files. Was there some configuration change for this to work?

— Reply to this email directly, view it on GitHub https://github.com/grafana/worldmap-panel/issues/6#issuecomment-1159102407, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARNCCWILV47UBWKWBRVTIO3VPS2FZANCNFSM4CDYK7NQ . You are receiving this because you were mentioned.Message ID: @.***>

yosiasz commented 2 years ago

Use this plugin instead!!

https://github.com/orchestracities/map-panel

tedraymond commented 2 years ago

Nicely done.

Have you tried calling a variable into the geoJSON Url, as far as i can tell it only accepts manual entry. On Fri, Jun 17, 2022 at 13:07 Yosi @.***> wrote:

and voila! Thanks to @tedraymond https://github.com/tedraymond hint of being able to type in anything you want.

[image: image] https://user-images.githubusercontent.com/900951/174353785-f7deef42-423f-49eb-9645-b36c12388232.png

[image: image] https://user-images.githubusercontent.com/900951/174353802-fcea8525-f892-4e2c-8d2b-7a551936ddd5.png

— Reply to this email directly, view it on GitHub https://github.com/grafana/worldmap-panel/issues/6#issuecomment-1159118634, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARNCCWP4T26X4LVWA2XJN5TVPS5ELANCNFSM4CDYK7NQ . You are receiving this because you were mentioned.Message ID: @.***>

Tlunch commented 1 year ago

I am trying to get amazon managed grafana to find geoJSONs other than the default 3 but it cant seem to do it. Has anyone got any thoughts on troubleshooting?

yosiasz commented 1 year ago

@Tlunch are you able to copy files to amazon grafana?