How could i import google map into matlab using mapping toolbox,with dynamic view?
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I would like to import google maps into matlab by using mapping toolbox in order to edit a specific city region of the map with dynamic view.Then everytime i click on a building, matlab should be able to display some informations, which i would have provided.
1 Kommentar
Edoardo
am 10 Jul. 2024
Has anyone figured this out? It's been a decade. I found something for static maps but not dynamic
Antworten (1)
Anshuman
am 12 Sep. 2024
Hello,
Based on my understaing, here are few general steps that you can follow to achieve this functionality:
- Obtain map data for the city of interest. You can use publicly available datasets like OpenStreetMap (OSM) or other GIS data sources. Convert the data into a format that MATLAB can read, such as shapefiles (.shp).
- Load the Map Data in MATLAB and use the "mapshow" function to display the map data. Customize the view using functions like "xlim", "ylim", and "zoom" to focus on specific regions.
- Use MATLAB's UI components to create interactive elements. For instance, use "uifigure" and "uipanel" to set up a GUI. Implement a callback function to handle mouse clicks on the map.
- Use the "ginput" function or "ButtonDownFcn" property to detect clicks. Identify the clicked building by checking the coordinates against your map data.
- Create a data structure or database that associates building coordinates with information. When a building is clicked, retrieve and display the associated information in a pop-up or UI panel.
Hope it helps!
1 Kommentar
Edoardo
am 12 Sep. 2024
Bearbeitet: Edoardo
am 12 Sep. 2024
What a great response! I’ve looked into this quite extensively for a project so I’ll add my own two cents
- Don’t reinvent the wheel, create a geoaxis and geoplot. If doing a matlab app parent that to a panel
- Requesting singular google tiles has the google logo on the bottom right you can’t remove by TOS so these will tile as well
- Overlaying images on an axis might obscure clicking on the axis callback but ginput should still work but you will be forced to use it if going the google tiles approach
- I’ve managed to extract data as coordinates from the OSM Overpass API. I mapped ways into their singular nodes which were referenced elsewhere in the API response, for my application that was easier since I needed to snap closeby features to a path and I did that using closeby points. (If you need to extract road paths and such shape files should be the right approach).
- Using OpenRouteService API you can, extract points of interest (POI’s) in your area and display them on your map. You could also reverse geocode where the user presses then display that location.
Siehe auch
Kategorien
Mehr zu Google finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!