NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Hi!

How can i get the geodata from adress (country,city,street) in c# ?

Greetings

asked 23 Apr '20, 21:25

Hermetes's gravatar image

Hermetes
11112
accept rate: 0%

edited 26 Apr '20, 12:00

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701


If you want to do this with OpenStreetMap data,

  1. Install your own Nominatim server, loading data for the region of the world you are interested in (https://github.com/osm-search/Nominatim has all you need)
  2. Use the C# HttpClient to access your server's API which is described on https://nominatim.org/release-docs/develop/api/Overview/
  3. The response can either be in XML or in JSON, and can be parsed with appropriate libraries (see https://stackoverflow.com/questions/6620165/how-can-i-parse-json-with-c )

If you only want to make a few requests (instead of making thousands of requests or shipping a software that depends on the server), you can also access the public, donation-funded Nominatim server and skip step 1 above; be sure to adhere to https://operations.osmfoundation.org/policies/nominatim/ if you do that to avoid the risk of the service being cut off.

Another alternative to step 1 above is buying services from a commercial provider; see https://wiki.openstreetmap.org/wiki/Commercial_OSM_Software_and_Services for an inofficial list maintained by the providers themselves.

permanent link

answered 23 Apr '20, 21:33

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 23 Apr '20, 21:34

Hallo Frederik!

Du bist ja aus Karlsruhe, dann spreche ich lieber Deutsch mit Dir! :) Vielen Dank schon mal für die schnelle Antwort. Arbeitest du direkt bei OSM ?

Ich arbeite an einem Anwendungsprogramm in Unity (GameEngine). Dabei benutze ich einen Globus der auf eure Karten läuft. https://assetstore.unity.com/packages/tools/gui/world-map-globe-edition-2-150643 User können eine Kontaktliste erstellen, diese Kontakte möchte ich als Marker auf den Globus zeigen lassen.

Es gibt bei Google ein Webrequest mit der Methode GetGeoDataFromAddress(country,city,street) (oder so ähnlich) Möchte Google aber schon allein aus ideologischen Gründen nicht nutzen.

Du weißt nun was ich vor habe, könntest du mir etwas empfehlen? Das Programm werde ich zwar kostenlos zur Verfügung stellen, wäre aber auch bereit bei euch eine Kommerzielle Lösung anzunehmen.

Grüße Paulo

(23 Apr '20, 22:19) Hermetes

So ähnlich wie dieser Google-Aufruf funktioniert auch der öffentliche Nominatim-Server. Wenn Du Dein Programm frei zur Verfügung stellst und nicht weisst, wer es wie massiv einsetzt, ist es vielleicht am besten, wenn Du in Deinem Programm grundsätzlich die Nominatim-API implementierst, aber den URL einstellbar machst. Dann können "Klein-Anwender" den spendenfinanzierten OSMF-Nominatim nutzen, und Groß-Anwender sich was eigenes aufsetzen.

(23 Apr '20, 23:36) Frederik Ramm ♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×29

question asked: 23 Apr '20, 21:25

question was seen: 4,122 times

last updated: 26 Apr '20, 12:00

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum