Is there a way to get data from a PNG map to a GeoJSON - maps

I have a map which was published in PNG format without its underlying data :
Map produced by the French Gov
I also have this GeoJson of every district in France.
Visualisation of GeoJson file
I need a file that would contain the content of the map in a format I can exploit (Shapefile, GeoJSON, TIFF, etc.). To do that I need to select the districts that are in each of the tiles.
Do you have any idea of a solution that would allow to use the GeoJSON as an overlay over the image to select the districts to put in each category ?
I have tried to georeference the image but that's about as far as I have succeeded.
Thank you

Related

How to specify facilityId for a tileset in Azure IndoorMaps?

I've followed the Azure Indoor Maps Creator tutorial here but used a python script from another repository here to make it simpler to upload the map files. No PostMan required basically.
The sample wires up a levelchanged event handler and outputs the event data to console. The event's data for facilityId is always FCL13. I cannot find where this data is specified anywhere. Not in the python script, the sample data zipfile manifest.json, nor in the DWG files (with my limited ability to view those).
I assume I should be able to specify which facility I am uploading data for so would either expect the API calls to be provided this (from the python script), or it should be some metadata within the DWG files.
My intention was to upload more than one building's floor maps so need the facilityId to be configurable. Having specific tilesets associated to different facilityIds allows me to know which facility had its level changed during a levelchanged event.
Where is the facilityId data specified for a specific map data upload?
All Ids (facilityId, levelId, unitId, etc.) are generated when you create a dataset. These Ids are not meant to be set manually.
It is possible to list facilityIds loaded in the map, along with their names, address info, etc. that was provided in manifest.json.
Note: It looks like the 'indoorTiles' source lacks the getShapes() method so a workaround is required to query the underlying mapbox.
map._getMap().querySourceFeatures('indoorTiles', {sourceLayer: 'Indoor facility'});
From Mapbox's documentation on querySourceFeatures():
Because features come from tiled vector data or GeoJSON data that is converted to tiles internally, feature geometries may be split or duplicated across tile boundaries and, as a result, features may appear multiple times in query results.

Is Firestore a good database for storing many large objects in?

I have been using React/Leaflet to create a choropleth map that can color any country on the map. What I am trying to do is to develop a save/load function that saves the colored countries and later be able to import it from the database. When this object is saved and loaded, it can bring back the exact same countries that were colored. I have been using firebase/firestore but I haven't been getting any luck.
This is how my object of map data looks like
Is Firestore the right database to do it? Or should I approach another database? I need a database that can store multiple objects in the picture above.
If you can convert that file into a JSON of a size smaller than 1MB, which is the Firestore Document size limit, it is possible. In the case you are proposing I would have the following structure, from the information you shared but fell free to adapt it as you see fit:
Map Collection
field1
...
fieldN
CountriesOptions Subcollection
optionObject: {}
Where each object is a separate document in the CountriesOptions subcollection converted to JSON using JSON.stringify(obj).
For more information on how to structure your Firestore with subcollections you can check this link to the documentation.

is there a way to create a zip code level Geo Map in Google Data Studio?

I'm using the Geo Map chart in Google Data Studio.
I'm able to plot data at the state and the city level but not at the zip code level. I'm getting a map with no data as well as the 'This map needs a valid geo dimension' error.
I've filtered all the zip codes to match bigquery-public-data.utility_us.zipcode_area.zipcode so it's not a data issue. I've also flagged the data as 'Postal Code' and 'Text' type but this is not resolving the issue.
Has anyone been able to plot a Geo Map at the zip code level?
I do not want to use Google Maps chart, I'd like to achieve this with the Geo Map chart.
Thanks

Datastudio Geomap Drilldown vs GoogleMap visualize issues

I was playing with DataStudio GeoMap and GoogleMap features, I used Covid US datased. I made some research what is best for showing charts via GeoMap & GoogleMap, I made report with 6 slides, each slide has Title with used method and I found below issues:
1) Drill down for GeoMap not working often, state/regions not showed,
2) in slide #2 GeoMap: used 3 Geo Dimension: Lat/Long, City, Region : how to show City names ? (and disable Latitude?)
Seems that best way is showing via GoogleMap (slide #6) with Bubble dimension :Lat/Long with Tooltip: City > then values are showing to Cities,
only issue is how to setup default zoom region US, to avoid showing whole world ?
Here is report:
https://datastudio.google.com/reporting/f0201b38-c2ae-400c-8ca0-d65d001c9e3a/page/DOdRB
One note: in My old report from today somehow I was able to create report with drill down 2-layer GeoMap, used Dimension: City+Region > not accurate, many cities are missing:
https://datastudio.google.com/u/0/reporting/a729972f-97ec-4faf-8311-a49719d0826c/page/TeaRB
Trying to import GoogleMap via embded frame, but I got this error>>
Google Maps cannot yet be displayed in embedded reports.
Question 1: Google Maps & Filters
Opened the Report above, exported the Google Maps data to Goggle Sheets, recreated a Data Source and Report, and then had a look through; it seems that the data in the City field is sorted, classifying values outside the United States as NA, in addition, removed 0,0 values in the Latitude_Longitude field, thus this Filter does the trick:
Exclude City RegExp Match (NA)
AND
Exclude Latitude_Longitude RegExp Match (0,0)
Editable Google Data Studio Report and GIF to demonstrate (Feel free to have a look through and edit the Report as required):
Question 2: Geo Maps & Drill-down
The updated Filter in Question 1 should do the trick when using the Geo Maps Chart Type, with all three Geo Types - Latitude_Longitude City and Region working as expected using the Drill-down and the Zoom area set to United States; adding an image of the Filter above for clarification:
Google Data Studio Report and a GIF to elaborate:
Question 3: Embedding Map Charts
Geo Maps can be displayed on embedded reports.
Currently, Google Maps won't appear in embedded reports.

Mapbox GL JS - Highlight Country Polygon

I have a select2 option where a user can select a Continent, Region, Country, City or Airport. I integrated mapbox to add markers to the map on selecting a location.
In case of Country and continent selection I would like to select the whole country/continent instead of just a marker.
I tried using the Mapbox Geocoding API like https://api.mapbox.com/geocoding/v5/mapbox.places/germany.json?types=country&access_token=**** but I noticed it only returns a 'Point' coordinates.
I would like to use a service where I provide the country/continent name and it returns a polygon with all the border coordinates in order to be able to highlight on the polygon on the map.
Does mapbox have a built-in service for such functionality? Or do I need to use a third-party service or json file?
while the Mapbox Geocoding API doesn't return the full polygon geometry for a feature, you can use the Geocoding API in combination with a few other open source data sources and tools.
Here's the beginnings of a workflow you could try out:
query the geocoding api with the text for the country name like "germany" and grab the lon,lat coordinates from the coordinates property of the API response.
use polygon data in geojson format from an open source like Natural Earth: https://www.naturalearthdata.com/downloads/
pass the coordinates and polygon data into this turf.js function: http://turfjs.org/docs/#booleanPointInPolygon
identify the polygon the point lies within and highlight those boundaries on the map. For more on how to use GL JS for the highlighting portion, check out the examples page: https://docs.mapbox.com/mapbox-gl-js/example/query-similar-features/

Resources