Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating Terrain Map with SRTM HGT File

Tags:

I am working on an iOS application. Where I show the Elevation and Topography map of a certain area. I have managed to download the .hgt file within app from here.

So far I am able to extract the Elevation from the hgt file. Now I have to also show the Terrain Map for that area. I have been searching about it and I think I can't create terrain map directly with hgt file within iOS application. I have to use GRASS GIS, SRTM2OSM or TileMill to create terrain map and then use it in application.

Can please anyone direct me what I can do here and how to proceed.

EDIT:

I have asked to not to use any kind of map for this. So basically I have to create the map by using core drawing, and I have no idea about it.

Something Like this without the text:

enter image description here

like image 409
superGokuN Avatar asked Dec 22 '17 14:12

superGokuN


1 Answers

With iOS you have access to Maps through MapKit framework to display map or satellite imagery directly from your app's interface, you can use also Google Maps through Google Maps SDK for iOS but both (iOS Maps and Google Maps) don't have a terrain level.

So to avoid to re-create something that already exist you can take a look to the OpenStreetMaps frameworks, here you can find many available frameworks, one of them is called MapBox and you can download the latest sources and example here

As you can read from wiki pages we have also the terrain level: enter image description here

I think it's a really useful library, updated and working with swift 4 , here you can find an easy tutorial to start:

import Mapbox class ViewController: UIViewController {     override func viewDidLoad() {         super.viewDidLoad()         let mapView = MGLMapView(frame: view.bounds)         mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]         mapView.setCenter(CLLocationCoordinate2D(latitude: 40.74699, longitude: -73.98742), zoomLevel: 9, animated: false)         view.addSubview(mapView)         // to show the terrain level          mapView.styleURL = MGLStyle.outdoorsStyleURL()     } } 
like image 153
Alessandro Ornano Avatar answered Oct 06 '22 14:10

Alessandro Ornano