Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a beginner in ArcGIS and I was following this tutorial. I am trying to find a route between two points. I created a sample application, in which first, i get the two points on map single tap as follows

        public boolean onSingleTap(final MotionEvent e)
            Point point = map.toMapPoint(new Point(e.getX(), e.getY()));
            if (points.size() == 2)
                new FindRouteTask().execute();
            return true;

and my FindRouteTask is as follows

private class FindRouteTask extends AsyncTask<Void, Void, RoutingResult>

        ProgressDialog  dialog  = new ProgressDialog(FindeRouteActivity.this);
        RoutingResult   mResults;

        protected void onPreExecute()
            dialog.setMessage("Finding routes...");

        protected RoutingResult doInBackground(Void... params)
            RoutingParameters routeParams = new RoutingParameters();

            String routeTaskURL = "";
            RoutingTask routeTask = new RoutingTask(routeTaskURL, null);

            NAFeaturesAsFeature naFeatures = new NAFeaturesAsFeature();
            // Create the stop points from point geometry
            StopGraphic startPnt = new StopGraphic(points.get(0));
            StopGraphic endPnt = new StopGraphic(points.get(1));
            // set features on routing feature class
            naFeatures.setFeatures(new Graphic[] { startPnt, endPnt });
            // set stops on routing feature class
                mResults = routeTask.solve(routeParams);
            } catch (Exception e)
                return null;
            return mResults;

        protected void onPostExecute(RoutingResult result)
            if (result == null || !result.getRoutes().isEmpty())
                Toast.makeText(FindeRouteActivity.this, "There was some problem in fetching the routes. Please try again!", Toast.LENGTH_SHORT).show();
            } else


But the problem is that routeTask.solve(routeParams) always throws a exception

Failed to convert the input propertyset into a recordset to load into the NAClass "Stops".  The coordinates or measures are out of bounds.  

Could anyone please tell me what am I doing wrong and what the problem is??
-Thanks in advance

share|improve this question
No, Its still giving the same error. If you got solved this error, Please share the source code so it would be helpful for us @Antrromet – user3206549 Sep 6 '14 at 21:47
up vote 2 down vote accepted

The problem was that we need to set the spatial reference of the naFeatures that we were sending. Hence


solved the problem!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.