public String findShortestPath(int id,String source,String target,
			boolean reverse_cost ) {
		
		String rTable = "road_profile_"+id;
		
		StringBuffer sb = new StringBuffer();
		
		JSONObject jobj   = new JSONObject();
		JSONObject jstat  = new JSONObject();
		JSONArray  jfeats = new JSONArray();
		
		int sCode       = 200;
		String sMessage = "Command completed successfully";
		
		double len = 0d;
		
		sb.append("select gid,class,name,cost,");
		sb.append("st_length(the_geom::geography) as length,");
		sb.append("st_asgeojson(st_linemerge(the_geom)) as the_geom ");
		sb.append("from find_astar_sp('").append(source).append("','");
		sb.append(target).append("',").append(RouteProperties.getBbox_sp());
		sb.append(",'").append( rTable );
		sb.append("',").append(RouteProperties.getDirected());
		sb.append(",").append( reverse_cost ).append(")");
				
		if( dbConn != null ) {
			try {				
				Connection conn = dbConn.getConnection();
				Statement stmt  = conn.createStatement();
				
				ResultSet rs = stmt.executeQuery(sb.toString());

				while( rs.next() ) {
					JSONObject jfeat = new JSONObject();
					JSONObject jcrs  = new JSONObject();
					JSONObject jcprop= new JSONObject();
					JSONObject jprop = new JSONObject();
					JSONObject jgeom = new JSONObject(rs.getString("the_geom"));
					
					jcprop.put("code", RouteProperties.getSrid() );
					jcrs.put("type", "EPSG");
					jcrs.put("properties", jcprop);
					
					jprop.put("id", rs.getDouble("gid"));
					jprop.put("length", rs.getDouble("length"));
					jprop.put("class", rs.getString("class"));
					jprop.put("name", rs.getString("name"));
					jprop.put("cost", rs.getDouble("cost"));
					
					jfeat.put("crs", jcrs);
					jfeat.put("geometry", jgeom);
					jfeat.put("type", "Feature");
					jfeat.put("properties", jprop);
					jfeats.add(jfeat);

					len += rs.getBigDecimal("length").doubleValue();
				}

				rs.close();
				stmt.close();
				conn.close();
			}
			catch(Exception ex) {
				sCode = 400;
				sMessage = "Database Query Error";
				ex.printStackTrace();
			}
		}
		else {
			sCode = 400;
			sMessage = "Database Connection Error";
		}

		try {
			jstat.put("code", new Integer(sCode));
			jstat.put("success", true);
			jstat.put("message",sMessage);

			jobj.put("type", "FeatureCollection");
			jobj.put("features", jfeats);
			jobj.put("total", new Double(len));
			jobj.put("status",jstat);			 
		}
		catch( Exception e ) {
			;
		}
		
		return jobj.toString();
	}