Java 中的立交桥查询 (android)

问题描述

是否可以在 java 或 android studio 中进行立交桥查询?我没有找到太多,只有这个:query to overpass api in java ... i want to specify the zoom in the query for the draw the response .. what i must add in my code for doing that?

public static String getNodesViaOverpass(String query) throws IOException,ParserConfigurationException,SAXException {
        String hostname = OVERPASS_API;

        URL osm = new URL(hostname);
        HttpURLConnection connection = (HttpURLConnection) osm.openConnection();
        connection.setDoInput(true);
        connection.setDoOutput(true);
        connection.setRequestProperty("Content-Type","application/x-www-form-urlencoded");

        DataOutputStream printout = new DataOutputStream(connection.getoutputStream());
        printout.writeBytes("data=" + URLEncoder.encode(query,"utf-8"));
        printout.flush();
        printout.close();

        return some_string;
    }

我对此代码的特殊问题是:“OVERPASS_API 无法解析为变量”我应该在“主机名=”处做什么? 但是有没有一个网站可以让我找到如何一步一步地在 java 中构建查询的解释,或者你有给我的步骤吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)