<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Country code&#x2F;name from coordinates?]]></title><description><![CDATA[<p dir="auto">Hello :)<br />
Is there a possibility to get country code/name from coordinates( latitude &amp; longitude )?<br />
I would like to provide some feature on the base of country.<br />
I would be grateful for any help or link :)</p>
]]></description><link>https://forum.qt.io/topic/98345/country-code-name-from-coordinates</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 17:37:37 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/98345.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 09 Jan 2019 10:51:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Country code&#x2F;name from coordinates? on Thu, 10 Jan 2019 11:41:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ernestj">@<bdi>ErnestJ</bdi></a> said in <a href="/post/503844">Country code/name from coordinates?</a>:</p>
<blockquote>
<p dir="auto">Always first MouseArea click gives "no connection", but second shows correct result. Could you tell me why is it?</p>
</blockquote>
<p dir="auto">of course , because (like any other network request) the result comes asynchronously.<br />
So rather do something like this:</p>
<pre><code>GeocodeModel {
    ...
    onCountChanged: {
        if( count &gt; 0 )
              console.log( geocodeModel.get(0).address.country )
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/503851</link><guid isPermaLink="true">https://forum.qt.io/post/503851</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Thu, 10 Jan 2019 11:41:50 GMT</pubDate></item><item><title><![CDATA[Reply to Country code&#x2F;name from coordinates? on Thu, 10 Jan 2019 11:02:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/raven-worx">@<bdi>raven-worx</bdi></a><br />
Thank you for help. While trying out example from your link I encountered a network error.</p>
<pre><code>    Plugin {
            id: mapPlugin
            name: "osm"
    }
    GeocodeModel {
        id: geocodeModel
        plugin: mapPlugin
        autoUpdate: false
    }
    MouseArea {
        id: mouseArea
        x: 75
        y: 101
        width: 200
        height: 200
        onClicked: {
            geocodeModel.query = "10.075252, 19.934158"
            geocodeModel.update()
            if(geocodeModel.count &gt; 0)
                console.log( geocodeModel.get(0).address.country )
            else
                console.log("no connection")
        }
    }
</code></pre>
<p dir="auto">Always first MouseArea click gives "no connection", but second shows correct result. Could you tell me why is it? Should I somehow connect to osm first?<br />
Output:</p>
<pre><code>qml: no connection
QNetworkReplyHttpImplPrivate::_q_startOperation was called more than once QUrl("https://nominatim.openstreetmap.org/search?q=10.075252, 19.934158&amp;format=json&amp;accept-language=en&amp;polygon_geojson=1&amp;addressdetails=1")
qml: Chad
</code></pre>
]]></description><link>https://forum.qt.io/post/503844</link><guid isPermaLink="true">https://forum.qt.io/post/503844</guid><dc:creator><![CDATA[ErnestJ]]></dc:creator><pubDate>Thu, 10 Jan 2019 11:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to Country code&#x2F;name from coordinates? on Wed, 09 Jan 2019 14:14:52 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ernestj">@<bdi>ErnestJ</bdi></a><br />
the term you are looking for is "reverse geocoding"<br />
<a href="http://doc.qt.io/qt-5/qml-qtlocation-geocodemodel.html#query-prop" target="_blank" rel="noopener noreferrer nofollow ugc">GeoCodeModel</a> provides such functionality for example</p>
]]></description><link>https://forum.qt.io/post/503628</link><guid isPermaLink="true">https://forum.qt.io/post/503628</guid><dc:creator><![CDATA[raven-worx]]></dc:creator><pubDate>Wed, 09 Jan 2019 14:14:52 GMT</pubDate></item></channel></rss>