logo       

Sponsor
FREE Network Mapping Tool for Microsoft® Office Visio® Professional 2007
Don't map your network by hand - let LANsurveyor Exx press for Microsoft Visio Professional 2007 automatically create network diagrams for you!

Using osmServerClient ?: msg#00045

gis.openstreetmap.devel

Subject: Using osmServerClient ?

I've been trying to extract data from OSM by using osmServerClient,
but with little luck. What I do is that is I create an
instance of osmServerClient() and calls getNodes (..) on it.
No matter what LatLonPoints I feed it, I get 0 nodes back.
The applet works as it should (even when I start it locally from
dist/applet.sh), so it must be a really stupid mistake I do somewhere :)

I have tried both with and without calling login() first. Login seems
to work as it should, since I get an error when I give an invalid
username/password. Since getNodes() doesn't require a login, the
test program below is without it.

The short example program below tries to extract the points from
an area around my home town:


OpenStreetTest.java
> import org.openstreetmap.client.*;
> import com.bbn.openmap.LatLonPoint;
> import java.util.*;
>
> public class OpenStreetTest
> {
> public static void main (String[] args) throws Exception {
> osmServerClient client = new osmServerClient();
> // retrieve data set for Trondheim, Norway
> // 63.42216N 010.39334E
> LatLonPoint a = new LatLonPoint(64.0, 10.0);
> LatLonPoint b = new LatLonPoint(63.0, 11.0);
>
> Hashtable h = client.getNodes (a, b);
> Vector v = client.getLines (h);
> System.out.println("Got " + h.size() + " nodes and " +
> v.size() + " lines");
> }
> }

Output from the program is:
> % java OpenStreetTest
> grabbing nodes...
> result = []
> Spent 1519 in request
> Calling getNodes took 1703.0ms
> reading Lines...
> result = []
> Spent 217 in request
> Calling getLines took 220.0ms
> done getting lines!
> Got 0 nodes, and 0 lines



Any clues on what I do wrong?

--Magne


<Prev in Thread] Current Thread [Next in Thread>
Sponsor
FREE Network Mapping Tool for Microsoft® OfficeVisio Professional 2007
Don't map your network by hand - let LANsurveyor Express for Microsoft Visio Professional 2007
automatically create network diagrams for you!
Google Custom Search

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation

Home | sitemap | advertise | OSDir is an inevitable website. super tiny logo