How to display a geojson to a geomap on grafana panel - grafana

I'm using MySQL and Grafana.
I wish to display a geojson field to a geomap but impossible to select geojson format.
The contains of geojson is a MultilineString.
What is best way to create a Panel on Grafana on my country and display all my geojson ?
Thanks for your help.
I tried :
Orchestra Cities Map no
GeoMap no

Related

Efficiant loading via filter with Mapbox

I have several mapbox datasets, each with a collection of features located in different cities. Each feature has a field named city that contains the city the feature is located in (e.g. city = "new york"). In mapbox studio I have a style with layers made from each of those datasets. I want to load a map with it's bounding box containing all features with city == "new york"(fit map view to features bbox). How can I accomplish that, preferably without ever loading features that don't satisfy city=="new york"
If I understand you correctly, you have a basemap that contains all the cities, but when you load the map in mapbox-gl-js, you want to filter them to just one particular city.
You do this by calling:
map.setFilter('my-cities-layer', ['==', ['get', 'city'], 'new york']);
There isn't really a simple way of filtering all layers to only include data with that tag, though.
After selecting the relevant layer in Mapbox Studio, select the property whose visibility you would like to control. For example, suppose that you are interested in showing a text field for each of these features in your dataset (the same logic could also be applied to icon images). Once this property of the layer is selected, click on the "Style with data conditions" option in the layer editor. You will then be prompted to choose a data field (which in your case will be city) and subsequently prompted to set values for this data field (which in your case will be new york).

Import GeoJSON data into MongoDB

I have two geojson files
GeoJSON file for Provinces (here)
GeoJSON file for Municipalities (here)
Municipalities resides inside Provinces
My goal is to import these files into MongoDB. In MongoDB I have a collection called "Grocery", a collection with a geolocation field (long/lat)
Part of the goal is for each Grocery row to get the associated Province and Municipality by using the data from the two GeoJSON available. So say a Grocery row have a (X,Y) geolocation field stored, using these coordinates we will query the Provinces and Municipalities from the GeoJSON data to return the Province name and Municipality name, e.g. it will return "Mountain Province" plus "Lake City" (Municipality)
What is the general approach to achieving this?
Best approach in my opinion would (trivially) be to perform this transformation with the programming language you prefer, interfacing your MongoDB.
You will find many libraries allowing you to perform operations with GeoJSON objects, including testing a GeoJSON point inclusion within any GeoJSON shape. You may want to take a look to d3-geo (w/ Node.JS) or Python GeoJSON as well as Shapely.

Grafana worldmap panel with Influxdb

I am struggling to get the worldmap panel working with influxdb.
Can someone explain what I am doing wrong?
I am assuming that you have saved geohash as a tag.
If I run your query in a table panel, then I get two fields in the result called geohash and one of them is empty.
I think you can remove the field(geohash) from the select and get the result you want. (Or remove the last selector or change the alias so that there is no conflict between it and the group by).

How can I associate a leaflet marker with an object id in my database

On a webpage with leaflet maps - I want to be able to display my database objects, each of which have a lat,lng. using markers on the map.
So when I click the marker, I would like to fetch information from db and display this.
How can I store the object id or associate it with a marker so that when a marker is clicked I can load my object from database and display detailed information?
I know I could use lat/lng to find the object using radius search or something, but this won't work and is not accurate, as there could be more than one object with same lat/lng.
Ok based on the answer provided by #Ivar in another thread: Leaflet: Add a link to the markers
You can associate a dbObject Id to the marker directly, after the marker is added to the map. when a marker is added to the map it gets assigned an ID called "_leaflet_id". This can be fetched through the target object, and also set to a custom value after it has been added to the map.
Now in the marker OnClick event you can just get the clicked marker's id and use it to query the database.
marker._leaflet_id = dbObjectId;
Not sure how you are connecting to your db, but the flow would be something like this:
grab the clicked point's lat/lng, then send that info to some logic that employs a spatial geometry lib like S2 or something. Create an envelope around the clicked point, and get all the points whose lat/lngs are within that envelope, then whichever's lat/lng is the shortest spherical distance to your clicked point is your match.
I am sure there is an easier way to do this through CartoDB or something like PostGIS.
--
Assuming your database objects are set up in a table like this:
ID(guid) | Name | Latitude | Longitude
fe124etc.| Marker1| 43.123 | -117.123
y75W2etc.| Marker2| 44.123 | -116.123
you do the method above and then once you have the marker you want, you send the other db data (name, address, w/e) back to a popup that is bound to the marker.
Another avenue to explore is (depending on the data) you can make a geoJSON layer out of it. (leaflet geojson use). If you do that, you can create/store/read attributes for each point.
Hope this makes it a little more clear.

Separate OSM postgis streetdata that contains data for markers in center of street

I'm kinda new to Django and OSM but after hours of googling I didn't find my answer.
I have set up my own OSM tileserver which runs on a postgis database (psql). The tile server runs fine. Now I want to do the following.
I want to add markers in the center of each street in a specific area. I want add all these markers in the database on forehand, because the data is already there (nodes,lines,way etc.) and I want to give streets additional values. This means that i have to add all the streets to my database. In my head these tables must at least contain:
Name of street, City, Country, Lon, lat (of the center of the street)
This way I can call-up the markers and values from the database. Is this the right way of thinking, and how do I get this street data from my postgis db to this new table with the right relations and coordinates?
I hope someone could help me.