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

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.

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.

Openstreetmap Geocoding with housenumber in query

For some geocoding data i use OpenStreetMap.
My adresses are located in germany. The big problem with openstreetmap is, that i have problems to search with my housenumber. The Documentation says that the format is
Because of this my searchquery is:
5 Glogauerstraße
The result is the following:
http://nominatim.openstreetmap.org/search/?format=xml&addressdetails=1&limit=10&q=5%20Glogauerstra%C3%9Fe
This is cool, but there are a lot of results because in germany are a lot of adresses like this. so i will add that this adress must be in BERLIN with the ZIP-Code 10999.
New search-Query:
5 Glogauerstraße, Berlin 10999
Now the result is:
http://nominatim.openstreetmap.org/search/?format=xml&addressdetails=1&limit=10&q=5%20Glogauerstra%C3%9Fe,%20Berlin%2010999
This is nice! Now there is just 1 result!
But the problem is that in this result there isnt the housenumber 5 i was searched for. So the query just "delete" the information of the housenumber.
How can i solve this search query like the way i need it ? Its a big confusing why the openstreet map just delete this information ...
Correct me if I'm wrong but apparently (after searching for the address in the OSM map) OpenStreetMap does not know the housenumbers in this street.
It can correctly geocode this address to approximately accurate coordinates, it is just not accurate enough to know where the house 5 is.
You could possibly try Google Maps services, in my experience it is more accurate in most places.

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 would I use MapKit to drop pin on a store with Zipcode / Postode

If the only information I have for a particular store or business (or restaurant etc) is its Name, Postcode (or Zipcode) and Country, how would I create an MKMapView which locates the store and drops a pin on the location?
So kind of replicating if I typed in "Pizza Paradiso, WC1E 7BS, UK", except without the info bubble (but with pin)
This is called geocoding and the MapKit currently only does reverse-geocoding (from lat/long to address) using the MKReverseGeocoder class.
To do geocoding, you'll have to use some other api like the Google Geocoding API and then take the latitude and longitude it gives you to create a region which you pass to the map view's setRegion:animated: method.
To drop a pin, you would take the resulting lat/long and create an annotation object and add it to the map view using addAnnotation.