How to display a map direction which fetches latitude and longitude from sqlite database - iphone

HI all,
i have map application which stores the latitude and longitude of location in sqlite database.
Depending on the existing latitude and longitude saved in sqlite database,i want to display a new map.How is it possible.Can anybody help me in solving this problem.Thanks.

NSString *urlstring=[NSString stringWithFormat:#"http://maps.google.com/?saddr=%f,%f&daddr=%f,%f",sourcelocation.latitude,sourcelocation.longitude,destinationlocation.latitude,destinationlocation.longitude];

Related

Geocoding postgreSQL table from addresses to get latitude and longitude

I have a table in postgresql database with my clients infos. The table contains more than 430 000 records and i should generate the latitude and longitude from the address column for any record in the table.
Please can you suggest me any solution to that. I had a look on Google maps geocoding API in Talend open studio ( using tGoogleGeocoder) but it is very limited.
Thanks in advance.

Getting the latitude and longitude for a set of Node's

in my android application when i capture a picture the , GPS read info of my location (lat/long) , I need to get the lat/long for my town and insert it to my database , I download my region file by mean of JSOM software supported by www.openstreetmap.com the file was in osm extention , my mind tell me that i need to write a program to parse this file (raw data) and insert the whole node's (id + lat +long + other info ) to my database is that the best solution ,becasue time killing me ! .
In other word my Question is how to extract the data in file.osm
Note:every Node has it's unique ID
It's not quite clear what your actual problem is. Your smartphone should already be capable of obtaining lat and lon via the integrated GPS device.
Do you need the name of the town for the current position? In that case you can use Nominatim and run a simple reverse geocoding query.
Do you need the position of a specific town? In that case use Nominatim with a regular geocoding query.

Find data near to user location with split data in Xcode

I'm trying to figure out how i can find data (from JSON) near to the users location on iPhone.
My input consists out of 2 parts, so in order to get to the city and address, I have to get an ID from the province where the user is located.
Province (with ID to go to all Json data of the province)
Data
(Every piece of data has a name, city, address, ...)
Is it possible to find the province where the user is located. Then pass its ID to search the list of data for near to the user located events by reversing all the addresses and cities into coordinates,...?
I'm pretty new to location based programming! Any help is appreciated!
Thank you very much!
The first thing you'll want to do is add CoreLocation to your app. This tutorial shows you how to do that. This will give you the latitude and longitude of your current location.
The next thing you'll want to do is reverse geocode your coordinates. One common API for this is the Google Geocoding API. That will give you your province name.

How to save the values of coordinates in SQLite database

I am creating a map in which I am tracking the user's current location. When the current location of the user is traced their a pin is placed. Depending on this I get the latitude and longitude of current location.
I have an SQLite database which stores the latitude, longitude of the user. But my main problem is how to insert the coordinates of latitude and longitude in SQLite database. How can I do this?
I think these links are useful to you.
Saving mapView.userLocation.location.coordinate.longitude into sqlite database
making map coordinates(lan,& long)storing in sqlite database

how to read the fields in the object that is store in the array in objective-c

my appdelegate is having the array book, this array is storing the many object like latitude and longitude coming from server. this object are containing the many latitude and longitude values coming from server.
values coming from the sever is store in the object file booknew and then this objects are stored in the array.
how can i read that values of latitude and longitude store in the object and that objects are store in the array.
Assuming the objects have accessors for these values, you'd just call those.
If the data that comes from the server is an XML file it's easy. A simple way is to define the data as an array of objects, where each object is an NSDictionary. In each dictionary you can have values for the keys "lat" and "lng", as well as other information connected to each location. If this is how the data is arranged, you could access those values with something like this:
for (id dict in book) {
float latitude=[[dict objectForKey:#"lat"] floatValue];
float longitude=[[dict objectForKey:#"lng"] floatValue];
//code to use values here
}
If this is close to how the data can be arranged in the file, you can read it in with NSArray *book=[NSArray alloc] initWithContentsOfFile:filename] or similar.
If you want to be able to change the objects or the array, you must use an NSMutableArray array or NSMutableDictionary objects.
If the above is not doable (for example, if you have no influence over the file format), you will have to spend much more time writing custom code to read it in, parse it, and create objects yourself.